loglik: Maximum Likelihood Estimation for iAR Models

loglikR Documentation

Maximum Likelihood Estimation for iAR Models

Description

Maximum Likelihood Estimation for irregular autoregressive (iAR) models, supporting different distribution families: normal ('iAR'), t ('iAR-T'), and gamma ('iAR-Gamma').

Usage

loglik(x, ...)

Arguments

x

An object of class iAR, containing the model specification, parameters, and the time series to be evaluated:

  • series: The observed time series.

  • times: A numeric vector specifying the time points of the series.

  • series_esd: (Optional) A standardized version of the series.

  • zero_mean: Logical. Indicates whether the series should be mean-centered.

  • standardized: Logical. Indicates whether the series is standardized.

  • hessian: Logical. If TRUE, the function computes the Hessian matrix for parameter estimation.

  • family: The distribution family of the iAR model (one of "norm", "t", or "gamma").

  • df: Degrees of freedom for the t-distribution (only for family = "t").

  • sigma: The scale parameter for the t-distribution (only for family = "t").

  • mean: The mean parameter for the gamma distribution (only for family = "gamma").

  • variance: The variance parameter for the gamma distribution (only for family = "gamma").

...

Additional arguments (unused).

Details

This method estimates the parameters of an iAR model using the Maximum Likelihood Estimation (MLE) approach. Depending on the chosen distribution family, the corresponding likelihood function is maximized:

  • "norm" maximizes the likelihood for a normally-distributed series.

  • "t" maximizes the likelihood for a t-distributed series.

  • "gamma" maximizes the likelihood for a gamma-distributed series.

The function updates the iAR object with the estimated parameters, the log-likelihood value, and a summary table that includes standard errors and p-values.

Value

An updated iAR object with the following additional attributes:

  • coef: Estimated model coefficients.

  • loglik: Log-likelihood value of the model.

  • summary: A summary table containing parameter estimates, standard errors, and p-values.

  • sigma: For t and gamma families, the estimated scale parameter.

  • mean: For the gamma family, the estimated mean parameter.

  • variance: For the gamma family, the estimated variance parameter.

References

\insertRef

Eyheramendy_2018iAR

Examples

# Example: Estimating parameters for a normal iAR model
library(iAR)
times <- 1:100
model <- iAR(family = "norm", times = times, coef = 0.9, hessian = TRUE)
model <- sim(model)  # Simulate the series
model <- loglik(model)  # Estimate parameters using MLE
print(model@coef)  # Access the estimated coefficients
print(model@loglik)  # Access the computed log-likelihood


iAR documentation built on April 4, 2025, 2:21 a.m.

Related to loglik in iAR...