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

View source: R/optim.R

obtain_u_set_mix2_constrainedR Documentation

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

Description

obtain_u_set_mix2_constrained 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. Power law is assumed for the body, and alpha is assumed to be greater than 1.0 and smaller than 1.0/shape+1.0

Usage

obtain_u_set_mix2_constrained(
  df,
  u_max = 2000L,
  log_diff_max = 11,
  alpha_init = 2,
  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

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

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

obtain_u_set_mix2 for the unconstrained version


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