Hi, I need help regarding estimating a linear model where restrictions are imposed on the coefficients. An example is as follows: Y_{t+2}=a1Y_{t+1} + a2 Y_t + b x_t + e_t restriction a1+ a2 =1 Is there a function or a package that can estimate the coefficient of a model like this? I want to estimate the coefficients rather than test them. Thank you for your help Ahmad Abu Hammour -------------- next part -------------- An HTML attachment was scrubbed... URL: https://stat.ethz.ch/pipermail/r-help/attachments/20020408/691e8359/attachment.html
> Hi,> I need help regarding estimating a linear model where restrictions areimposed on the coefficients. An example is as follows:> Y_{t+2}=a1Y_{t+1} + a2 Y_t + b x_t + e_t> restriction > a1+ a2 =1> Is there a function or a package that can estimate the coefficient of amodel like this? I want to estimate the coefficients rather than test them.> Thank you for your help> Ahmad Abu HammourYou don't need something special. Just consider that a2 = 1 - a1 and replace it in your equation, which gives: Y_{t+2}=a1Y_{t+1} + (1 - a1) Y_t + b x_t + e_t Best, Philippe Grosjean ...........]<(({?<...............<?}))><............................... ) ) ) ) ) __ __ ( ( ( ( ( |__) | _ ) ) ) ) ) | hilippe |__)rosjean ( ( ( ( ( Marine Biol. Lab., ULB, Belgium ) ) ) ) ) __ ( ( ( ( ( |\ /| |__) ) ) ) ) ) | \/ |ariculture & |__)iostatistics ( ( ( ( ( ) ) ) ) ) e-mail: phgrosje at ulb.ac.be or phgrosjean at sciviews.org ( ( ( ( ( SciViews project coordinator (http://www.sciviews.org) ) ) ) ) ) tel: 00-32-2-650.29.70 (lab), 00-32-2-673.31.33 (home) ( ( ( ( ( ) ) ) ) ) "I'm 100% confident that p is between 0 and 1" ( ( ( ( ( L. Gonick & W. Smith (1993) ) ) ) ) ) ....................................................................... -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
> I need help regarding estimating a linear model where restrictions are imposed on the coefficients. An example is as follows: > Y_{t+2}=a1Y_{t+1} + a2 Y_t + b x_t + e_t > restriction > a1+ a2 =1 > Is there a function or a package that can estimate the coefficient of a model like this? I want to estimate the coefficients rather than test them.- pcls() in package mgcv will do this (although you'll need to re-parameterize so that the restriction is a1+a2=0). Alternatively the following fits: y = b0 + b1 x + e subject to b0 + b1 = 1 having reparameterized as y = b0 + (b1+1) x + e subject to b0 + b1 = 0 x<-runif(100) y<-x+rnorm(100)*0.1 # simulate some data cm<-matrix(c(1,1),1,2) # make constraint matrix C so Cb=0 cqr<-qr(t(cm)) # QR decomp of C' # if m constraints then last m cols of Q give null space Z of constraints: Z<-qr.Q(cqr,complete=TRUE)[,2] X<-model.matrix(y~x) # model matrix XZ<-X%*%Z # model matrix in constraint null space p<-lm(y~XZ-1+offset(x))$coeff # estimate model in null space p<-Z%*%as.matrix(p) # estimates in original space p[2]<-p[2]+1 # undo reparameterization p plot(x,y);abline(p) ... this can be easily generalized to do what you want. Simon ______________________________________________________________________> Simon Wood snw at st-and.ac.uk http://www.ruwpa.st-and.ac.uk/simon.html > The Mathematical Institute, North Haugh, St. Andrews, Fife KY16 9SS UK > Direct telephone: (0)1334 463799 Indirect fax: (0)1334 463748-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._