R/Simulation_helper_functions.R
calculate_AR_coefficients_matrices.Rd
Computes autoregressive (AR) coefficient matrices for each season and weather state based on the parameters of a fitted spatial weather model and the spatial coordinates of observation locations. This function is part of the process for preparing data for spatial weather simulations, allowing the AR process to consider spatial correlations.
calculate_AR_coefficients_matrices(parm, coordinates, AR_lag)
A list containing the fitted parameters of the spatial weather model. This list should include elements for each season, and within each season, parameters (`gf_par`) for each weather state.
A matrix or data frame of geographic coordinates for the locations represented in the model. The coordinates are used to calculate spatial covariance matrices.
The lag order of the autoregressive model to be used in calculating the coefficient matrices. Specifies how many past time points should be considered in the AR process.
A list of AR coefficient matrices (`bk`) for each season and weather state, along with the base covariance matrix (`cov0`) used in their calculation. The structure of the return list mirrors that of the `parm` input, with a set of coefficient matrices for each season and weather state.
if (FALSE) { # \dontrun{
# Assuming `fitted_parms` contains the fitted model parameters and
# `site_coordinates` contains the geographic coordinates for your locations:
AR_coeffs = calculate_AR_coefficients_matrices(parm = fitted_parms,
coordinates = site_coordinates,
AR_lag = 1)
} # }