GMMStuff/R/covariance.GMM.R

19 lines
637 B
R
Raw Normal View History

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