2014-02-14 04:46:32 +00:00
|
|
|
# Characteristic function of Laplace motion
|
|
|
|
#
|
|
|
|
# Author: Francois Pelletier
|
|
|
|
#
|
|
|
|
# LGPL 3.0
|
|
|
|
###############################################################################
|
|
|
|
|
|
|
|
#' Characteristic function of Laplace motion
|
|
|
|
#' @param u Transform variate
|
2014-02-22 18:28:27 +00:00
|
|
|
#' @param param Parameter vector
|
2014-03-29 15:40:33 +00:00
|
|
|
#' @param time1 Start time of the process
|
|
|
|
#' @param time2 End time of the process
|
2014-02-14 04:46:32 +00:00
|
|
|
#' @param type Choose between "mu" or "kappa" parametrization
|
|
|
|
#' @param log Logical for log-parameters
|
|
|
|
#' @param start Starting value of the process
|
|
|
|
#' @return Characteristic function value at point u for given parameter vector
|
2014-03-06 02:44:52 +00:00
|
|
|
#' @export cfLM
|
2014-02-14 04:46:32 +00:00
|
|
|
#' @author Francois Pelletier
|
2014-03-29 15:40:33 +00:00
|
|
|
cfLM <- function(u,param,time1,time2,type="mu",log=FALSE,start=0)
|
2014-02-14 04:46:32 +00:00
|
|
|
{
|
2014-03-29 15:40:33 +00:00
|
|
|
time <- time2-time1
|
2014-02-14 04:46:32 +00:00
|
|
|
testparGAL(param,type,log)
|
|
|
|
if(log)
|
|
|
|
{
|
|
|
|
if(type=="mu")
|
|
|
|
{
|
2014-03-06 02:44:52 +00:00
|
|
|
return(exp(1i*(start+exp(param[1])*time)*u)*(1+(exp(param[2])^2*u^2)/2-1i*exp(param[3])*u)^(-exp(param[4])*time))
|
2014-02-14 04:46:32 +00:00
|
|
|
}
|
|
|
|
if(type=="kappa")
|
|
|
|
{
|
2014-03-06 02:44:52 +00:00
|
|
|
return(exp(1i*(start+exp(param[1])*time)*u)*(1+(exp(param[2])^2*u^2)/2-(1/2*1i)*
|
|
|
|
exp(param[2])*sqrt(2)*(1/exp(param[3])-exp(param[3]))*u)^(-exp(param[4])*time))
|
2014-02-14 04:46:32 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if(type=="mu")
|
|
|
|
{
|
2014-03-06 02:44:52 +00:00
|
|
|
return(exp(1i*(start+param[1]*time)*u)*(1+(param[2]^2*u^2)/2-1i*param[3]*u)^(-param[4]*time))
|
2014-02-14 04:46:32 +00:00
|
|
|
}
|
|
|
|
if(type=="kappa")
|
|
|
|
{
|
2014-03-06 02:44:52 +00:00
|
|
|
return(exp(1i*(start+param[1]*time)*u)*(1+(param[2]^2*u^2)/2-(1/2*1i)*
|
|
|
|
param[2]*sqrt(2)*(1/param[3]-param[3])*u)^(-param[4]*time))
|
2014-02-14 04:46:32 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|