[R] Problem Solved: optim fails when using arima

Prof J C Nash (U30A) nashjc at uottawa.ca
Thu Feb 12 12:59:34 CET 2015


I would not say it is fully "solved" since in using Nelder-Mead
you did not get the Hessian.

The issue is almost certainly that there is an implicit bound due to
log() or sqrt() where a parameter gets to be near zero and the finite
difference approximation of derivatives steps over the cliff. Probably
some NM steps are doing the same, but returning a large function value
which will allow NM to "work", but possibly make it inefficient.

JN

On 15-02-12 06:00 AM, r-help-request at r-project.org wrote:
> Message: 30
> Date: Wed, 11 Feb 2015 08:10:03 -0700
> From: Albert Shuxiang Li <albert.shuxiang.li at gmail.com>
> To: r-help at r-project.org
> Subject: [R] Problem Solved: optim fails when using arima
> Message-ID:
> 	<CANko1DKHubongY0zDTNVGXxmvfi8c+D3Z-akykVA5TNkrp7HKA at mail.gmail.com>
> Content-Type: text/plain; charset="UTF-8"
> 
> I am using arima(x, order=c(p,0,q)) function for my project, which deals
> with a set of large differenced time series data, data size varies from
> 8000 to 70000. I checked their stationarity before applying arima.
> Occasionally, arima(x, order=c(p,0,q)) gives me error like following (which
> stops script running):
> 
> Error in optim(init[mask], armafn, method = optim.method, Hessian = TRUE, :
> non-finite finite-difference value [16]
> 
> The last [16] would change anyting from 1 to 16. Using argument
> method="CSS", or "ML", or default did not help. I am using the newest R
> version 3.1.2 for windows 7.
> 
> I have done a lot of research on internet for this Error Message, and tried
> a lot of suggested solutions too. But the results are negative. Then,
> finally, I used following line which solved my problem.
> 
> arima(x, order=c(p,0,q), optim.method="Nelder-Mead")
> 
> Hope this helps others with similar situations.
> 
> Shuxiang Albert Li
> 
> 	[[alternative HTML version deleted]]



More information about the R-help mailing list