跳至正文

别emo,代写r作业assignment示例Rstudio report

此次仅仅展示了,R code在单一领域的应用,其他方向的我们均可以提供协助

欢迎发送相关material files留言咨询!

Assignment Instruction:
Use Rstudio.
Your homework should be submitted as an R Markdown file. Please submit the knitted .pdf (or .html) file along with the .Rmd代写 file. Please clearly label the questions in your responses and support your answers by textual explanations and the code you use to produce the result. Note that you cannot answer the questions by observing the data in the “Environment” section of RStudio or in Excel —-you must use coded commands.

扫一扫又不会怀孕,扫一扫,作业无烦恼。
留学顾问の QQ:2128789860
留学顾问の微信:risepaper

Data
In this analysis you will investigate two datasets. The first dataset is the Standard & Poor’s 500 financial index (SP500) measured on a weekly basis over the sampling period 01/01/1990-10/19/2017. The next dataset is the Dow Jones Industrial financial index (DJI) measured on a weekly basis over the sampling period 01/01/1990-10/20/2017.

Bootstrap Procedure, The Autoregressive Model, 代写Estimation

We consider the autoregressive lag 1 model stated below:

Tasks
1.Write a function that estimates the AR(1) parameter φ. Your function should use either the linear
model function代写 lm() or the non-linear minimization function nlm() to estimate the parameter φ .To
incorporate the bootstrap procedure for Task 2, your function should generalize to any data vector. Use
your AR(1) function to estimate φ for both datasets “SP500Weekly.csv” and “DJIndustrialDaily.csv.”
Note: to incorporate the bootstrap procedure, I recommend adding an additional argument in your
estimation function that allows for the bootstrap indices.

2. Write another function that runs the bootstrap procedure on the parameter φ .This function should
generalize to any dataset and should also incorporate the estimation function from Task 1. Set the seed
to set.seed(0) and run B = 1000 bootstrap iterations. Please specify whether you used the percentile
based bootstrap intervals or the regular bootstrap intervals. Test your function on the full datasets
“SP500Weekly.csv” and “DJIndustrialDaily.csv.”

3. Run the bootstrap procedure on each dataset over the years 1990 through 2017. This will result in 28 intervals for each dataset. To summarize the results, plot the bootstrap intervals vertically as a function of time. Also plot a horizontal line at 1, which will indicate if the time series exhibits random walk behavior in in that year.

4. Briefly summarize your results.