Description Usage Arguments Details Value References See Also Examples
Fitting a model by GMM
1 2 3 4 5 6  GmmEst(func, theta0, data,
est_type=c("2step","1step","iter"), initial_W=NULL,
optim_method=c("BFGS","NelderMead", "CG", "LBFGSB", "SANN"),
control = GmmEst_control(...), ...)
GmmEst_control(maxit = 5000, tol_gmm_iter=1e12, maxit_gmm_iter=100, ...)

func 
a user supplied 
theta0 
a vector of initial values of the parameters. 
data 
a dataframe or matrix containing the necessary data to compute the moments. 
est_type 
Optional: One of 2step, 1step or iter. Default value is 2step. 
initial_W 
Optional: An initial weighting matrix of class matrix that can be supplied by the user. If not supplied, the identity matrix is used. 
optim_method 
Optional: The possible implemented methods in 
control, maxit, tol_gmm_iter, maxit_gmm_iter 
Optional: a list of control parameters passed to 
... 
Further arguments that can be passed to 
Will be available soon
An object of class "GmmEst"
.
Will be available soon
Will be available soon
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26  # Description (better example will be implemented soon)
# A minimal example of a regression estimated by twostep GMM based on the mtcars dataset
## Data
data(mtcars)
## User specified function
func = function(params, data){
b0 = params[1]
b1 = params[2]
y = data$mpg
x = data$hp
yfit = b0 + b1*x
eps = y  yfit
gt1 = eps
gt2 = eps*x
gt = cbind(gt1, gt2)
return(gt)
}
# Estimation
mod = GmmEst(func, c(mean(mtcars$mpg),0), mtcars)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.