Exercise

Compute densities

Now consider two stocks: Microsoft (ticker: MSFT) and Starbucks (ticker: SBUX). Let \(X\) denote the monthly return on the Microsoft stock and let \(Y\) denote the monthly return on the Starbucks stock. Assume that \(X\) is normally distributed with a mean \(0.05\) and a variance \((0.10)^{2}\), and that \(Y\) is normally distributed with a mean \(0.025\) and a variance \((0.05)^{2}\).

Values of a normal density can be computed with function dnorm(). For instance, the value of the standard normal density at 0 can be computed with dnorm(0). You can supply the mean and the standard deviation of the normal distribution via the arguments mean and sd, respectively.

Instructions

100 XP
  • For the grid of values in x_vals, compute the values of the assumed normal density for the return on Microsoft stock and assign it to MSFT.
  • For the grid of values in x_vals, compute the values of the assumed normal density for the return on Starbucks stock and assign it to SBUX.