okay so now we are up and plotting. Let’s dive into some analysis.
First we want to see if we can use the series so we have to see if its covariance stationary and that means that its mean is constant and also we can’t be able to predict the errors.
we do this by plotting the difference of the terms to get the errors and if we have crazy up and downlines with no distinguishable pattern then we can can fit the errors to a line of some sort. thats a great and beautiful thing.
1. To do this plot type the following
plot.ts(diff(log(GDP)),main=”Logged and Diffed”)
Mission accomplished. We have an up and down picasso beauty.
We can now get fancy and smooth the series with a 2-way moving average.
fGDP(t) = ⅛GDP(t-2) + ¼GDP(t-1) + ¼GDP(t) + ¼GDP(t+1) + ⅛GDP(t+2)
To do this fancy maneuvering type the following:
that was beautiful right?
Now to test the normality via plot type in:
To do a formal test for normality type in:
This is called the Shapiro-Wilk normality test
W = 0.9642, p-value = 5.015e-06
the closer the W is to one the better and with an extremely small p-value we can reject the null hypothesis that the series is not normal and accept the alternative that it is!
Keep dancin’ ladies and gents we have more on the way!