R: [R] partial linear model

Jin Shusong jinss at hkusua.hku.hk
Fri Dec 17 03:02:15 CET 2004


From: "Vito Muggeo" <vito.muggeo at giustizia.it>
Subject: R: [R] partial linear model
Date: Thu, 16 Dec 2004 17:25:35 +0100


> Dear Jin,
> if you mean `conditional linearity', (i.e. given the nonlinear parameter,
> the model is linear) you can use nls() with algorithm = "plinear". See ?nls
> Alternatively, if your model has just one nonlinear parameter th, say, I
> think you can write the objective function (for instance the logLik)
> depending on th and use optimize() to search for the optimum; Then fit your
> model assuming th known (and ignoring its (co)variability.. ). Something
> like:
> 
> fn<-function(th,y,X){
> #the deviance function depending on th
> #th: nonlinear parameter to be estimated
> #y: the response
> #X: the design matrix
> o<-glm(y~X+_someKnownFunction(th)_+..)
> o$dev
> }
> 
> #search the optimum
> ob<-optimize(fn,..
> 
> th1<-ob$minimum #(or ob$maximum)
> o<-glm(y~X+_someKnownFunction(th1)_+..) #fit the model assuming th=th1
> *known*
> 
> Hope this helps,
> vito muggeo
> 
> 
> ----- Original Message -----
> From: Jin Shusong <jinss at hkusua.hku.hk>
> To: R Help <r-help at stat.math.ethz.ch>
> Sent: Thursday, December 16, 2004 4:33 PM
> Subject: [R] partial linear model
> 
> 
> > Dear all,
> >
> > Are there any packages can estimate the partial linear
> > model.  Or any one can give me any suggestions.
> >
> > Many thanks in advance.
> >
> >
> >               Jin
> >
> > ______________________________________________
> > R-help at stat.math.ethz.ch mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
Dear Muggeo,

You suggestion is so useful and by following you idea, I
have written my own program.  Thank you very much.


        Jin




More information about the R-help mailing list