[R] multiplicative contraint in LS
stephenb
Stephen.Bond at cibc.com
Thu Mar 11 16:59:18 CET 2010
I have a model that can be estimated in nls
mod.base <-
deriv(~(Jan+a1*Feb+a2*Mar+a3*Apr+a4*May+a5*Jun+a6*Jul+a7*Aug+a8*Sep+a9*Oct+a10*Nov+a11*Dec)*(b2*relAge+b3*relAge^2),
c("a1","a2","a3","a4","a5","a6","a7","a8","a9","a10","a11","b2","b3"),
function(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,b2,b3,relAge,Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec){})
nls1 <-
nls(y~mod.base(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,b2,b3,relAge,Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec),data=fix1,
start=list(a1=.99,a2=1.01,a3=1.02,a4=1.04,a5=1,a6=1.05,a7=1.06,a8=1.07,a9=1.08,a10=1.09,a11=1.1,b2=.02,b3=-.02))
I would like to estimate with lm/gls to use the greater
decoration/diagnostics available in lm/gls
calling
lm(y~poly(relAge,2,raw=T)*sn-sn-poly(relAge,2,raw=T)-1,data=fix1)
gives me parameters that are not constrained across season eg when I divide
poly(relAge, 2, raw = T)1:snFeb / poly(relAge, 2, raw = T)1:snJan
I get a number which is not identical to
poly(relAge, 2, raw = T)2:snFeb / poly(relAge, 2, raw = T)2:snJan
which is to be expecetd as I do not constrain. Please, help with
constraining.
The obvious reparametrization leads me to the nls, which does not have
correlation and variance funcs as gls.
Thank you
--
View this message in context: http://n4.nabble.com/multiplicative-contraint-in-LS-tp1589181p1589181.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list