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
|
2014-03-08 05:57:43 +00:00
|
|
|
#' @param data Individual data sample
|
2014-03-03 01:20:34 +00:00
|
|
|
#' @param ... Functions of the vector of moment conditions
|
2014-02-27 03:45:46 +00:00
|
|
|
#' @return A square covariance matrix
|
2014-03-06 02:48:37 +00:00
|
|
|
#' @export covariance.GMM
|
2014-02-27 03:45:46 +00:00
|
|
|
#' @author François Pelletier
|
2014-03-08 05:57:43 +00:00
|
|
|
covariance.GMM <- function(conditions.vector,param,data,...)
|
2014-02-27 03:45:46 +00:00
|
|
|
{
|
2014-03-08 05:57:43 +00:00
|
|
|
t(conditions.vector(param,data,...)) %*% conditions.vector(param,data,...) / length(data)
|
2014-02-27 03:45:46 +00:00
|
|
|
}
|