The optimal model is fit in a case where aside from some parameters, the model is linear.
Numerical optimization is used over these parameters with stats::lm()()
fitting the rest.
plm(formula, data = parent.frame(), params = c(), optimize = TRUE, .ocall = NULL, method = "nlm", ..., debug = FALSE)
formula | a formula describing the model |
---|---|
data | a data frame |
params | a named vector of the parameters to be fit by numerical optimation outside of |
optimize | a logical indicating whether |
.ocall | used for recursive calling |
... | additional arguments, currently ignored. |
On object of class c("plm", "lm")
which is an enhanced "lm"
object.
if( require(EconData) & require(dplyr) ) { plm( log(iGDP) - log(iK) ~ iYear, data=Calvin %>% filter(Country=="US")) plm( log(iGDP) - delta * iK - (1-delta) * iL ~ iYear, data=Calvin %>% filter(Country=="US"), params=c(delta=0.4), optimize=FALSE ) plm( log(iGDP) - delta * iK - (1-delta) * iL ~ iYear, data=Calvin %>% filter(Country=="US"), params=c(delta=0.4), optimize=TRUE ) plm( log(iGDP) - delta * iK - (1-delta) * iL ~ iYear, data=Calvin %>% filter(Country=="US"), params=c(delta=0.4), method=c("nlm", "spg"), optimize=TRUE ) foo <- plm( log(iGDP / delta*(delta_1*iK + (1-delta_1)*iL) + (1-delta)*iQp) ~ iYear, data=Calvin %>% filter(Country=="US"), params=c(delta=0.5, delta_1=0.5)) foo class(foo) }#>#> Warning: there is no package called ‘EconData’