deterministic: create deterministic rcppbugs objects

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

Description

Deterministic objects determine their values from other nodes in the mcmc model. They have no contribution to the overall likelihood of the model, but are frequently used as hyperparmeters of stochastic objects.

Usage

1
2
3

Arguments

f

a user provided funtion that updates the value of the variable

X

the data matrix X to be used in estimation

b

the coefficient vector b to be used in estimation

group

an integer vector equal in length to the rows of X indicating the group membership of the corresponding row

...

arguments to function f

Details

The number of arguments must match the arity of function f.

Value

an rcppbugs object representing the deterministic object.

Author(s)

rcppbugs was written by Whit Armstrong.

References

https://github.com/armstrtw/CppBugs

See Also

logp,run.model

Examples

1
2
3
4
5
6
7
8
NR <- 1e2L
NC <- 2L
y <- matrix(rnorm(NR,1),nr=NR,nc=1L)
X <- matrix(nr=NR,nc=NC)

b <- mcmc.normal(rnorm(NC),mu=0,tau=0.0001)
y.hat.user <- deterministic(function(X,b) { X %*% b }, X, b)
y.hat.cpp <- linear(X,b)

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