Learn R Programming

gctsc (version 0.1.3)

pmvn_ce: Approximate Log-Likelihood via Continuous Extension (CE)

Description

Computes the approximate log-likelihood of a count time series model using the Continuous Extension (CE) method. This approach approximates the probability of the observed count vector by replacing the discrete indicator function with a smooth approximation, controlled by a smoothing parameter c.

Usage

pmvn_ce(lower, upper, tau, od, c = 0.5, ret_llk = TRUE)

Value

Returns a numeric value representing the approximate log-likelihood.

Arguments

lower

Numeric vector of length n; lower bounds of the transformed latent variables.

upper

Numeric vector of length n; upper bounds of the transformed latent variables.

tau

Numeric vector of ARMA dependence parameters (concatenated phi, theta).

od

Integer vector of length 2: c(p, q) for AR and MA orders.

c

Smoothing bandwidth parameter; default is 0.5. Must lie in (0,1).

ret_llk

Logical; return log-likelihood if TRUE.

Details

The method is applicable to Gaussian copula models with ARMA dependence and arbitrary discrete marginal distributions, provided the marginal CDF bounds are given for each observation.

Examples

Run this code
# Simulate Poisson AR(1) data
mu=10
tau=0.2
arma_order=c(1,0)
sim_data <- sim_poisson(mu =mu, tau=tau, arma_order=arma_order, nsim = 1000, seed = 1)
y <- sim_data$y

# Compute latent bounds for CE method
a <- qnorm(ppois(y - 1, lambda = mu))  # lower bound
b <- qnorm(ppois(y, lambda = mu))      # upper bound

# Approximate log-likelihood with CE method
llk_ce <- pmvn_ce(lower = a, upper = b, tau = tau, od = arma_order, c = 0.5)
print(llk_ce)

Run the code above in your browser using DataLab