|
Answer» Here are the correct steps for generating a random WALK using the R LANGUAGE: - Use the arima.sim() to generate a Randomwalk model.
- Now, go to the model argument and set it equal to a list(order = c(0, 1, 0)) for generating a RW-type model.
- After that, set “n” EQUALS 10 sp as to produce 10 different observations and then SAVE this to the random_walk.
- Now, use the ts.plot()function for plotting your random_walk data.
- Next, use the diff() function for calculating the first difference between sets of your random_walk data.
- Now, you can save this as random_walk_diff.
- Finally, you should use another CALL to ts.plot() to be used for plotting random_walk_diff
|