2014-02-27 03:45:46 +00:00
|
|
|
# Objective function for the GMM method
|
|
|
|
#
|
|
|
|
# Author: Francois Pelletier
|
|
|
|
#
|
|
|
|
# LGPL-3.0
|
|
|
|
###############################################################################
|
|
|
|
|
|
|
|
#' Objective function for the GMM method
|
2014-03-08 05:37:30 +00:00
|
|
|
#' @param param Vector of parameters
|
2014-02-27 03:45:46 +00:00
|
|
|
#' @param conditions.vector Vector of moment conditions
|
2014-03-08 05:37:30 +00:00
|
|
|
#' @param data Individual data sample
|
2014-02-27 03:45:46 +00:00
|
|
|
#' @param W Weighting matrix
|
2014-03-08 05:41:05 +00:00
|
|
|
#' @param ... Functions of the vector of moment conditions
|
2014-02-27 03:45:46 +00:00
|
|
|
#' @return A scalar value
|
2014-03-06 02:48:37 +00:00
|
|
|
#' @export objective.GMM
|
2014-02-27 03:45:46 +00:00
|
|
|
#' @author François Pelletier
|
2014-03-08 05:37:30 +00:00
|
|
|
objective.GMM <- function(param,conditions.vector,data,W,...)
|
2014-02-27 03:45:46 +00:00
|
|
|
{
|
2014-03-08 05:37:30 +00:00
|
|
|
as.vector(colMeans(conditions.vector(param,data,...)) %*% ginv(W) %*% colMeans(conditions.vector(param,data,...)))
|
2014-02-27 03:45:46 +00:00
|
|
|
}
|