From 861e3b6339b61a826f0809afe00c404328cd6092 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Pelletier?= Date: Wed, 5 Mar 2014 19:25:03 -0500 Subject: [PATCH] Correction fonction startparamGAL --- R/mean.variance.GMM.gradient.R | 2 ++ R/startparamGAL.R | 6 +++--- man/mean.variance.GMM.gradient.Rd | 5 +++++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/R/mean.variance.GMM.gradient.R b/R/mean.variance.GMM.gradient.R index 5d83fef..09f7ac5 100644 --- a/R/mean.variance.GMM.gradient.R +++ b/R/mean.variance.GMM.gradient.R @@ -10,6 +10,8 @@ #' #' Derivative of the moment conditions according to the vector of parameters #' @param param GAL parameters +#' @param Data Data sample +#' @param type Choose between "mu" or "kappa" parametrization #' @return gradient matrix #' #' @author François Pelletier diff --git a/R/startparamGAL.R b/R/startparamGAL.R index 6768ca6..a0c9551 100644 --- a/R/startparamGAL.R +++ b/R/startparamGAL.R @@ -26,12 +26,12 @@ startparamGAL <- function(data,type="mu",log=FALSE) mu <- mom[3]*sigma*sqrt(2/(3*(mom[4]))) theta <- mom[1]-tau*mu if(log==FALSE) - c(theta,sigma,mu,tau) + return(c(theta,sigma,mu,tau)) else - log(c(theta,sigma,mu,tau)) + return(log(c(theta,sigma,mu,tau))) } if(type=="kappa") { - changetypeGAL(startparamGAL(data,type="mu",log),type="kappa",target="mu",log) + return(changetypeGAL(startparamGAL(data,type="mu",log),type="kappa",target="mu",log)) } } diff --git a/man/mean.variance.GMM.gradient.Rd b/man/mean.variance.GMM.gradient.Rd index 84ba393..4321694 100644 --- a/man/mean.variance.GMM.gradient.Rd +++ b/man/mean.variance.GMM.gradient.Rd @@ -6,6 +6,11 @@ } \arguments{ \item{param}{GAL parameters} + + \item{Data}{Data sample} + + \item{type}{Choose between "mu" or "kappa" + parametrization} } \value{ gradient matrix