[R] arima() in for loop

Detlef Steuer Detlef.Steuer at unibw-hamburg.de
Mon Oct 28 16:41:18 CET 2002


Hi!

Try the try() command for the parts of your code that fail.
Maybe itŽs going to be your friend.

detlef

On 28-Oct-2002 vito muggeo wrote:
> hi all,
> In a simulation context I'm running in a for loop the arima() function
> 
> for( i in 1:1000){
>         y<-arima.sim(....)
>         out<-arima(y,....)
>         ........
>          }
> Everything works, but after some cycle (10, say) I get error due to the
> particular y-values simulated. (E.g., a *frequent* error is "Error in
> svd(na.omit(xreg)) : 0 extent dimensions") As a consequence the overall loop
> does not continue!
> 
> Is it possible to skip the "errors" ? i.e I'd like that, when arima() is not
> able to estimate the model, it returns 0, say (or some other object), in
> order to allow the loop to go on.
> 
> I tried to look inside the code of arima(), but I'm not so expert to find
> the solution
> 
> Many thanks,
> best,
> vito
> 
> Sorry if you receive this message two times.
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
> -
> r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
> Send "info", "help", or "[un]subscribe"
> (in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._.
> _

"There is no way to peace, peace is the way." -- Ghandi

Detlef Steuer --- http://fawn.unibw-hamburg.de/steuer.html
***** Encrypted mail preferred *****
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list