rp: Random samples from the prior of a 'hyper2' object

Description Usage Arguments Details Value Note Author(s) See Also Examples

Description

Uses Metropolis-Hastings to return random samples from the prior of a hyper2 object

Usage

1
rp(n, H, startp = NULL, fcm = NULL, fcv = NULL, SMALL = 1e-06, l=loglik,...)

Arguments

H

Object of class hyper2

n

Number of samples

startp

Starting value for the Markov chain, with default NULL being interpreted as starting from the evaluate

fcm,fcv

Constraints as for maxp()

SMALL

Notional small value for numerical stability

l

Log-likelihood function with default loglik()

...

Further arguments, currently ignored

Details

Uses the implementation of Metropolis-Hastings from the MCE package to sample from the posterior PDF of a hyper2 object.

If the distribution is Dirichlet, use rdirichlet() to generate random observations: it is much faster, and produces serially independent samples. To return uniform samples, use rp_unif() (documented at dirichlet.Rd).

Value

Returns a matrix, each row being a unit-sum observation.

Note

Function rp() a random sample from a given normalized likelihood function. To return a likelihood function based on random observations, use rhyper2().

Author(s)

Robin K. S. Hankin

See Also

maxp,loglik,dirichlet,rhyper2

Examples

1
2
3

hyper2 documentation built on March 4, 2021, 9:09 a.m.