Learn R Programming

crandep (version 0.3.1)

mcmc_upp: Markov chain Monte Carlo for discrete power law

Description

mcmc_upp returns the samples from the posterior of xi1, for fitting the discrete power law to the data x. The samples are obtained using Markov chain Monte Carlo (MCMC).

Usage

mcmc_upp(
  x,
  u,
  xi1,
  a_xi1,
  b_xi1,
  N = 20000L,
  thin = 10L,
  burnin = 20000L,
  print_freq = 10000L
)

Value

A data frame containing N rows and 2 columns which represent xi1 and the log-posterior density (lpost)

Arguments

x

Vector of positive integers, representing the data

u

Scalar, non-negative integer threshold

xi1

Scalar, initial value of the shape parameter

a_xi1

Scalar, lower bound of the uniform distribution as the prior of xi1

b_xi1

Scalar, upper bound of the uniform distribution as the prior of xi1

N

Scalar, positive integer representing the length of the output chain i.e. the number of rows in the returned data frame

thin

Scalar, positive integer representing the thinning in the MCMC

burnin

Scalar, non-negative integer representing the burn-in of the MCMC

print_freq

Scalar, positive integer representing the frequency of printing the sampled values

Details

In the MCMC, a componentwise Metropolis-Hastings algorithm is used. Unlike mcmc_mix, the threshold u is treated as fixed in mcmc_upp.

See Also

mcmc_mix for MCMC for the discrete extreme value mixture distribution.