The error is what it says: Your program has asked for an approximation to a 
derivative
(you, or whoever wrote the package you are using,  didn't provide an analytic 
gradient, so
it's using an approximation), and the result was returned Inf.

This is VERY common -- the BFGS option of optim() is a variant of Roger 
Fletcher's 1970
variable metric code that I worked out with him in Jan 1976. It's a bit long in 
the tooth,
and does not include parameter bounds -- we only had about 8K maximum for 
program and data
at the time. That's K, not M or G.

Some options:
- if you can change to L-BFGS-B variant of optim() you can use box constraints, 
still with
numerical gradients. nlminb() also has them, as do several routines in optimx. 
Note that a
bound of 0 may still get you into trouble with numerical gradient 
approximations -- the
step can go over the "cliff" because the bounds constraints don't always get 
checked for
the numerical  (f(x+delta) - f(x)) / delta. In fact, there is a lot of work 
still to be
done to make sure all the holes are plugged. I'm working on putting many such 
checks in
optimx, but it will be a few weeks yet before they are even on the R-forge 
version.

- you may be able to change your objective function with penalty or barrier 
functions, or
using log(parameter) to avoid zero divides etc.

Unfortunately, providing "automatic" minimization tools often means and 
automatic
generation of lots of error messages as these tools follow downhill directions 
until they
are in very weird parts of parameter spaces.

JN


On 10/22/2011 06:00 AM, r-help-requ...@r-project.org wrote:
> Message: 54
> Date: Fri, 21 Oct 2011 15:59:12 -0200
> From: Fl?vio Fagundes <flavi...@gmail.com>
> To: r-help <r-help@r-project.org>
> Subject: [R] Arima Models - Error and jump error
> Message-ID:
>       <canr1bppb3e4egs9c82wv6je5ew8f4p3fheutt+9btmggfvu...@mail.gmail.com>
> Content-Type: text/plain
> 
> Hi people,
> 
> I´m trying to development a simple routine to run many Arima models result
> from some parâmeters combination.
> My data test have one year and daily level.
> A part of routine is:
> 
> for ( d in 0:1 )
>   { for ( p in 0:3 )
>        { for ( q in 0:3 )
>            { for ( sd in 0:1 )
>               { for ( sp in 0:3 )
>                  { for ( sq in 0:3 )
>                      {
> Yfit=arima(Yst[,2],order=c(p,d,q),seasonal=list(order=c(sp,sd,sq),period=7),include.mean=TRUE,xreg=DU0)
>                      }}}}}}
> 
> Until the step 187 it´s run normally, but in the step 187 return a error and
> stop the program.
> 
>> >
> Yfit=arima(Yst[,2],order=c(1,0,1),seasonal=list(order=c(2,1,2),period=7),include.mean=TRUE,xreg=DU0)
> 
> Error in optim(init[mask], armafn, method = "BFGS", hessian = TRUE, control
> = optim.control,  :
>   non-finite finite-difference value [1]
> 
> My questions is:
> 
> 1. What this error mean and why it occured?
> 2. How can I do to this program disregard any error and to continue to run
> until the end of looping?
> 3. Someone know if already have any routine that do this?
> 
> Thanks
> Flávio

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to