R Markdown 英文作业代写、代做编程类作业

R Markdown 英文作业代写、代做编程类作业
Assignment 2, Computer Exercise Results
This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see
When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document.
You must submit to Moodle two files
1. this R Markdown file expanded with Rcode chunks and your answers and comments to questions.
2. a pdf version of this knitted R Markdown file which will be named A2Rcode.pdf
Question a) Set up AR(2) parameters.
SID=3141593 ## replace by your own SID
set.seed(SID)
plot(c(-2,0,2),c(-1,1,-1), type="n",xlim=c(-2,2), ylim=c(-1,1),
xlab="phi1", ylab="phi2")
abline(h=0)
abline(c(1,1),lty=2)
abline(c(1,-1),lty=2)
abline(h=-1, lty=2)
lines(seq(-2,2,0.01),-seq(-2,2,0.01)^2/4,col="green")

phi1=sample(c(-1,1),1)*runif(1,0,2)
if(phi1<0) phi2 = runif(1,-1,phi1+1) else phi2=runif(1,-1,1-phi1)
phi1=0.9*phi1 ## shrinks away from boundary.
phi2=0.9*phi2
points(phi1,phi2,col="red", pch=4)

INSERT EXTRA CODE CHUNKS HERE TO ANSWER THESE QUESTIONS AND ANSWER THEM BELOW:*
i. In at most 8 lines explain what the above code does.
ii. Determine if the parameter values produce a stationary solution by finding the roots of the appropriate polynomial.
iii. Are the roots: equal, real pair, or complex pair?
In particular refer to lectures in week 3 concerning section 3.2.2 of the notes on possible space of parameter values for an AR(2) as part of your explanations.
Question b) Simulate and AR(2) process and fit an AR to it.
n=200
X=2+arima.sim(model=list(ar=c(phi1,phi2)),n=n)
arfit=ar.yw(X,constant=TRUE)
ANSWER THE FOLLOWING QUESTIONS HERE:
i. Briefly summarize what the code simulates and fits.
ii. Summarise the order of the fitted model and ALL estimated parameter values and their standard errors and comment on the statistical significance of the parameters.
Question c) Residual diagnostics.
Perform the following diagnostics on the residuals in the above fitted autoregression. In particular use par(mfrow=c(2,2)) to arrange a 2 by 2 grid for plots in order left to right for each row: normal probability plot, histogram, autocorrelations, partial autocorrelations. Perform the Box-Ljung test these residuals for serial dependence using a total of 10 lags for the test and report your results here and summarise the key conclusions – in particular is there any evidence that the residuals are not Gaussian white noise. INSERT EXTRA CODE CHUNKS HERE TO ANSWER part c).
Question d)
Again on a 2 by 2 plotting grid display the ACF and PACF of the time series X generated above, the theoretival ACF for the true autoregressive model and the theoretical ACF using the fitted model parameters. Report your results here and discuss your graphs pointing out similarities and differences if any. INSERT EXTRA CODE CHUNKS HERE TO ANSWER part d).
e) Prediction
Produce a plot displaying the original series X along with predictions 20 steps into the future from the end of the series with 95% prediction limits. Properly annotate and title your graph and display here. Make brief comments on the forecast and the forecast intervals INSERT EXTRA CODE CHUNKS HERE TO ANSWER part e).
f) Correct and incorrect confidence intervals for true mean of X.
Using the sample mean of X calculate an approximate 95% confidence interval for the true mean mu assuming the series is a sequence of independent random variables (incorrect). Also do this using the formula (1.3) in section 1.4.1 of the notes (correct). For this latter, use the fitted autoregressive model, compute the theoretical autocorrelations corresponding to the fitted model for lags 1 through n, use these in formula (1.3) then estimate the variance of the process by var(X). Code hints:
acfarfit=ARMAacf(ar=arfit$ar,lag.max=n)
Var.mean.correct=var(X)*(1+2*sum((1-(1:n)/n)*acfarfit[-1]))/n
Var.mean.incorrect=var(X)/n
Report your results and answer these questions:
i. Briefly explain the difference between the two variance estimates and how the above code produces the required value for formula (1.3).
ii. Compare your results and make a brief comment comparing the two intervals.
iii. Is there any evidence to suggest that the true mean is not equal to the value 2?
INSERT EXTRA CODE CHUNKS HERE TO ANSWER part f).
http://www.daixie0.com/contents/18/1263.html

本团队核心人员组成主要包括硅谷工程师、BAT一线工程师,国内Top5硕士、博士生,精通德英语!我们主要业务范围是代做编程大作业、课程设计等等。

我们的方向领域:window编程 数值算法 AI人工智能 金融统计 计量分析 大数据 网络编程 WEB编程 通讯编程 游戏编程多媒体linux 外挂编程 程序API图像处理 嵌入式/单片机 数据库编程 控制台 进程与线程 网络安全  汇编语言 硬件编程 软件设计 工程标准规等。其中代写代做编程语言或工具包括但不限于以下范围:

C/C++/C#代写

Java代写

IT代写

Python代写

辅导编程作业

Matlab代写

Haskell代写

Processing代写

Linux环境搭建

Rust代写

Data Structure Assginment 数据结构代写

MIPS代写

Machine Learning 作业 代写

Oracle/SQL/PostgreSQL/Pig 数据库代写/代做/辅导

Web开发、网站开发、网站作业

ASP.NET网站开发

Finance Insurace Statistics统计、回归、迭代

Prolog代写

Computer Computational method代做

因为专业,所以值得信赖。如有需要,请加QQ:99515681 或邮箱:[email protected]

微信:codinghelp

猜你喜欢

转载自www.cnblogs.com/python3years/p/8909519.html