[R-SIG-Finance] Help on constrained regression
spencer.graves at prodsyse.com
Fri Jul 3 01:31:25 CEST 2009
Have you considered writing the model in terms of log(a) = g, say:
y[t] = exp(g)*y[t-1]+b+epsilon?
With this, you could estimate "g" and "b" using "nls". With
multiple series, you could use the "nlme" function in the "nmle"
package. For the "nlme" package, an excellent reference in Pinheiro and
Bates (2000) Mixed-Effects Models in S and S-PLUS (Springer).
Hope this helps.
R_help Help wrote:
> I have an AR(1) model
> y[t] = ay[t-1]+b+epsilon
> I'm trying to force a to be positive. So I did the constrained
> regression with constraints 0 < a < 1. I used pcls in package mgcv.
> However, I found that the solution is not so stable. Most of my lag 1
> autocorrelation is negative. Forcing a to positive value makes the
> optimizer to stick a to the boundary value. All it does is varying b.
> I there anyway to solve this problem? I think the problem might be due
> to my initial value is not a smart choice.
> Thank you.
> R-SIG-Finance at stat.math.ethz.ch mailing list
> -- Subscriber-posting only.
> -- If you want to post, subscribe first.
More information about the R-SIG-Finance