nickpoison / tsa4 Goto Github PK
View Code? Open in Web Editor NEWR code for Time Series Analysis and Its Applications, Ed 4
R code for Time Series Analysis and Its Applications, Ed 4
Dear Nicky Poison,
In the Example 5.12 of Chapter 5: Additional Time Domain Topics
https://github.com/nickpoison/tsa4/blob/master/textRcode.md#chapter-5
The R code command line below:
acf(innov)
has created the error as below.
Error in na.fail.default(as.ts(x)) : missing values in object
I guess the arugment "na.action = na.fail" as default value by stats::acf function may be the cause of the error.
So, I set the arugment "na.action = na.pass" in the command line above as
acf(innov, na.action = na.pass)
to have a display of 3 x 3 plots of acf() as result.
I may be wrong.
Please consider the suggestion in your side to check whether my suggestion is wrong or not.
Thanks in advance.
Best regards,
Jimmy Au
tsplot(innov)
head(innov) # contains missing values
u1 u2 u3
1 NA NA NA
2 NA NA NA
3 -7.986554 -3.401042 -6.244936
4 -3.757739 5.160169 -2.446715
5 -2.455558 6.115729 11.073832
6 -1.188275 -2.249943 -10.914951
#acf(innov) # <-------- Error
acf(innov, na.action = na.pass)
acf(innov)
Error in na.fail.default(as.ts(x)) : missing values in object
The following code of Example 3.11 is inconsistent with the chart shown in left-hand-side of Fig 3.5.
Lines 567 to 569 in 775a7ec
ACF is a list with value of ACF[1] being actually
The following figure shows what will be plotted using the code above.
Actually ACF chart should be start with index 0. Or, if we just ignore ACF[1] (which is always 1), the code should be:
ACF = ARMAacf(ar=c(1.5,-.75), ma=0, 25)[-1]
plot(ACF, type="h", xlab="lag")
abline(h=0)
which produces
The chart above is exactly Fig 3.5 in the text.
> version
_
platform x86_64-apple-darwin17.0
arch x86_64
os darwin17.0
system x86_64, darwin17.0
status
major 4
minor 0.2
year 2020
month 06
day 22
svn rev 78730
language R
version.string R version 4.0.2 (2020-06-22)
nickname Taking Off Again
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.