update-methods: ~~ Methods for Function 'update' in Package 'stats' ~~

update-methodsR Documentation

~~ Methods for Function update in Package stats ~~

Description

The method is used to refit a model with either a different method or with modifications to the momentModel.

Usage

## 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, ...)

Arguments

object

An object produced by "gelFit", "gmmFit" or a model. It can also be a list, in which case, it is used to change elements of a list.

...

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 call argument is only evaluated when evaluate is TRUE

Methods

signature(object = "ANY")

That just calls "update" from the "stats" package.

signature(object = "gmmfit")
signature(object = "momentModel")
signature(object = "list")

Examples

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")



momentfit documentation built on Sept. 20, 2023, 3:01 a.m.