# R/ModelB3.R In mfrdixon/MLEMVD: Maximum Likelihood Estimation for Diffusion Equations

#### Documented in ModelB3

```#' Compute the maximum likelihood estimate of Model B3
#'
#'
#' @param x Observation of the state variable at time t
#' @param x0 Observation of the state variable at time t-1
#' @param del The time step between the current and previous observation
#' @param param The parameter 6-vector (mu,alpha,beta,sigma,rho,gamma)
#' @export output a list with a llk variable storing the result of the log likelihood calculation
#' @examples
#' ModelB3(0.4,0.3,0.1,c(0.1,0.2,0.3,0.4,0.5,0.6))
#'
ModelB3 <- function(x,x0,del,param)
{
x1 <- x[1]
x2 <- x[2]
x10 <- x0[1]
x20 <- x0[2]

mu <- param[1]
alpha <- param[2]
beta <- param[3]
sigma <- param[4]
rho <- param[5]
gamma <- param[6]

m <- 2

Dv <- (1/2)*log(1 - rho^2) + log(sigma) + ((1 + 2*gamma)/2)*log(x2)
cm1 <- ((-8*gamma^3*(-1 + rho^2)^2 + 4*gamma^2* (14 - 19*rho^2 + 5*rho^4) + 15*(24 - 119*rho^2 + 105*rho^4) + 6*gamma*(124 - 282*rho^2 + 143*rho^4))* (x1 - x10)^2*(x2 - x20)^4)/(11520*(-1 + rho^2)^3* x20^5) + ((2 - 5*rho^2 - 2*gamma*(-1 + rho^2))* (x1 - x10)^2*(x2 - x20)^3)/(32*(-1 + rho^2)^2* x20^4) + ((-6 + 9*rho^2 + 2*gamma*(-1 + rho^2))* (x1 - x10)^2*(x2 - x20)^2)/(48*(-1 + rho^2)^2* x20^3) - ((x1 - x10)^2*(x2 - x20))/ (4*(-1 + rho^2)*x20^2) - ((1 + gamma)*(rho^2 + 8*gamma*(-1 + rho^2) + 12*gamma^2*(-1 + rho^2))*(x2 - x20)^5* x20^(-3 - 2*gamma))/(96*(-1 + rho^2)^2*sigma^2) - (gamma*(x2 - x20)^3*x20^(-1 - 2*gamma))/ (2*(-1 + rho^2)*sigma^2) - (rho*(384*gamma^3*(-1 + rho^2)^2 + 48*gamma^4*(-1 + rho^2)^2 + 15*(2 - 21*rho^2 + 21*rho^4) + 4*gamma^2*(251 - 509*rho^2 + 258*rho^4) + 2*gamma*(413 - 950*rho^2 + 528*rho^4))*(x1 - x10)* (x2 - x20)^5*x20^(-(9/2) - gamma))/ (5760*(-1 + rho^2)^3*sigma) + ((5 + 2*gamma)*rho*(-1 + 3*rho^2 + 8*gamma*(-1 + rho^2) + 4*gamma^2*(-1 + rho^2))* (x1 - x10)*(x2 - x20)^4*x20^(-(7/2) - gamma))/ (192*(-1 + rho^2)^2*sigma) - (rho*(-2 + 3*rho^2 + 8*gamma*(-1 + rho^2) + 4*gamma^2*(-1 + rho^2))*(x1 - x10)*(x2 - x20)^3* x20^(-(5/2) - gamma))/(24*(-1 + rho^2)^2*sigma) + ((1 + 2*gamma)*rho*(x1 - x10)*(x2 - x20)^2* x20^(-(3/2) - gamma))/(4*(-1 + rho^2)*sigma) - (rho*(gamma*(86 - 116*rho^2) + 4*gamma^2* (-1 + rho^2) + 5*(-47 + 57*rho^2))*sigma* (x1 - x10)^3*(x2 - x20)^3*x20^(-(11/2) + gamma))/ (2880*(-1 + rho^2)^3) - ((-7 + 2*gamma)*rho*sigma* (x1 - x10)^3*(x2 - x20)^2*x20^(-(9/2) + gamma))/ (96*(-1 + rho^2)^2) - (rho*sigma*(x1 - x10)^3* (x2 - x20)*x20^(-(7/2) + gamma))/ (24*(-1 + rho^2)^2) + ((rho^2 + 16*gamma*(-1 + rho^2) + 28*gamma^2* (-1 + rho^2))*(x2 - x20)^4)/x20^(2*(1 + gamma))/ (96*(-1 + rho^2)^2*sigma^2) + ((1616*gamma^3*(-1 + rho^2)^2 + 496*gamma^4* (-1 + rho^2)^2 + 5*rho^2*(-19 + 21*rho^2) + 32*gamma^2*(53 - 108*rho^2 + 55*rho^4) + 2*gamma*(288 - 665*rho^2 + 374*rho^4))* (x2 - x20)^6)/x20^(2*(2 + gamma))/ (11520*(-1 + rho^2)^3*sigma^2) + ((gamma*(118 - 163*rho^2) + 22*gamma^2* (-1 + rho^2) + 75*(-2 + 3*rho^2))*sigma^2* (x1 - x10)^4*(x2 - x20)^2*x20^(-6 + 2*gamma))/ (5760*(-1 + rho^2)^3) + ((-2 + gamma)*sigma^2*(x1 - x10)^4*(x2 - x20)* x20^(-5 + 2*gamma))/(96*(-1 + rho^2)^2) + (sigma^2*(x1 - x10)^4*x20^(-4 + 2*gamma))/ (96*(-1 + rho^2)^2) + ((-5 + 3*gamma)*rho*sigma^3* (x1 - x10)^5*(x2 - x20)*x20^(-(13/2) + 3*gamma))/ (960*(-1 + rho^2)^3) - ((-5 + 3*gamma)*sigma^4* (x1 - x10)^6*x20^(-7 + 4*gamma))/ (5760*(-1 + rho^2)^3) + (x20^(-1 - 2*gamma)*(x2^2*x20 + x20^3 + sigma^2*(x1 - x10)^2*x20^(2*gamma) + 2*rho*sigma*(x1 - x10)*x20^(3/2 + gamma) - 2*x2*(x20^2 + rho*sigma*(x1 - x10)* x20^(1/2 + gamma))))/(2*(-1 + rho^2)*sigma^2)
c0 <- -(((-3 + 2*gamma)*sigma^2*(x1 - x10)^2* x20^(-3 + 2*gamma))/(48*(-1 + rho^2))) + (7*(15 - 22*gamma + 8*gamma^2)*sigma^4*(x1 - x10)^4* x20^(-6 + 4*gamma))/(11520*(-1 + rho^2)^2) + ((x1 - x10)*x20^(-(3/2) - gamma)*(4*alpha*rho*x20 + 4*beta*rho*x20^2 - sigma*x20^gamma* (4*mu*sqrt(x20) - 2*x20^(3/2) + (-1 + 2*gamma)* rho*sigma*x20^gamma)))/(4*(-1 + rho^2)* sigma) + (sigma*(x1 - x10)^3*x20^(-(9/2) + gamma)* (4*alpha*(1 + 2*gamma)*rho*x20 + 4*beta*(-1 + 2*gamma)*rho*x20^2 + sigma*x20^gamma*(-8*mu*sqrt(x20) + (3 - 8*gamma + 4*gamma^2)*rho*sigma* x20^gamma)))/(192*(-1 + rho^2)^2) + ((x1 - x10)*(x2 - x20)*x20^(-(5/2) - gamma)* (-12*alpha*(1 + 2*gamma)*rho*x20 + 12*beta*(1 - 2*gamma)*rho*x20^2 - sigma*x20^gamma*(-24*mu*sqrt(x20) + (15 - 28*gamma + 12*gamma^2)*rho*sigma* x20^gamma)))/(48*(-1 + rho^2)*sigma) + ((x2 - x20)*x20^(-(3/2) - 2*gamma)* (-4*alpha*x20^(3/2) - 4*beta*x20^(5/2) + sigma*x20^gamma*(4*mu*rho*x20 - 2*rho*x20^2 + (-1 + 2*gamma)*sigma*x20^(1/2 + gamma))))/ (4*(-1 + rho^2)*sigma^2) + ((x2 - x20)^2*x20^(-(5/2) - 2*gamma)* (48*alpha*gamma*x20^(3/2) + 24*beta*(-1 + 2*gamma)* x20^(5/2) - sigma*x20^gamma* (12*(1 + 2*gamma)*mu*rho*x20 + 6*(1 - 2*gamma)* rho*x20^2 + (-9 + 14*gamma)*sigma* x20^(1/2 + gamma))))/(48*(-1 + rho^2)* sigma^2) + (sigma*(x1 - x10)^3*(x2 - x20)* x20^(-6 + gamma)*(60*alpha*(-7 - 12*gamma + 4*gamma^2)*rho*x20^(3/2) + 60*beta*(5 - 12*gamma + 4*gamma^2)*rho* x20^(5/2) + sigma*x20^gamma* (-480*(-2 + gamma)*mu*x20 + (-825 + 1966*gamma - 1484*gamma^2 + 360*gamma^3)*rho*sigma*x20^(1/2 + gamma))))/ (11520*(-1 + rho^2)^2) + ((x2 - x20)^3*x20^(-(7/2) - 2*gamma)* (-4*alpha*(1 + 2*gamma)*(rho^2 + 16*gamma*(-1 + rho^2))*x20^(3/2) - 4*beta*(-1 + 2*gamma)*(rho^2 + 16*gamma* (-1 + rho^2))*x20^(5/2) + sigma*x20^gamma* (8*mu*rho*(-2 + 3*rho^2 + 8*gamma*(-1 + rho^2) + 4*gamma^2*(-1 + rho^2))*x20 + 4*(-1 + 4*gamma^2)*rho*x20^2 + 4*(1 - 4*gamma^2)*rho^3*x20^2 - 4*(-7 + 10*gamma)*sigma*x20^(1/2 + gamma) - (31 - 48*gamma + 4*gamma^2)*rho^2*sigma* x20^(1/2 + gamma))))/(192*(-1 + rho^2)^2* sigma^2) + ((x2 - x20)^4*x20^(-(9/2) - 2*gamma)* (240*alpha*(1 + 3*gamma + 2*gamma^2)* (rho^2 + 8*gamma*(-1 + rho^2))*x20^(3/2) + 120*beta*(-1 + 4*gamma^2)*(rho^2 + 8*gamma*(-1 + rho^2))*x20^(5/2) + sigma*x20^gamma*(-60*(5 + 2*gamma)*mu*rho* (-1 + 3*rho^2 + 8*gamma*(-1 + rho^2) + 4*gamma^2*(-1 + rho^2))*x20 - 30*(-3 - 2*gamma + 12*gamma^2 + 8*gamma^3)*rho* x20^2 + 30*(-3 - 2*gamma + 12*gamma^2 + 8*gamma^3)*rho^3*x20^2 - 2*(675 - 912*gamma - 18*gamma^2 + 4*gamma^3)* sigma*x20^(1/2 + gamma) + (1725 - 2698*gamma + 380*gamma^2 + 8*gamma^3)* rho^2*sigma*x20^(1/2 + gamma))))/ (11520*(-1 + rho^2)^2*sigma^2) + ((x1 - x10)^2*(x2 - x20)*(-12*alpha*(1 + 2*gamma)* rho^2*x20^(3/2) + 12*beta*(1 - 2*gamma)*rho^2* x20^(5/2) - sigma*x20^gamma*(-24*mu*rho*x20 + (-3 + 2*gamma)*(6 - 9*rho^2 + 2*gamma* (-2 + 5*rho^2))*sigma*x20^(1/2 + gamma))))/ (192*(-1 + rho^2)^2*x20^(9/2)) + ((x1 - x10)*(x2 - x20)^2*x20^(-4 - gamma)* (4*alpha*(1 + 2*gamma)*rho*(-4 + 7*rho^2 + 6*gamma*(-1 + rho^2))*x20^(3/2) + 12*beta*rho*(2*gamma - rho^2 + 4*gamma^2* (-1 + rho^2))*x20^(5/2) - sigma*x20^gamma* (8*mu*(-6 + 9*rho^2 + 2*gamma*(-1 + rho^2))* x20 + (-3 + 2*gamma)*rho* (gamma*(22 - 28*rho^2) + 4*gamma^2* (-1 + rho^2) + 3*(-6 + 7*rho^2))*sigma* x20^(1/2 + gamma))))/(192*(-1 + rho^2)^2* sigma) + ((x1 - x10)^2*(x2 - x20)^2* (540*alpha*(1 + 2*gamma)*rho^2*x20^(3/2) + 360*beta*(-1 + 2*gamma)*rho^2*x20^(5/2) - sigma*x20^gamma*(-180*(-7 + 2*gamma)*mu*rho*x20 + (-3 + 2*gamma)*(-180 + 465*rho^2 + gamma*(190 - 724*rho^2) + 12*gamma^2* (-4 + 19*rho^2))*sigma*x20^(1/2 + gamma))))/ (5760*(-1 + rho^2)^2*x20^(11/2)) + ((x1 - x10)*(x2 - x20)^3*x20^(-5 - gamma)* (-60*alpha*(5 + 12*gamma + 4*gamma^2)*rho* (-1 + 4*rho^2 + 4*gamma*(-1 + rho^2))* x20^(3/2) - 60*beta*(-3 + 4*gamma + 4*gamma^2)* rho*(1 + 2*rho^2 + 4*gamma*(-1 + rho^2))* x20^(5/2) + sigma*x20^gamma* (720*mu*(-2 + 5*rho^2 + 2*gamma*(-1 + rho^2))* x20 + (-3 + 2*gamma)*rho*(-835 + 1290*rho^2 + 4*gamma^2*(-53 + 98*rho^2) - 8*gamma* (-125 + 229*rho^2))*sigma* x20^(1/2 + gamma))))/(11520*(-1 + rho^2)^2* sigma)
c1 <- (1/(48*(-1 + rho^2)))*(sigma*(x1 - x10)* x20^(-(7/2) + gamma)*(2*alpha*(1 + 2*gamma)*rho* x20 - (-3 + 2*gamma)*sigma*x20^gamma* (-2*mu*sqrt(x20) + (1 - 3*gamma + 2*gamma^2)*rho* sigma*x20^gamma))) + (x20^(-(5/2) - 2*gamma)*(48*alpha^2*x20^(5/2) + 48*beta^2*x20^(9/2) + 24*beta*sigma* x20^(2 + gamma)*(-4*mu*rho*x20 + 2*rho*x20^2 - 2*(-1 + 2*gamma)*sigma*x20^(1/2 + gamma) + (-1 + 2*gamma)*rho^2*sigma*x20^(1/2 + gamma)) + sigma^2*x20^(2*gamma)*(48*mu^2*x20^(3/2) + 12*x20^(7/2) - 12*(-1 + 2*gamma)*rho*sigma* x20^(2 + gamma) + (-3 + 6*rho^2 + gamma*(28 - 40*rho^2) + 12*gamma^2* (-1 + 2*rho^2))*sigma^2* x20^(1/2 + 2*gamma) - 24*mu*x20* (2*x20^(3/2) - (-1 + 2*gamma)*rho*sigma* x20^gamma)) + 24*alpha*x20* (4*beta*x20^(5/2) + sigma*x20^gamma* (-4*mu*rho*x20 + 2*rho*x20^2 - 4*gamma*sigma* x20^(1/2 + gamma) + (1 + 2*gamma)*rho^2* sigma*x20^(1/2 + gamma)))))/ (96*(-1 + rho^2)*sigma^2) + ((x2 - x20)*x20^(-(7/2) - 2*gamma)* (-48*alpha^2*gamma*x20^(5/2) - 48*beta^2*(-1 + gamma)*x20^(9/2) + 12*beta*rho*sigma*x20^(3 + gamma)* ((-2 + 4*gamma)*mu + (3 - 2*gamma)*x20) + sigma^2*x20^(2*gamma)*(-24*mu^2*x20^(3/2) + 6*x20^(7/2) + 2*(15 - 28*gamma + 12*gamma^2)*mu* rho*sigma*x20^(1 + gamma) - 3*(1 - 2*gamma)^2* rho*sigma*x20^(2 + gamma) + (-1 + gamma)* (-3 + 12*rho^2 + gamma*(28 - 56*rho^2) + 4*gamma^2*(-3 + 8*rho^2))*sigma^2* x20^(1/2 + 2*gamma)) - 4*alpha*x20* (12*beta*(-1 + 2*gamma)*x20^(5/2) + sigma*x20^gamma*(-6*(1 + 2*gamma)*mu*rho*x20 + 3*(-1 + 2*gamma)*rho*x20^2 - 12*gamma*sigma* x20^(1/2 + gamma) + 4*(1 + 2*gamma)*rho^2* sigma*x20^(1/2 + gamma)))))/ (96*(-1 + rho^2)*sigma^2) + ((x1 - x10)^2*(240*alpha^2*(rho^2 + 4*gamma^2*rho^2 + 4*gamma*(1 + rho^2))* x20^(5/2) + 240*beta^2*(-4 + rho^2 + 4*gamma^2*rho^2 - 4*gamma*(-1 + rho^2))* x20^(9/2) + sigma^2*x20^(2*gamma)* (1440*mu^2*x20^(3/2) - 120*x20^(7/2) - 360*(3 - 8*gamma + 4*gamma^2)*mu*rho*sigma* x20^(1 + gamma) + 60*(1 - 2*gamma)^2*rho*sigma* x20^(2 + gamma) + (-480 + 675*rho^2 + 240*gamma^4*rho^2 + gamma*(1764 - 2784*rho^2) - 48*gamma^3*(-11 + 36*rho^2) + 8*gamma^2*(-226 + 451*rho^2))*sigma^2* x20^(1/2 + 2*gamma)) + 120*beta*rho*sigma* x20^(2 + gamma)*(12*(1 - 2*gamma)*mu*x20 + (-3 + 2*gamma)*(2*x20^2 + (1 - 2*gamma)^2*rho* sigma*x20^(1/2 + gamma))) + 120*alpha*x20*(4*beta*(-2 + 4*gamma - rho^2 + 4*gamma^2*rho^2)*x20^(5/2) + sigma*x20^gamma* (-12*(1 + 2*gamma)*mu*rho*x20 + 2*(-1 + 2*gamma)*rho*x20^2 - 8*gamma*sigma* x20^(1/2 + gamma) + (5 + 2*gamma - 12*gamma^2 + 8*gamma^3)*rho^2*sigma* x20^(1/2 + gamma)))))/(23040*(-1 + rho^2)^2* x20^(11/2)) + ((x1 - x10)*(x2 - x20)* x20^(-(9/2) - gamma)*(-240*alpha^2*rho* (rho^2 + 4*gamma^2*rho^2 + 4*gamma*(1 + rho^2))* x20^2 - 240*beta^2*rho*(-4 + rho^2 + 4*gamma^2*rho^2 - 4*gamma*(-1 + rho^2))*x20^4 - 120*beta*rho^2*sigma*x20^(2 + gamma)* (12*(1 - 2*gamma)*mu*sqrt(x20) + (-3 + 2*gamma)* (2*x20^(3/2) + (1 - 2*gamma)^2*rho*sigma* x20^gamma)) - 120*alpha*rho*x20* (4*beta*(-2 + 4*gamma - rho^2 + 4*gamma^2*rho^2)* x20^2 + sigma*x20^gamma*(-12*(1 + 2*gamma)*mu* rho*sqrt(x20) + 2*(-1 + 2*gamma)*rho* x20^(3/2) + (-5 - 16*gamma + 4*gamma^2)* sigma*x20^gamma + 2*(5 + 5*gamma - 8*gamma^2 + 4*gamma^3)*rho^2*sigma* x20^gamma)) + sigma^2*x20^(2*gamma)* (-1440*mu^2*rho*x20 + 120*(-3 + 2*gamma)*mu* (6 - 9*rho^2 + 2*gamma*(-2 + 5*rho^2))*sigma* x20^(1/2 + gamma) - rho*(-120*x20^3 + (-1740 + 1935*rho^2 + gamma*(7464 - 8484* rho^2) + gamma^3*(6528 - 7728*rho^2) + 240*gamma^4*(-6 + 7*rho^2) + 8*gamma^2* (-1351 + 1576*rho^2))*sigma^2* x20^(2*gamma) + 60*(1 - 2*gamma)^2*rho*sigma* x20^(3/2 + gamma)))))/(11520*(-1 + rho^2)^2* sigma) + ((x2 - x20)^2*x20^(-(9/2) - 2*gamma)* (240*alpha^2*(rho^2 + 8*gamma*(-2 + 3*rho^2) + gamma^2*(-40 + 44*rho^2))*x20^(5/2) + 240*beta^2*(-16 + 13*rho^2 - 56*gamma* (-1 + rho^2) + gamma^2*(-40 + 44*rho^2))* x20^(9/2) + 120*beta*rho*sigma*x20^(2 + gamma)* (8*gamma^3*rho*sigma*x20^(1/2 + gamma) + 3*(4*mu*rho^2*x20 + 2*(-2 + rho^2)*x20^2 - rho*sigma*x20^(1/2 + gamma)) - 4*gamma^2*(12*mu*(-1 + rho^2)*x20 - 6*(-1 + rho^2)*x20^2 + 5*rho*sigma* x20^(1/2 + gamma)) + gamma*(-24*mu*x20 + (44 - 40*rho^2)*x20^2 + 14*rho*sigma* x20^(1/2 + gamma))) + 120*alpha* (4*beta*(-1 + 2*gamma)*(3*rho^2 + gamma*(-20 + 22*rho^2))*x20^(7/2) + sigma*x20^gamma*(-4*(1 + 2*gamma)*mu*rho* (-4 + 7*rho^2 + 6*gamma*(-1 + rho^2))* x20^2 + 4*(1 + gamma - 6*gamma^2)*rho* x20^3 + 6*(-1 + 4*gamma^2)*rho^3*x20^3 + 16*gamma*(4 + gamma)*sigma* x20^(3/2 + gamma) + (-21 - 126*gamma - 36*gamma^2 + 8*gamma^3)*rho^2*sigma* x20^(3/2 + gamma) + 2*(13 + 28*gamma + 4*gamma^2)*rho^4*sigma* x20^(3/2 + gamma))) + sigma^2*x20^(2*gamma)* (480*mu^2*(-6 + 9*rho^2 + 2*gamma*(-1 + rho^2))* x20^(3/2) + 120*(-3 + 2*gamma)*mu*rho* (gamma*(22 - 28*rho^2) + 4*gamma^2* (-1 + rho^2) + 3*(-6 + 7*rho^2))*sigma* x20^(1 + gamma) + 240*gamma^4*(6 - 25*rho^2 + 20*rho^4)*sigma^2*x20^(1/2 + 2*gamma) - 48*gamma^3*sigma*x20^gamma*(-10*rho*x20^2 + 10*rho^3*x20^2 + 158*sigma* x20^(1/2 + gamma) - 607*rho^2*sigma* x20^(1/2 + gamma) + 474*rho^4*sigma* x20^(1/2 + gamma)) + 8*gamma^2*sigma* x20^gamma*(-240*rho*x20^2 + 270*rho^3*x20^2 + 1619*sigma*x20^(1/2 + gamma) - 5984*rho^2* sigma*x20^(1/2 + gamma) + 4590*rho^4*sigma* x20^(1/2 + gamma)) - 12*gamma* (20*(-1 + rho^2)*x20^(7/2) + 10*rho*(-13 + 15*rho^2)*sigma* x20^(2 + gamma) + (612 - 2421*rho^2 + 1894*rho^4)*sigma^2*x20^(1/2 + 2*gamma)) + 15*(-24*rho*sigma*x20^(2 + gamma) + 28*rho^3*sigma*x20^(2 + gamma) + 36*sigma^2*x20^(1/2 + 2*gamma) + 264*rho^4*sigma^2*x20^(1/2 + 2*gamma) - rho^2*(8*x20^(7/2) + 287*sigma^2*x20^(1/2 + 2*gamma))))))/(23040*(-1 + rho^2)^2* sigma^2)
c2 <- (-240*alpha^2*(rho^2 + 4*gamma*(-3 + rho^2) + 4*gamma^2*(-2 + rho^2))*x20^(5/2) - 240*beta^2*(-1 + 2*gamma)*(4 - rho^2 + 2*gamma*(-2 + rho^2))*x20^(9/2) - 120*beta*(1 - 2*gamma)^2*(-3 + 2*gamma)*rho^2* sigma^2*x20^(5/2 + 2*gamma) + sigma^2*x20^(2*gamma)*(-480*(-3 + 2*gamma)*mu^2* x20^(3/2) + 120*(-1 + 2*gamma)*x20^(7/2) + 480*(-3 + 11*gamma - 12*gamma^2 + 4*gamma^3)*mu* rho*sigma*x20^(1 + gamma) - 240*(1 - 2*gamma)^2* (-1 + gamma)*rho*sigma*x20^(2 + gamma) + (gamma^3*(6288 - 9888*rho^2) + 240*gamma^4* (-6 + 11*rho^2) + 15*(-8 + 27*rho^2) - 60*gamma*(-65 + 94*rho^2) + 8*gamma^2* (-1079 + 1559*rho^2))*sigma^2* x20^(1/2 + 2*gamma)) - 120*alpha* (4*beta*(-1 + 4*gamma^2)*(-2 + rho^2)*x20^(7/2) + sigma*x20^(1 + gamma)*(8*(1 + 2*gamma)*mu*rho* x20 + 4*(1 - 2*gamma)*rho*x20^2 - 8*gamma*(-5 + 2*gamma)*sigma* x20^(1/2 + gamma) + (-7 - 18*gamma - 4*gamma^2 + 8*gamma^3)*rho^2*sigma* x20^(1/2 + gamma))))/(11520*(-1 + rho^2)* x20^(9/2))

output <- list()
output\$llk <- (-(m/2))*log(2*del*pi) - Dv + cm1/del + c0 + del*c1 + (1/2)*del^2*c2

return(output)
}
```
mfrdixon/MLEMVD documentation built on May 1, 2018, 11:38 p.m.