evalWeights-methods {momentfit} | R Documentation |
Methods for Function evalWeights
in Package Gmm
Description
This is a constructor for objects of class momentWeights
Usage
## S4 method for signature 'momentModel'
evalWeights(object, theta=NULL, w="optimal",
...)
## S4 method for signature 'sysModel'
evalWeights(object, theta = NULL, w="optimal",
wObj=NULL)
## S4 method for signature 'rslinearModel'
evalWeights(object, theta = NULL, w="optimal",
wObj=NULL)
Arguments
object |
Object of class |
theta |
The vector of coefficients to compute the optimal
weights. If |
w |
A matrix for fixed weights, one of |
wObj |
An object of class |
... |
Arguments to pass to other methods |
Methods
signature(object = "momentModel")
signature(object = "sysModel")
signature(object = "rslinearModel")
-
System of equations with restrictions on the coefficients. It only affects the computation of the weights when there are cross-equation restrictions.
Examples
data(simData)
theta <- c(beta0=1,beta1=2)
model1 <- momentModel(y~x1, ~z1+z2, data=simData)
## Identity weights object
wObj1 <- evalWeights(model1, w="ident")
## Identity weights object (an alternative way less efficient)
wObj1 <- evalWeights(model1, w=diag(3))
## Optimal weights
wObj1 <- evalWeights(model1, theta, w="optimal")
[Package momentfit version 0.5 Index]