R: [R] partial linear model
Vito Muggeo
vito.muggeo at giustizia.it
Thu Dec 16 17:25:35 CET 2004
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
More information about the R-help
mailing list