In your error message, I think you need the second vertical line in your
OR operator.
Anders
On Mon, 5 Mar 2007, Riccardo wrote:
Hi,
Thanks to Mr Grimmer for the precious advice,
I've done some test with some parameters , here are the results:
TEST 1) z.out1<- zelig(Diff(Y, 0, 0, 24)~ lag.eps(0, 0) + lag.y(0, 1),
model="arima", data="your.data")
R calculates coefficients but when i do the predictions ( with sim() .. )
it shows me this error:
Error in if (temp[i] == 2 | temp[i] == 4) { :
missing value where it is demanded TRUE/FALSE
TEST 2) z.out1<- zelig(Diff(Y, 0, 0, 24)~ lag.eps(0, 2) + lag.y(0, 2),
model="arima", data="your.data")
All ok, but the expected values aren't so realistic..
TEST 3) z.out1<- zelig(Diff(Y, 0, 0, 24)~ lag.eps(0, 1) + lag.y(0, 1),
model="arima", data="your.data")
All ok, but the expected values aren't so realistic..
and it displays some warnings:
the seasonal part MA isn't invertible in: in: predict.Arima(temp, newxreg =
NULL, n.ahead = (pred.ahead))
TEST 4) z.out1<- zelig(Diff(Y, 0, 1, 24)~ lag.eps(0, 1) + lag.y(0, 1),
model="arima", data="your.data")
All ok, values quite realistic.
and it displays some warnings:
the seasonal part MA isn't invertible in: in: predict.Arima(temp, newxreg =
NULL, n.ahead = (pred.ahead))
TEST 5) z.out1<- zelig(Diff(Y, 0, 1, 24)~ lag.eps(0, 2) + lag.y(0, 2),
model="arima", data="your.data")
All ok, values quite realistic.
and it displays some warnings:
the seasonal part MA isn't invertible in: in: predict.Arima(temp, newxreg =
NULL, n.ahead = (pred.ahead))
TEST 6) z.out1<- zelig(Diff(Y, 0, 1, 24)~ lag.eps(0, 0) + lag.y(0, 3),
model="arima", data="your.data")
R calculates coefficients but when i do the predictions ( with sim() .. )
it shows me this error:
Error in if (temp[i] == 2 | temp[i] == 4) { :
missing value where it is demanded TRUE/FALSE
TEST 7) z.out1<- zelig(Diff(Y, 0, 1, 24)~ lag.eps(0, 3) + lag.y(0, 3),
model="arima", data="your.data")
All ok, values not so realistic.
TEST 8) z.out1<- zelig(Diff(Y, 1, 1, 24)~ lag.eps(0, 1) + lag.y(0, 1),
model="arima", data="your.data")
All ok, values not so realistic.
i've put the graphics online on this link ( 120 kB if somebody wanna
wiew!!):
http://rascal.netsons.org/Graph.zip
Concluding, i think the most accurate prevision for my dataSet is in TEST 5.
If you have some suggestion i'm here to listen!
All the Best
Riccardo
-----Messaggio originale-----
Da: owner-zelig_at_lists_gking_harvard_edu(a)mail.hmdc.harvard.edu
[mailto:owner-zelig_at_lists_gking_harvard_edu@mail.hmdc.harvard.edu] Per
conto di Justin Ryan Grimmer
Inviato: sabato 3 marzo 2007 18.24
A: zelig(a)lists.gking.harvard.edu
Oggetto: [zelig] [Zelig] seasonal time series
Hi Riccardo,
Great question. Zelig provides an intuitive format for analying seasonal
ARIMA models (here after sARIMA). The following is the general set-up for
a sARIMA model
z.out1<- zelig(Diff(Y,d,ds,per) ~ lag.eps(q,qs) + lag.y(p,ps), data =
mydata, model = "arima")
where:
Y<- time series to be analyzed
d<- order of intergration for time series
d.s<- order of integration for seasonal components
per<- the period of the time series
q<- number of error terms (innovations) to lag
q.s<- number of seasonal error terms to lag
p<- number of dependent variables to lag
p.s<- number of seasonal dependent variables to lag, based upon per, the
period
Let's say that you want to estimate an
ARIMA model with a period of 24, and you want to have a lag of one
dependent variable from the previous season, then you would specify the
following model:
z.out1<- zelig(Diff(Y, 0, 0, 24)~ lag.eps(0, 0) + lag.y(0, 1),
model="arima", data="your.data")
You can use more complicated ARIMA structures just by filling in the
appropriate arguments.
If you do not have any covariates to include, you can then forecast your
time series. Zelig offers a simulation approach that allows you to
include uncertainty from estimating coefficients in your forecasts, while
usually negligible, this provides more accurate representation of
uncertainty for long forecasts.
To do this you enter a "setx" command as follows,
x.out<- setx(z.out1, pred.ahead=10)
this predicts 10 periods ahead.
Then, you can generate simulated results as follows:
s.out<- sim(z.out1, x=x.out)
Please let me know if you are still running into trouble with the ARIMA
package.
Cheers,
Justin Grimmer
PhD Student
Department of Government
Harvard University
-
Zelig Mailing List, served by Harvard-MIT Data Center
Send messages: zelig(a)lists.gking.harvard.edu
[un]subscribe Options:
http://lists.gking.harvard.edu/?info=zelig
Zelig program information:
http://gking.harvard.edu/zelig/
-
Zelig Mailing List, served by Harvard-MIT Data Center
Send messages: zelig(a)lists.gking.harvard.edu
[un]subscribe Options: