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

View source: R/optim.R

obtain_u_set_mix2R Documentation

Obtain set of thresholds with high posterior density for the 2-component mixture model

Description

obtain_u_set_mix2 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_mix2.

Usage

obtain_u_set_mix2(
  df,
  powerlaw = FALSE,
  positive = FALSE,
  u_max = 2000L,
  log_diff_max = 11,
  alpha_init = 0.01,
  theta_init = exp(-1),
  shape_init = 0.1,
  sigma_init = 1,
  a_psiu = 0.001,
  b_psiu = 0.9,
  m_alpha = 0,
  s_alpha = 10,
  a_theta = 1,
  b_theta = 1,
  m_shape = 0,
  s_shape = 10,
  a_sigma = 1,
  b_sigma = 0.01
)

Arguments

df

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

powerlaw

Boolean, is the power law (TRUE) or polylogarithm (FALSE, default) assumed?

positive

Boolean, is alpha 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

alpha_init

Scalar, initial value of alpha

theta_init

Scalar, initial value of theta

shape_init

Scalar, initial value of shape parameter

sigma_init

Scalar, initial value of sigma

a_psiu, b_psiu, m_alpha, s_alpha, a_theta, b_theta, m_shape, s_shape, a_sigma, b_sigma

Scalars, hyperparameters of the priors for the parameters

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_mix2_wrapper that wraps obtain_u_set_mix2 and mcmc_mix2, obtain_u_set_mix1 for the equivalent function for the TZP-power-law mixture model


crandep documentation built on Sept. 11, 2024, 8:01 p.m.