obtain_u_set_mix1: Obtain set of thresholds with high posterior density for the...

View source: R/optim.R

obtain_u_set_mix1R Documentation

Obtain set of thresholds with high posterior density for the TZP-power-law mixture model

Description

obtain_u_set_mix1 computes the profile posterior density of the threshold u, and subsets the thresholds (and other parameter values) with high profile values i.e. within a certain value from the maximum posterior density. The set of u can then be used for mcmc_mix1.

Usage

obtain_u_set_mix1(
  df,
  positive = FALSE,
  u_max = 2000L,
  log_diff_max = 11,
  alpha1_init = 0.01,
  theta1_init = exp(-1),
  alpha2_init = 2,
  a_psiu = 0.1,
  b_psiu = 0.9,
  m_alpha1 = 0,
  s_alpha1 = 10,
  a_theta1 = 1,
  b_theta1 = 1,
  m_alpha2 = 0,
  s_alpha2 = 10,
  xmax = 1e+05
)

Arguments

df

A data frame with at least two columns, x & count

positive

Boolean, is alpha1 positive (TRUE) or unbounded (FALSE, default)?

u_max

Positive integer for the maximum threshold

log_diff_max

Positive real number, the value such that thresholds with profile posterior density not less than the maximum posterior density - log_diff_max will be kept

alpha1_init

Scalar, initial value of alpha1

theta1_init

Scalar, initial value of theta1

alpha2_init

Scalar, initial value of alpha2

a_psiu, b_psiu, m_alpha1, s_alpha1, a_theta1, b_theta1, m_alpha2, s_alpha2

Scalars, hyperparameters of the priors for the parameters

xmax

Scalar (default 100000), positive integer limit for computing the normalising constant

Value

A list: u_set is the vector of thresholds with high posterior density, init is the data frame with the maximum profile posterior density and associated parameter values, profile is the data frame with all thresholds with high posterior density and associated parameter values, scalars is the data frame with all arguments (except df)

See Also

mcmc_mix1_wrapper that wraps obtain_u_set_mix1 and mcmc_mix1, obtain_u_set_mix2 for the equivalent function for the 2-component mixture model


clement-lee/rackage documentation built on March 28, 2024, 7:05 p.m.