Skip to content

Help on constrained regression

3 messages · R_help Help, Spencer Graves

#
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.
      Spencer Graves
R_help Help wrote:
#
I did. The problem was the underlying process that's negative AR(1).
So I just have to find other way to model it. Thank you.
On Thu, Jul 2, 2009 at 7:31 PM, spencerg<spencer.graves at prodsyse.com> wrote:
#
1.  Have you made normal probability plots of the data 
(function "qqnorm")?  This could reveal outliers or a need for a 
transformation. 


           2.  Have you considered using "lme" with "corAR1", allowing 
"a" to be negative?  The examples in the help file for "corAR1" show how 
to estimate this model with a different "b" for each series but with one 
"a" shared between all series.  Then an analysis of residuals should 
help you identify which series seem least consistent with the model. 


           3.  Have you considered dropping one observation in each 
series and using "lme" to estimate a distinct "a" and "b" for each 
series, allowing  "a" to be negative?  If the grand mean of the 
estimates for "a" are positive, this will reduce the number of negative 
"a" values by shrinking them all towards the grand mean.  Then you can 
look more carefully at the series that still have negative "a" values.  
They will either contain outliers, or you will likely identify some 
other series to include in the model so it becomes something more like 
the following: 


           y[t] = a*y[t-1] + b + c*x[t] + e


      As your comment indicated, the seriously negative estimates for 
"a" suggest some substantive violations of the assumptions you used to 
conclude that "a" should be positive. 


      Hope this helps. 
      Spencer
R_help Help wrote: