2014-02-27 03:45:46 +00:00
|
|
|
# Estimated covariance matrix
|
|
|
|
#
|
|
|
|
# Author: Francois Pelletier
|
|
|
|
#
|
|
|
|
# LGPL-3.0
|
|
|
|
###############################################################################
|
|
|
|
|
|
|
|
#' Estimated covariance matrix
|
|
|
|
#' @param conditions.vector Vector of moment conditions
|
2014-03-03 01:20:34 +00:00
|
|
|
#' @param param Vector of estimated parameters
|
|
|
|
#' @param sample Individual data sample
|
|
|
|
#' @param ... Functions of the vector of moment conditions
|
2014-02-27 03:45:46 +00:00
|
|
|
#' @return A square covariance matrix
|
|
|
|
#'
|
|
|
|
#' @author François Pelletier
|
2014-03-03 01:20:34 +00:00
|
|
|
covariance.GMM <- function(conditions.vector,param,sample...)
|
2014-02-27 03:45:46 +00:00
|
|
|
{
|
2014-03-03 01:20:34 +00:00
|
|
|
t(conditions.vector(param,sample,...)) %*% conditions.vector(param,sample,...) / length(sample)
|
2014-02-27 03:45:46 +00:00
|
|
|
}
|