loglik {iAR}R 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:

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:

References

Eyheramendy S, Elorrieta F, Palma W (2018). “An irregular discrete time series model to identify residuals with autocorrelation in astronomical light curves.” Monthly Notices of the Royal Astronomical Society, 481(4), 4311-4322. ISSN 0035-8711, doi:10.1093/mnras/sty2487, https://academic.oup.com/mnras/article-pdf/481/4/4311/25906473/sty2487.pdf.

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


[Package iAR version 1.3.1 Index]