Learn R Programming

rust (version 1.4.3)

gpd_logpost: Generalized Pareto posterior log-density

Description

Calculates the generalized Pareto posterior log-density based on a particular prior for the generalized Pareto parameters, a Maximal Data Information (MDI) prior truncated to \(\xi \geq -1\) in order to produce a posterior density that is proper.

Usage

gpd_logpost(pars, ss)

Value

A numeric scalar. The value of the log-likelihood.

Arguments

pars

A numeric vector containing the values of the generalized Pareto parameters \(\sigma\) and \(\xi\).

ss

A numeric list. Summary statistics to be passed to the generalized Pareto log-likelihood. Calculated using gpd_sum_stats

References

Northrop, P. J. and Attalides, N. (2016) Posterior propriety in Bayesian extreme value analyses using reference priors. Statistica Sinica, 26(2), 721-743, tools:::Rd_expr_doi("10.5705/ss.2014.034").

See Also

gpd_sum_stats to calculate summary statistics for use in gpd_loglik.

rgpd for simulation from a generalized Pareto

Examples

Run this code
# \donttest{
# Sample data from a GP(sigma, xi) distribution
gpd_data <- rgpd(m = 100, xi = 0, sigma = 1)
# Calculate summary statistics for use in the log-likelihood
ss <- gpd_sum_stats(gpd_data)
# Calculate the generalized Pareto log-posterior
gpd_logpost(pars = c(1, 0), ss = ss)
# }

Run the code above in your browser using DataLab