modification ordre des paramètres covariance.GMM
This commit is contained in:
parent
5f356f6383
commit
0a21668604
3 changed files with 6 additions and 6 deletions
|
@ -6,14 +6,14 @@
|
|||
###############################################################################
|
||||
|
||||
#' Estimated covariance matrix
|
||||
#' @param conditions.vector Vector of moment conditions
|
||||
#' @param param Vector of estimated parameters
|
||||
#' @param conditions.vector Vector of moment conditions
|
||||
#' @param data Individual data sample
|
||||
#' @param ... Functions of the vector of moment conditions
|
||||
#' @return A square covariance matrix
|
||||
#' @export covariance.GMM
|
||||
#' @author François Pelletier
|
||||
covariance.GMM <- function(conditions.vector,param,data,...)
|
||||
covariance.GMM <- function(param,conditions.vector,data,...)
|
||||
{
|
||||
t(conditions.vector(param,data,...)) %*% conditions.vector(param,data,...) / length(data)
|
||||
}
|
|
@ -24,7 +24,7 @@ iterative.GMM <- function(start.value,conditions.vector,data,W,...,max.iter=50,e
|
|||
repeat
|
||||
{
|
||||
theta2 <- optim.GMM(theta1,conditions.vector,data,W,...)$par
|
||||
S <- covariance.GMM(conditions.vector,theta2,data,...)
|
||||
S <- covariance.GMM(theta2,conditions.vector,data,...)
|
||||
if(sqrt(sum((theta1-theta2)^2))<epsilon)
|
||||
return(list(par=theta2,cov=S))
|
||||
else if (i>max.iter)
|
||||
|
|
|
@ -2,13 +2,13 @@
|
|||
\alias{covariance.GMM}
|
||||
\title{Estimated covariance matrix}
|
||||
\usage{
|
||||
covariance.GMM(conditions.vector, param, data, ...)
|
||||
covariance.GMM(param, conditions.vector, data, ...)
|
||||
}
|
||||
\arguments{
|
||||
\item{conditions.vector}{Vector of moment conditions}
|
||||
|
||||
\item{param}{Vector of estimated parameters}
|
||||
|
||||
\item{conditions.vector}{Vector of moment conditions}
|
||||
|
||||
\item{data}{Individual data sample}
|
||||
|
||||
\item{...}{Functions of the vector of moment conditions}
|
||||
|
|
Loading…
Reference in a new issue