samplePosteriorDist {optimalThreshold}R Documentation

Sample in the posterior distribution of the parameters of a given theoretical distribution.

Description

The samplePosteriorDist function samples the parameters of a given theoretical distribution using explicit posterior distribution (if it exists), or a Markov Chain Monte Carlo (MCMC) algorithm when the posterior distribution is unknown. See details to know on what kind of S4 objects this function could be applied.

Usage

samplePosteriorDist(object, K, ...)

## S4 method for signature 'fitNormalDist'
samplePosteriorDist(object, K, n)

## S4 method for signature 'fitLogNormalDist'
samplePosteriorDist(object, K, n)

## S4 method for signature 'fitGammaDist'
samplePosteriorDist(object, K, do.pb, seed)

## S4 method for signature 'fitStudentDist'
samplePosteriorDist(object, K, do.pb, seed)

## S4 method for signature 'fitLogisticDist'
samplePosteriorDist(object, K, do.pb, seed)

Arguments

object

A distribution object.

K

A numerical value indicating the length of the sample.

...

other parameters passed to methods.

n

number of MCMC chains.

do.pb

Indicates whther progressing bar or not

seed

seed for the random number generator. Integer.

Details

This method can be applied to the S4 distribution objects that are supported in the optimalThreshold package: fitNormalDist, fitLogNormalDist, fitGammaDist, fitStudentDist, and fitLogisticDist. These methods are applied internally, and you have no need to use it outside of the main function optThresEst. See below to have details on the expression of the samplePosteriorDist function according to the type of distribution.

Value

Returns an object of class list.

References

Gelman, A, et al. 2014. Bayesian Data Analysis. 3rd edition, CRC Press, Boca Raton, section 2.8. Sook, Y, and Oh, M. Bayesian estimation of the two-parameter Gamma distribution. Communications in Statistics - Simulation and Computation. 2006; 35: 285-293.

See Also

trtSelThresh


[Package optimalThreshold version 1.0 Index]