Advertisement
Guest User

Untitled

a guest
Aug 1st, 2014
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. cds<- structure(c(2580L, 2263L, 3679L, 3461L, 3645L, 3716L, 3955L,
  2. 3362L, 2637L, 2524L, 2084L, 2031L, 2256L, 2401L, 3253L, 2881L,
  3. 2555L, 2585L, 3015L, 2608L, 3676L, 5763L, 4626L, 3848L, 4523L,
  4. 4186L, 4070L, 4000L, 3498L), .Dim = c(29L, 1L), .Dimnames = list(
  5. NULL, "CD"), .Tsp = c(2012, 2014.33333333333, 12), class = "ts")
  6.  
  7. fit4 <- arimax(log(cds), order = c(1,1,0),include.mean=FALSE,
  8. xtransf = data.frame(Oct13 = 1*(seq_along(cds)==22)),
  9. transfer = list(c(1,0))
  10. ,xreg=1*(seq_along(cds)==3))
  11. fit4
  12.  
  13. # ARIMA(1,1,0)
  14.  
  15. # Coefficients:
  16. # ar1 xreg Oct13-AR1 Oct13-MA0
  17. # -0.0184 0.2718 0.4295 0.4392
  18. # s.e. 0.2124 0.1072 0.3589 0.1485
  19.  
  20. # sigma^2 estimated as 0.02176: log likelihood=13.85
  21. # AIC=-19.71 AICc=-16.98 BIC=-13.05
  22.  
  23. int_vect1<-1*(seq_along(cds)==22)
  24. wo<- 0.4392
  25. delta<-0.4295
  26.  
  27.  
  28. mt<-rep(0,length(int_vect1))
  29.  
  30. for (i in 1:length(int_vect1))
  31. {
  32.  
  33. if (i>1)
  34. {
  35. mt[i]<-wo*int_vect1[i]+delta*mt[i-1]
  36. }
  37.  
  38. }
  39.  
  40.  
  41. mt
  42.  
  43. sum(exp(fitted(fit4)) - (exp(fitted(fit4) - mt)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement