[R-SIG-Mac] NaN bug with arima() on Mac

Ken Beath ken @end|ng |rom kjbe@th@com@@u
Tue Nov 23 00:19:23 CET 2021


Looking at the returned object there are problems with some of the standard errors which are NaN for both aima and arima0. This usually indicates that the Hessian doesn’t have the required form. This can be very dependent on the system. It also probably means that the model you are fitting is over parameterised.

Ken

> On 23 Nov 2021, at 9:21 am, Simon Urbanek <simon.urbanek using R-project.org> wrote:
> 
> 
> Nikolas,
> 
> what makes you think it is a bug? It is an optimization process, so the objective function is free to produce NaN for unsuitable parameters so it can steer the optimization away from such areas.
> 
> Cheers,
> Simon
> 
> 
>> On Nov 23, 2021, at 2:29 AM, Kuschnig, Nikolas <nikolas.kuschnig using wu.ac.at> wrote:
>> 
>> Dear all,
>> 
>> There seems to be a small bug with `arima()` on Mac. For some very specific data
>> I get the following warning:
>> 	Warning message:
>> 	In log(s2) : NaNs produced
>> This seems to stem from `.Call(C_ARIMA_Like, x, Z, 0L, FALSE)` in the `armafn()`
>> objective function. This warning does not occur on Linux or Windows systems or
>> when using the `arima0()` function.
>> Below is an example that I hope reproduces (please excuse the dependency, I only
>> encountered it with this data, partly due to my lack of a Mac). Note that the
>> warning in question occurs during estimation, printing always induces a warning.
>> 
>> 
>> # install.packages("BVAR")
>> library("BVAR")
>> 
>> x <- fred_qd[1:243, 
>> c("GDPC1", "PCECC96", "GPDIC1", "HOANBS", "GDPCTPI", "FEDFUNDS")]
>> x <- fred_transform(x, codes = c(4, 4, 4, 4, 4, 1))
>> Y <- as.matrix(x)[6:nrow(x), ]
>> 
>> ar <- apply(Y, 2, arima, order = c(5, 0, 0)) # Warning only on Mac
>> ar0 <- apply(Y, 2, arima0, order = c(5, 0, 0)) # No warning
>> 
>> 
>> Does anyone have any more information on this? Thanks for the help!
>> 
>> Best,
>> -- 
>> Nikolas Kuschnig
>> 
>> _______________________________________________
>> R-SIG-Mac mailing list
>> R-SIG-Mac using r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
> 
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac using r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac



More information about the R-SIG-Mac mailing list