Exercise

Plot normal curve

Continue with the two stocks. The aim is to produce a single plot containing the two assumed normal curves. Start with plotting the normal curve for the return on Microsoft stock.

With plot(x, y), you can plot the values of y on the y-axis against the values of x on the x-axis. You can customize the plot in many ways through additional arguments (see the documentation): set type = "l" to plot the data as a connected line, use col to specify the line color, set axis labels with xlab and ylab, or set axis limits with xlim and ylim.

Instructions

100 XP
  • Plot a line for the values of the assumed normal density for the return on Microsoft stock (MSFT) against x_vals.
  • Customize the plot in the following way: use a blue line, set the y-axis label to "Normal curves", and set the y-axis to be in the interval \([0,8]\).