Question: Run the following R code. The set.seed ( ) command insures that everyone using this code will have the same random numbers and will obtain
Run the following R code. The set.seed command insures that everyone using this code will have the same random numbers and will obtain the same price series. There are trading days per year, so you are simulating year of daily returns nine times. The price starts at
The code parmfrowc on line opens a graphics window with three rows and three columns and rnorm on line generates normally dis tributed random numbers.
set.seed
n
parmfrowc
for i in :
logr rnormn sqrt
price c expcumsumlogr
plotprice type b
Problem In this simulation, what are the mean and standard deviation of the logreturns for year?
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
