Presentation is loading. Please wait.

Presentation is loading. Please wait.

With joint time series data and either a bivariate model, data (X(t),Y(t); t = 0,...,T-1) or a regression/transfer function model the following R functions.

Similar presentations


Presentation on theme: "With joint time series data and either a bivariate model, data (X(t),Y(t); t = 0,...,T-1) or a regression/transfer function model the following R functions."— Presentation transcript:

1 With joint time series data and either a bivariate model, data (X(t),Y(t); t = 0,...,T-1) or a regression/transfer function model the following R functions are available: 1. ccf() 2. arimax() use xreg option to fit Y(t) = c(0)X(t) + c(1)X(t-1) c(K)X(t-k) + Z(t), Z(.) noise 3. spectrum() A key parameter estimated in 3. is the coherence.

2 Monthly price of oil - Jan 86 to Jan 2006 Fit arima
Check via acf and spec of residuals library(TSA) data(oil.price) par(mfrow=c(2,1)) plot(log(oil.price),main="log(monthly oil.prices)",type="l") m1.oil<-arima(log(oil.price),order=c(0,1,1)) plot(residuals(m1.oil),type="l",main="residuals ARIMA(0,1,1)") acf(residuals(m1.oil),main="acf residuals") spec(residuals(m1.oil),span=2,log="yes",main="log(spectrum) residuals")

3

4

5 postscript(file="unemploy. eps") par(mfrow=c(2,1)) junk<-read
postscript(file="unemploy.eps") par(mfrow=c(2,1)) junk<-read.table("unrate.dat",header=F) time<-seq(from=1948,to=(2013-1/12),by=1/12) rate<-c(junk[,2],NA,NA) junknsa<-read.table("unratensa.dat",header=F) ratensa<-c(junknsa[,2],NA,NA) plot(time,ratensa,xlab="",ylab="year",main="Not seasonally adjusted unemployment rate ",type="l") plot(time,rate,xlab="",ylab="year",main="Seasonallu adjusted unemployment rate ",type="l") spectrum(ratensa[1:778],spans=5,main="Spectrum estimate unadjusted") for(j in 1:6){ abline(v=j/12,col="blue") } spectrum(rate[1:778],spans=5,main="Spectrum estimate adjusted") for(j in 1:6){ abline(v=j/12,col="blue") } graphics.off()

6

7


Download ppt "With joint time series data and either a bivariate model, data (X(t),Y(t); t = 0,...,T-1) or a regression/transfer function model the following R functions."

Similar presentations


Ads by Google