Log-Likelihood Functions for Probability Models
Source:R/utils-log-likelihood.R
utils_log_likelihood.RdCompute the log-likelihood for stationary and nonstationary probability models.
For NS-FFA: To compute the log-likelihood for a nonstationary probability model,
include the observation years (ns_years) and the nonstationary model structure
(ns_structure).
Arguments
- data
Numeric vector of observed annual maximum series values. Must be strictly positive, finite, and not missing.
- distribution
A three-character code indicating the distribution family. Must be
"GUM","NOR","LNO","GEV","GLO","GNO","PE3","LP3", or"WEI".- params
Numeric vector of distribution parameters, in the order (location, scale, shape). The length must be between 2 and 5, depending on the specified
distributionandstructure.- ns_years
For NS-FFA only: Numeric vector of observation years corresponding to
data. Must be the same length asdataand strictly increasing.- ns_structure
For NS-FFA only: Named list indicating which distribution parameters are modeled as nonstationary. Must contain two logical scalars:
location: IfTRUE, the location parameter has a linear temporal trend.scale: IfTRUE, the scale parameter has a linear temporal trend.