update-methods | R Documentation |
update
in Package stats ~~The method is used to refit a model with either a different
method or with modifications to the momentModel
.
## S4 method for signature 'gmmfit'
update(object, ..., evaluate=TRUE)
## S4 method for signature 'momentModel'
update(object, ...)
## S4 method for signature 'gelfit'
update(object, newModel=NULL, ...,
evaluate=TRUE)
## S4 method for signature 'list'
update(object, ...)
object |
An object produced by |
... |
Arguments to modify the model or the GMM method |
newModel |
When provided, the new model is estimated using the same specification. For example, it is particularly useful to estimate the restricted model using the same optim specification as the unrestricted model. |
evaluate |
The modified |
signature(object = "ANY")
That just calls "update"
from the "stats"
package.
signature(object = "gmmfit")
signature(object = "momentModel")
signature(object = "list")
x <- rchisq(200,5)
z1 <- rnorm(200)
z2 <- .2*x+rnorm(200)
y <- x+rnorm(200)
dat <- data.frame(y=y,z1=z1,x=x,z2=z2)
theta <- c(beta0=1,beta1=2)
model1 <- momentModel(y~x, ~z1+z2, data=dat)
(res <- gmmFit(model1))
## lets change to iterative
update(res, type="iter")
## Let change the HAC specification in the model1 object
## to MDS
update(res, vcov="MDS")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.