mcmc_pol: Markov chain Monte Carlo for Zipf-polylog distribution

View source: R/RcppExports.R

mcmc_polR Documentation

Markov chain Monte Carlo for Zipf-polylog distribution

Description

mcmc_pol returns the samples from the posterior of alpha and theta, for fitting the Zipf-polylog distribution to the data x. The samples are obtained using Markov chain Monte Carlo (MCMC). In the MCMC, a Metropolis-Hastings algorithm is used.

Usage

mcmc_pol(
  x,
  count,
  alpha,
  theta,
  a_alpha,
  b_alpha,
  a_theta,
  b_theta,
  a_pseudo,
  b_pseudo,
  pr_power,
  iter,
  thin,
  burn,
  freq,
  invt,
  xmax = 100000L
)

Arguments

x

Vector of the unique values (positive integers) of the data

count

Vector of the same length as x that contains the counts of each unique value in the full data, which is essentially rep(x, count)

alpha

Real number greater than 1, initial value of the parameter

theta

Real number in (0, 1], initial value of the parameter

a_alpha

Real number, mean of the prior normal distribution for alpha

b_alpha

Positive real number, standard deviation of the prior normal distribution for alpha

a_theta

Positive real number, first parameter of the prior beta distribution for theta; ignored if pr_power = 1.0

b_theta

Positive real number, second parameter of the prior beta distribution for theta; ignored if pr_power = 1.0

a_pseudo

Positive real number, first parameter of the pseudoprior beta distribution for theta in model selection; ignored if pr_power = 1.0

b_pseudo

Positive real number, second parameter of the pseudoprior beta distribution for theta in model selection; ignored if pr_power = 1.0

pr_power

Real number in [0, 1], prior probability of the discrete power law

iter

Positive integer representing the length of the MCMC output

thin

Positive integer representing the thinning in the MCMC

burn

Non-negative integer representing the burn-in of the MCMC

freq

Positive integer representing the frequency of the sampled values being printed

invt

Vector of the inverse temperatures for Metropolis-coupled MCMC; default c(1.0) i.e. no Metropolis-coupling

xmax

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

Value

A list: $pars is a data frame of iter rows of the MCMC samples, $fitted is a data frame of length(x) rows with the fitted values, amongst other quantities related to the MCMC

See Also

mcmc_mix2 and mcmc_mix3 for MCMC for the 2-component and 3-component discrete extreme value mixture distributions, respectively.


crandep documentation built on Nov. 22, 2023, 1:08 a.m.