2014-01-04 22:32:36 +00:00
|
|
|
# Risk neutral conversion of parameters of GAL distirbution
|
|
|
|
#
|
|
|
|
# Author: Francois Pelletier
|
|
|
|
#
|
|
|
|
# LGPL 3.0
|
|
|
|
###############################################################################
|
|
|
|
|
|
|
|
#' Risk neutral conversion of parameters of GAL distirbution
|
|
|
|
#' @param param Parameter vector
|
|
|
|
#' @param riskfree Risk-free rate
|
|
|
|
#' @param type Choose between "mu" or "kappa" parametrization
|
|
|
|
#' @param log Logical for log-parameters
|
|
|
|
#' @return Risk neutral parameter vector
|
2014-03-06 02:44:52 +00:00
|
|
|
#' @export riskneutralparGAL
|
2014-01-04 22:32:36 +00:00
|
|
|
#' @author Francois Pelletier
|
|
|
|
riskneutralparGAL <- function(param,riskfree,type="mu",log=FALSE)
|
|
|
|
{
|
|
|
|
testparGAL(param,type,log)
|
|
|
|
if(type=="kappa")
|
|
|
|
{
|
2014-03-06 02:44:52 +00:00
|
|
|
return(riskneutralparGAL(changetypeGAL(param,type="kappa",target="mu"),riskfree,type="mu",log))
|
2014-01-04 22:32:36 +00:00
|
|
|
}
|
|
|
|
if(type=="mu")
|
|
|
|
{
|
|
|
|
if(log)
|
|
|
|
{
|
2014-03-06 02:44:52 +00:00
|
|
|
return(c(log(riskfree+log(1-exp(param[3])-exp(param[2])^2/2)*param[4]),param[2],param[3],param[4]))
|
2014-01-04 22:32:36 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-03-06 02:44:52 +00:00
|
|
|
return(c(riskfree+log(1-param[3]-param[2]^2/2)*param[4],param[2],param[3],param[4]))
|
2014-01-04 22:32:36 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|