Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

MTH116:  Coursework 1

2021/22

1.  The stock prices of TSLA are stored in the file TSLA.csv.  Load the stock prices of TSLA into    Matlab.  Plot both the open and close prices of TSLA. Customize the plot by labelling the x- and y-axes, giving a title to the graph, setting the x- and y-axis limits, and adding a legend to the    graph.

Please go to LMO to attempt the online quiz (Questions 1-5).


Table 1: Sales data of a coffee shop

Sales volumes (cups)                       Product      Price(CNY/cup)    Profit(CNY/cup)    Quarter1    Quarter2    Quarter3    Quarter4

Americano

22

12

412

483

512

387

Cappuccino

30

16

252

287

375

231

Latte

26

13

314

234

369

367


2. A coffee shop sells three types of products. Table 1 gives the price and profit of each product,

along with the sales volumes in four quarters in 2021.

Use Matlab to answer the following questions:

(a)  Creat a 3 X 4 matrix containing the sales incomes of each product for each quarter. (b) What is the total sales income in each quarter?

(c) What is the total sales income of each product in 2021?

(d) What is the total sales profit of each product in 2021?

(e) What is the total sales profit of this coffee shop in 2021?

Please go to LMO to attempt the online quiz (Questions 6-10).




3.  ChinaStock.mat consists of the weekly close price of four Chinese companies (i.e. Tencent, JD, Baidu, Alibaba) over a year (Apr. 2, 2021 - Apr. 2, 2022).  Please write a user-defined function LogReturn (P) that computes the log return by:

rt = ln(Pt+1/Pt),

where rt  is the return of week t, Pt+1  and Pt  are close price of week t + 1 and t, respectively. Use Matlab to answer the following questions:

(a)  Compute weekly log returns for each company.

(b)  Compute the average return and the average positive return for each company.

(c)  Find the total number and the index of the weeks that all four companies’ returns are below -5%.

Please go to LMO to attempt the online quiz (Questions 11-15).



4.  Consider a portfolio consisting of an equal number of shares of the companies listed in      ChinaStock.mat. The price of the portfolio is the average price of the companies. And the accumulative return of the portfolio in period [T1, T2] is written as:

RT  = ln(Pportfolio,T2 /Pportfolio,T1 ),

where Pportfolio  is the portfolio price.

Use Matlab to answer the following questions:

(a)  Find the accumulative return of the portfolio in the one-year period.

(b)  Suppose that the portfolio holder has the option to sell the portfolio at the end of each

week during the year.  Find the maximal accumulative return and the corresponding week to sell the portfolio.

Please go to LMO to attempt the online quiz (Questions 16-19).