Displaying 2 results from an estimated 2 matches for "sin12".
Did you mean:
sin1
2011 Dec 13
2
Problem with ploting fitted values
...values.
Below is the code with data library:
/
library(forecast)
data(AirPassengers)
AP <- AirPassengers
class(AP)
start(AP)
end(AP)
frequency(AP)
lgAP <- log(AP)
t<-2:length(AP)
APsL<-log(ts(lgAP, start=1949, frequency=12))
final<-(ts.intersect(lgAP,lgAPlag=lag(lgAP,-1), t=t,
sin12 = sin(2*pi*t/12), cos12 = cos(2*pi*t/12),dframe=TRUE))
summary(AIRlm <- lm(lgAP ~ lgAPlag + t + sin12 + cos12, data=final))
plot(lgAP, main="Log of Air Passengers",type="l", col=4, lty=2, lwd=2)
lines(t, AIRlm$fitted, col=2, lwd=2)
legend("topleft", legend=c(&qu...
2007 Dec 19
0
leaps
...FALSE
cos7 cos9 cos11 cos14 cos17 cos19
TRUE FALSE FALSE FALSE FALSE FALSE
sin1 sin2 sin3 sin4 sin5 sin6
TRUE TRUE TRUE FALSE TRUE FALSE
sin12
FALSE*
[[alternative HTML version deleted]]