Displaying 20 results from an estimated 9000 matches similar to: "how to modify an R built-in function?"
2009 Jan 27
2
optim() and ARIMA
dhabby wrote:
Last week I run in to a lot a problems triyng to fit an ARIMA model to a
time series. The problem is that the internal process of the arima
function
call function "optim" to estimate the model parameters, so far so good...
but my data presents a problem with the default method "BFGS" of the
optim
function, the output error looks like this:
2009 Mar 03
2
modifying a built in function from the stats package (fixing arima)
Dear members of the list,
I'm a beginner in R and I'm having some trouble with: "Error in
optim(init[mask], armafn, method = "BFGS", hessian = TRUE, control =
optim.control, :
non-finite finite-difference value [8]"
when running "arima".
I've seen that some people have come accross the same problem:
2008 Jul 29
1
optim fails when using arima
Hi all,
I?m using the arima() function to study a time series but it gives me
the following error:
Error en optim(init[mask], armafn, method = "BFGS", hessian = TRUE,
control = optim.control, :
non-finite finite-difference value [3]
I know that I can change the method of the arima() to "CSS" instead of
"ML" but I'm specially interested in using
2011 Oct 21
2
Arima Models - Error and jump error
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 )
{
2004 Sep 27
1
optim error in arima
Hello,
I'm fitting a series of ARIMA models to a data set to compare fits. After taking the logs of the data and then differencing them to induce stationarity, I execute
arima( y, order=c( p, 0, q ), seasonal=list( order=c( P, 0, Q ), period=7 ) )
for various values of p, q, P and Q. For one set of these values, I get
Error in optim(init[mask], armafn, method = "BFGS", hessian
2009 Jan 29
1
Arima_Like() and NaN - a (possible) problem, a patch, and RFC
Hi,
recently I have started working with R (v. 2.7.2), and I have been using
R's internal ARIMA_Like() function (from the "stats" package) to
estimate some ARIMA models. In particular, I use ARIMA_Like() in a
function "fn()" that I feed to the optim() method; the main goal is to
find optimal ARIMA prediction models for some time series.
The ARIMA_Like() function returns a
2023 Jan 05
1
R 'arima' discrepancies
Rob J Hyndman gives great explanation here
(https://robjhyndman.com/hyndsight/estimation/) for reasons why results
from R's arima may differ from other softwares.
@iacobus, to cite one, 'Major discrepancies between R and Stata for
ARIMA'
(https://stackoverflow.com/questions/22443395/major-discrepancies-between-r-and-stata-for-arima),
assign the, sometimes, big diferences from R
2015 May 22
1
returnValue()
In R devel rev.66393 (2014-08-15) it was possible to do this:
trace(optim, exit = quote(str(returnValue())))
but returnValue() does not seem to be available any more. The above
was useful to get the output of a function when it was called deep
within another function that I have no control over.
Has this been replaced by some other equivalent function?
P.S. This demonstrates that it no
2009 Mar 04
2
modifying a built in function from the stats package (fixing arima)
Dear Carlos and Kjetil,
Thanks for your answer.
>I do not think that is the way to go. If you believe that your algorithm
>is better than the existing one, talk to the author of the package and
>discuss the improvement. The whole community will benefit.
I should be able to *easily* modify it and test it first!
>Copy the existing function into a new file, edit it and load it via
2009 Jan 26
1
error managment
Hello R experts!
I'm running a FOR loop in which at every step an arima model is generated.
The problem is some series produces numeric problems with optim. My question
is if there is a way of telling to R that at every critical error of optim
jumps to the next series instead of stopping the calculations. Or better
yet, tell it to run another arima fit but with a different optmization
2009 Mar 06
0
modifying a built in function from the stats package (fixing arima) (CONCLUSIONS)
Thanks a lot to everybody that helped me out with this.
Conclusions:
(1)
In order to edit arima in R:
>fix(arima)
or alternatively:
>arima<-edit(arima)
(2)
This is not contained in the "Introduction to R" manual.
(3)
A "productive" fix of arima is attached (arma coefficients printed out and
error catched so that it doesn't halt parent loops to search for
2009 Jan 23
1
forecasting error?
Hello everybody!
I have an ARIMA model for a time series. This model was obtained through an
auto.arima function. The resulting model is a ARIMA(2,1,4)(2,0,1)[12] with
drift (my time series has monthly data). Then I perform a 12-step ahead
forecast to the cited model... so far so good... but when I look the plot of
my forecast I see that the result is really far from the behavior of my time
2009 Mar 03
1
modifying a built in function from the stats package (fixing arima)
Dear members of the list,
I''m a beginner in R and I''m having some trouble with: "Error in
optim(init[mask], armafn, method = "BFGS", hessian = TRUE, control =
optim.control, :
non-finite finite-difference value [8]"
when running "arima".
I''ve seen that some people have come accross the same problem:
2007 Oct 04
1
hessian matrix in arima
Hi,
I am working or arima.
I think arima uses non-linear optimisation for parameter optimisation. The
standard error for parameters are computed from hessian matrix. When I use
arima model, how can I see the finial hessian got from non-linear
optimisation (BFGS for example).
Any help is appreciated.
Many thanks.
Di
[[alternative HTML version deleted]]
2009 Mar 05
2
modifying a built in function from the stats package (fixing arima)
>If you ***look at the code*** for arima you will see that ``%+%'' is
>defined
>in terms of a call to ``.Call()'' which calls ``R_TSconv''. So
>apparently
>R_TSconv is a C or Fortran function or subroutine in a ``shared
>object library''
>or dll upon which arima depends. Hence to do anything with it you'll
>need to get
>that shared
2018 Apr 17
1
Minor glitch in optim()
Having worked with optim() and related programs for years, it surprised me
that I haven't noticed this before, but optim() is inconsistent in how it
deals with bounds constraints specified at infinity. Here's an example:
# optim-glitch-Ex.R
x0<-c(1,2,3,4)
fnt <- function(x, fscale=10){
yy <- length(x):1
val <- sum((yy*x)^2)*fscale
}
grt <- function(x, fscale=10){
nn
2016 Oct 08
4
optim(…, method=‘L-BFGS-B’) stops with an error message while violating the lower bound
Hi, Mark et al.:
Thanks, Mark.
Three comments:
1. Rvmmin was one of the methods I tried after Ravi
directed me to optimx. It returned NAs for essentially everything. See
my email of this subject stamped 4:43 PM Central time = 21:43 UTC.
2. It would be interesting to know if the current
algorithm behind optim and optimx with
2016 Oct 08
4
optim(…, method=‘L-BFGS-B’) stops with an error message while violating the lower bound
Hello:
The development version of Ecdat on R-Forge contains a vignette
in which optim(?, method=?L-BFGS-B?) stops with an error message while
violating the lower bound.
To see all the details, try the following:
install.packages("Ecdat", repos="http://R-Forge.R-project.org")
Then do "help(pac=Ecdat)" -> "User guides, package
2009 Dec 06
5
optim with constraints
Hi, dear R users
I am a newbie in R and I wantto use the method of meximum likelihood
to fit a Weibull distribution to my survival data. I use "optim" as
follows:
optim(c(1, 0.25),weibull.like,mydata=mydata,method="L-BFGS-B",hessian
= TRUE)
My question is: how do I setup the constraints so that the two
parametrs of Weibull to be pisotive? Or should I use other function
2004 Jan 05
3
optim function : "BFGS" vs "L-BFGS-B"
Dear kind R-experts.
Does anybody have an experience to use optim function?
If yes, what is the main difference between two method "BFGS" vs
"L-BFGS-B"?
I used "BFGS" method and got what I wanted. But when I used "L-BFGS-B"
the error message said that "L-BFGS-B needs finite values of fn". So
that means
"BFGS" method can handle even if fn