2014-02-27 03:45:46 +00:00
|
|
|
# GMM vector for 4 first central moments conditions
|
|
|
|
#
|
|
|
|
# Author: Francois Pelletier
|
|
|
|
#
|
|
|
|
# LGPL-3.0
|
|
|
|
###############################################################################
|
|
|
|
|
|
|
|
#' GMM vector for 4 first central moments conditions
|
|
|
|
#' @param param Estimated parameters
|
|
|
|
#' @param sample Data Sample
|
|
|
|
#' @param meanf Mean function
|
|
|
|
#' @param variancef Variance function
|
|
|
|
#' @param skewnessf Skewness function
|
|
|
|
#' @param kurtosisf Kurtosis function
|
|
|
|
#' @return A four column matrix of differences
|
2014-03-06 02:48:37 +00:00
|
|
|
#' @export fourmoments.gmm.vector
|
2014-02-27 03:45:46 +00:00
|
|
|
#' @author François Pelletier
|
|
|
|
fourmoments.gmm.vector <- function(param,sample,meanf,variancef,skewnessf,kurtosisf)
|
|
|
|
{
|
|
|
|
cbind(X-meanf(param),
|
|
|
|
(X-meanf(param))^2 - variancef(param),
|
|
|
|
(X-meanf(param))^3/variancef(param)^(3/2) - skewnessf(param),
|
|
|
|
(X-meanf(param))^4/variancef(param)^(2) - kurtosisf(param))
|
|
|
|
}
|