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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
you could try with the function...try(). Hope it helps, Claudio -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Dear VIto, At 12:50 PM 10/28/2002 +0100, 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 solutionTake a look at the try function, which is designed to trap errors. Regards, John ----------------------------------------------------- John Fox Department of Sociology McMaster University Hamilton, Ontario, Canada L8S 4M4 email: jfox at mcmaster.ca phone: 905-525-9140x23604 web: www.socsci.mcmaster.ca/jfox ----------------------------------------------------- -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._