Re: [R] R time series analysis

2010-09-07 Thread lord12

For each arima model, can you output an associated confidence interval for
the predicted value at each time point? 
-- 
View this message in context: 
http://r.789695.n4.nabble.com/R-time-series-analysis-tp2527513p2530595.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R time series analysis

2010-09-07 Thread David Winsemius


On Sep 7, 2010, at 7:51 PM, lord12 wrote:



For each arima model, can you output an associated confidence  
interval for

the predicted value at each time point?


?arima0

arima0 will return ... a list with components pred, the  
predictions, and se, the estimated standard errors as time series  
when se.fit = TRUE.

--
View this message in context: 
http://r.789695.n4.nabble.com/R-time-series-analysis-tp2527513p2530595.html

--

David Winsemius, MD
West Hartford, CT

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R time series analysis

2010-09-07 Thread David Winsemius


On Sep 7, 2010, at 9:33 PM, David Winsemius wrote:



On Sep 7, 2010, at 7:51 PM, lord12 wrote:



For each arima model, can you output an associated confidence  
interval for

the predicted value at each time point?


?arima0

arima0 will return ... a list with components pred, the  
predictions, and se, the estimated standard errors as time series  
when se.fit = TRUE.


See also:

predict.Arima {stats}


--
View this message in context: 
http://r.789695.n4.nabble.com/R-time-series-analysis-tp2527513p2530595.html

--

David Winsemius, MD
West Hartford, CT

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


David Winsemius, MD
West Hartford, CT

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R time series analysis

2010-09-06 Thread matteodefelice


lord12 wrote:
 
 I have a data file with a given time series of price data and I would like
 to split the time series into a test set and training set. I would then
 like to build an ARIMA model on the training set and apply this model on
 test set. 
 
I had recently the same problem and, after checking documentation and
mailing list archives, I discovered that it is not possible to apply the
same model on a different data set. Of course you can create the model on a
part of the dataset and then check the prediction with the remaining part,
as a testing set. But, if you have new data you and you want to apply the
same model on them...nothing! I checked the source code of ARIMA functions
but it was too complex and I hadn't enough time to learn all that stuff.
However I found a little workaround:

1. I calibrate the model on the training part 
2. I create a new model with the same parameters, using fixed (check arima
documentation) on the new data
3. go to step 2. every time you have new data

It worked for me. 
-- 
View this message in context: 
http://r.789695.n4.nabble.com/R-time-series-analysis-tp2527513p2528200.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R time series analysis

2010-09-05 Thread lord12

How do I get the predicted values and the errors for each arima model? 

-- 
View this message in context: 
http://r.789695.n4.nabble.com/R-time-series-analysis-tp2527513p2527533.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.



Re: [R] R time series analysis

2010-09-05 Thread lord12

How do you evaluate the predictive models? For example if I have:

arima1 = arima(training, order = c(1,1,1))
arima2 = arima(training, order = c(0,0,0))
x.fore = predict(arima1, n.ahead=5)  
x.fore1 = predict(arima2, n.ahead = 5)

How do I know which arima model is better for prediction? 
-- 
View this message in context: 
http://r.789695.n4.nabble.com/R-time-series-analysis-tp2527513p2527672.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R time series analysis

2010-09-05 Thread Stephan Kolassa

Hi,

basically, you know 5 periods later. If you use a good error measure, 
that is.


I am a big believer in AIC for model selection. I believe that arima() 
also gives you the AIC of a fitted model, or try AIC(arima1).


Other ideas include keeping a holdout sample or some such.

I'd recommend looking at a time series textbook.

HTH,
Stephan


Am 05.09.2010 22:37, schrieb lord12:


How do you evaluate the predictive models? For example if I have:

arima1 = arima(training, order = c(1,1,1))
arima2 = arima(training, order = c(0,0,0))
x.fore = predict(arima1, n.ahead=5)
x.fore1 = predict(arima2, n.ahead = 5)

How do I know which arima model is better for prediction?


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R time series analysis

2010-09-05 Thread Johnson, Cedrick W.
 You also may want to look at auto.arima in the 'forecast' package, 
which will return the best ARIMA model based on AIC/AICc/BIC values


?auto.arima

hth
c

On 09/05/2010 06:02 PM, Stephan Kolassa wrote:

Hi,

basically, you know 5 periods later. If you use a good error measure, 
that is.


I am a big believer in AIC for model selection. I believe that arima() 
also gives you the AIC of a fitted model, or try AIC(arima1).


Other ideas include keeping a holdout sample or some such.

I'd recommend looking at a time series textbook.

HTH,
Stephan


Am 05.09.2010 22:37, schrieb lord12:


How do you evaluate the predictive models? For example if I have:

arima1 = arima(training, order = c(1,1,1))
arima2 = arima(training, order = c(0,0,0))
x.fore = predict(arima1, n.ahead=5)
x.fore1 = predict(arima2, n.ahead = 5)

How do I know which arima model is better for prediction?


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide 
http://www.R-project.org/posting-guide.html

and provide commented, minimal, self-contained, reproducible code.


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.