[R] modifying a built in function from the stats package (fixing arima)

Marc Anonym manonym at acompany.com
Wed Mar 4 10:06:20 CET 2009


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
>source.

>3)  after downloading the source package (stats) containung arima,
>     rename it (my.arima) and then do the changes.

I obviously saved it with a different name and I was expecting it to work
out of the box but I get an error that I don't know how to solve:
Error in Delta %+% c(1, rep(0, seasonal$period - 1), -1) :
  object "R_TSconv" not found

Other people have previously discussed this in this list with no success...
http://www.nabble.com/Foreign-function-call-td21836156.html

Any other hints or maybe help with the error that I'm getting?

-----Mensaje original-----
De: Carlos J. Gil Bellosta [mailto:cgb at datanalytics.com]
Enviado el: 03 March 2009 21:30
Para: Marc Anonym
CC: r-help at r-project.org
Asunto: Re: [R] modifying a built in function from the stats package
(fixing arima)


Hello,

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.

If you want to tune the existing function and tailor it to your needs,
you have several ways to go, among them:

1) Copy the existing function into a new file, edit it and load it via
source.

2) Download the source package and modify it for your own purposes.

Best regards,

Carlos J. Gil Bellosta
http://www.datanalytics.com


On Tue, 2009-03-03 at 18:20 +0100, Marc Anonym wrote:
> 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:
> https://stat.ethz.ch/pipermail/r-help/2008-August/169660.html
>
> So I'd like to modify the code of arima to change the optimization
function
> with another one that handles these problems automatically , however I
don't
> find the way to do it and
> http://tolstoy.newcastle.edu.au/R/e6/help/09/01/2476.html points out a way
> that doesn't work for me:
>
> * If I type edit(arima) and I modify it, changes are not saved,
> * If I copy the code and I save it like a different function, I get the
hard
> error: "Error in Delta %+% c(1, -1) : object "R_TSconv" not found"
>
> Anybody can give me a hint? I miss matlab's easy way of doing this ("edit
> function.m").
>
> Thanks in advance
>
> MarC (Acompany)
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at 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.




More information about the R-help mailing list