R Markdown English homework ghostwriting and programming assignments

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

 

The core members of the team mainly include Silicon Valley engineers, BAT front-line engineers, top 5 master and doctoral students in China, and are proficient in German and English! Our main business scope is to do programming assignments, course design and so on.

 

Our field of direction: window programming, numerical algorithm, AI, artificial intelligence, financial statistics, econometric analysis, big data, network programming, WEB programming, communication programming, game programming, multimedia linux, plug-in programming program, API, image processing, embedded/MCU database programming, console process and thread, network security, assembly language hardware Programming software design engineering standards and regulations. The ghostwriting and ghostwriting programming languages ​​or tools include but are not limited to the following:

C/C++/C# ghostwriting

Java ghostwriting

IT ghostwriting

Python ghostwriting

Tutored programming assignments

Matlab ghostwriting

Haskell ghostwriting

Processing ghostwriting

Building a Linux environment

Rust ghostwriting

Data Structure Assginment

MIPS ghostwriting

Machine Learning homework ghostwriting

Oracle/SQL/PostgreSQL/Pig database ghostwriting/doing/coaching

web development, website development, website work

ASP.NET website development

Finance Insurance Statistics Statistics, Regression, Iteration

Prolog ghostwriting

Computer Computational method

 

Because professional, so trustworthy. If necessary, please add QQ: 99515681 or email: [email protected]

WeChat: codinghelp

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326560455&siteId=291194637