| fim_barma | R Documentation |
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
fim_barma(y, ar, ma, alpha, varphi, theta, phi, link, xreg = NULL, beta = NULL)
y |
A numeric vector representing the time series data, in (0, 1). |
ar |
A numeric vector specifying the autoregressive (AR) lags
(e.g., |
ma |
A numeric vector specifying the moving average (MA) lags
(e.g., |
alpha |
The intercept term (numeric scalar). |
varphi |
A numeric vector of autoregressive (AR) parameters.
Use |
theta |
A numeric vector of moving average (MA) parameters.
Use |
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:
|
xreg |
A matrix or data frame of static regressors (optional).
Must have the same number of rows as length of |
beta |
A numeric vector of regression coefficients for |
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.
A list containing:
fisher_info_mat |
The Fisher Information Matrix (numeric matrix).
Dimensions: |
fitted_ts |
The fitted values (conditional mean) as a |
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 |
errorhat_full |
The estimated errors on the predictor scale (numeric vector, length = length(y)), zero-padded for burn-in period. |
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")}
barma for model fitting,
loglik_barma for log-likelihood computation,
score_vector_barma for score vector (gradient)
# 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)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.