mcmc.distributions: Create a stochastic rcppbugs object.

Description Usage Arguments Value Author(s) References See Also Examples

Description

Create stochastic objects in the spirit of PyMC.

Usage

1
2
3
4
5
6
mcmc.normal(x, mu, tau, observed = FALSE)
mcmc.uniform(x, lower, upper, observed = FALSE)
mcmc.gamma(x, alpha, beta, observed = FALSE)
mcmc.beta(x, alpha, beta, observed = FALSE)
mcmc.bernoulli(x, p, observed = FALSE)
mcmc.binomial(x, n, p, observed = FALSE)

Arguments

x

the initial value of the object

mu

the mean for normally distributed objects

tau

the precision of normally distributed objects

lower

the lower limit of the uniform distribution

upper

the upper limit of the uniform distribution

alpha

the shape parameter of the gamma distribution

beta

the scale parameter of the gamma distribution

n

the sample size of a binomial distribution

p

the success rate in bernoulli or binomial distributions

observed

whether the object should be treated as constant data or simulated over the MCMC chain

Value

an rcppbugs object corresponding to the particular distribution requested

Author(s)

rcppbugs was written by Whit Armstrong.

References

https://github.com/armstrtw/CppBugs

See Also

logp

Examples

1
2
3
b <- mcmc.normal(rnorm(10),mu=0,tau=0.0001)
tau <- mcmc.gamma(runif(1),alpha=0.1,beta=0.1)
b.unif <- mcmc.uniform(runif(1),lower=0,upper=100)

armstrtw/rcppbugs documentation built on May 10, 2019, 1:42 p.m.