[R] arima crashes too

Alberto Monteiro albmont at centroin.com.br
Fri Oct 23 13:32:30 CEST 2009

Barry Rowlingson wrote:
>> However, arima crashes for this:
>> arima(c(1.71, 1.78, 1.95, 1.59, 2.13), order=c(1,0,0))
>  I'm not getting what I'd call 'crashes' with your arma or arima
> examples- I get an error message and a warning:
>> arma(c(2.01, 2.22, 2.09, 2.17, 2.42), order=c(1,0))
> Error in AA %*% t(X) : requires numeric/complex matrix/vector arguments
> In addition: Warning message:
> In ar.ols(x, order.max = k, aic = FALSE, demean = FALSE, intercept =
> include.intercept) :
>   model order: 2singularities in the computation of the projection
> matrixresults are only valid up to model order1
>  You've not told us what you get, 
Because I get a message in Portuguese. But the meaning is precisely
that one: Error in AA %*% t(X).

> and the phrase 'crash' normally
> means some kind of memory error that *terminates* a running R 
> session. 
Ah, maybe then "crash" is not the correct word. It "stops" running
whatever it is running. Maybe "abort" is the best word?

> Are you really crashing R such that it terminates? In which 
> case, what version number/platform etc?
I mean that, if I run a loop, it doesn't finish. Or, more 
catastrophically, if I am running a loop and saving data to an
open file, it terminates the loop and does not close the file.

Reproducible example:

test.arima <- function() {
  lets.crash.arima <- c(71, 78, 95, 59) # , 113
  for (x in 90:120) {
    reg <- arima(c(lets.crash.arima, x), order = c(1,0,0))
    cat("ok for x =", x, "\n")
  cat("close file and prepare a nice summary\n")
  return("arima passed the test")


As you can see, the loop aborts, the function never returns, with
potentially nasty effects (namely: I have to finish R with q() to
close the files and examine them).

Alberto 'Darth Albmont' Monteiro

More information about the R-help mailing list