[R] arima() in for loop

Prof Brian D Ripley ripley at stats.ox.ac.uk
Mon Oct 28 18:23:17 CET 2002


A case for try(), I think.

On Mon, 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
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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