fim_barma: Compute Fisher Information Matrix for Beta Autoregressive...

View source: R/fim_barma.R

fim_barmaR Documentation

Compute Fisher Information Matrix for Beta Autoregressive Moving Average Models

Description

Computes the observed Fisher Information Matrix (FIM) of a Beta Autoregressive Moving Average (BARMA) model. This function also efficiently returns auxiliary values like fitted values and residuals.

This function is designed for users who:

  • Compute standard errors of parameter estimates

  • Construct confidence intervals

  • Perform hypothesis tests

  • Verify theoretical properties

  • Conduct simulation studies

Usage

fim_barma(y, ar, ma, alpha, varphi, theta, phi, link, xreg = NULL, beta = NULL)

Arguments

y

A numeric vector representing the time series data, in (0, 1).

ar

A numeric vector specifying the autoregressive (AR) lags (e.g., c(1, 2)). Can be NA or NULL if no AR component.

ma

A numeric vector specifying the moving average (MA) lags (e.g., 1). Can be NA or NULL if no MA component.

alpha

The intercept term (numeric scalar).

varphi

A numeric vector of autoregressive (AR) parameters. Use numeric(0) or empty vector if no AR component. Length must match ar specification.

theta

A numeric vector of moving average (MA) parameters. Use numeric(0) or empty vector if no MA component. Length must match ma specification.

phi

The precision parameter of the BARMA model (must be positive and finite). Larger values indicate less variance for a given mean.

link

A character string specifying the link function: "logit" (default), "probit", or "cloglog".

xreg

A matrix or data frame of static regressors (optional). Must have the same number of rows as length of y.

beta

A numeric vector of regression coefficients for xreg (optional). Length must match number of columns in xreg.

Details

Fisher Information Matrix for BARMA Models

The Fisher Information Matrix is computed from the outer product of score vectors at the MLE, which provides the observed FIM. The FIM is used to obtain standard errors via sqrt(diag(solve(FIM))).

**Non-Diagonal Structure**: Unlike generalized linear models, the FIM is not block-diagonal due to the coupling introduced by the ARMA dynamics. This is documented in the Rocha & Cribari-Neto (2009) paper.

**Important**: This function implements the corrections from the 2017 Erratum (Rocha & Cribari-Neto, 2017) for moving average components. See References section for details.

**Parameter Order**: Parameters should be supplied in the order: alpha, varphi (AR), theta (MA), phi, beta (regressors). This matches the parameter order used by barma.

Value

A list containing:

fisher_info_mat

The Fisher Information Matrix (numeric matrix). Dimensions: (k+p+q+2) x (k+p+q+2) where k is number of regressors, p is AR order, q is MA order. The matrix is symmetric and should be positive definite at the MLE.

fitted_ts

The fitted values (conditional mean) as a ts object, with the same time index as the input y. Values for the burn-in period (first max_lag observations) are NA.

muhat_effective

The fitted conditional means (numeric vector) excluding the burn-in period.

etahat_full

The estimated linear predictor values (numeric vector, length = length(y)), with NA for burn-in period.

errorhat_full

The estimated errors on the predictor scale (numeric vector, length = length(y)), zero-padded for burn-in period.

References

Rocha, A.V., & Cribari-Neto, F. (2009). Beta autoregressive moving average models. TEST, 18(3), 529-545. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/s11749-008-0112-z")}

Rocha, A.V., & Cribari-Neto, F. (2017). Erratum to: Beta autoregressive moving average models. TEST, 26, 451-459. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/s11749-017-0528-4")}

See Also

barma for model fitting, loglik_barma for log-likelihood computation, score_vector_barma for score vector (gradient)

Examples


  # Example 1: Fisher Information Matrix for a BAR(1) model
  set.seed(2025)
  y_sim_bar <- simu_barma(
    n = 250,
    alpha = 0.0,
    varphi = 0.6,
    phi = 25.0,
    link = "logit",
    freq = 12
  )

  result_bar <- fim_barma(
    y = y_sim_bar,
    ar = 1,
    ma = NA,
    alpha = 0.0,
    varphi = 0.6,
    theta = numeric(0),
    phi = 25.0,
    link = "logit"
  )

  # Check positive definiteness
  fim <- result_bar$fisher_info_mat
  all(eigen(fim)$values > 0)

  # Standard errors from inverse of FIM
  sqrt(diag(solve(fim)))

  # Example 2: Fisher Information Matrix for a BARMA(1,1) model
  set.seed(2025)
  y_sim_barma <- simu_barma(
    n = 250,
    alpha = 0.0,
    varphi = 0.6,
    theta = 0.3,
    phi = 25.0,
    link = "logit",
    freq = 12
  )

  result_barma <- fim_barma(
    y = y_sim_barma,
    ar = 1,
    ma = 1,
    alpha = 0.0,
    varphi = 0.6,
    theta = 0.3,
    phi = 25.0,
    link = "logit"
  )

  # Standard errors
  sqrt(diag(solve(result_barma$fisher_info_mat)))



betaARMA documentation built on March 29, 2026, 5:08 p.m.