cpmmc: Instantiate cpmmc object and set initial parameters

Description Usage Arguments Value Examples

View source: R/cpmmc_main.R

Description

This is an S3 object constructor helper function for class cpmmc which inherit from metropolis_hastings class and markov_chain class

Usage

1
2
3
cpmmc(data, theta_0, u_0, rho, log_marginal_estimator_func,
  log_theta_prior_density, log_theta_proposal_density,
  theta_proposal_sampler)

Arguments

data,

observed data points

theta_0,

initialisation of the vector of parameters of interest

u_0,

initialisation of the auxiliary random variables

rho,

correlation parameter used to sample auxiliary random variables

log_marginal_estimator_func,

log likelihood estimator function

log_theta_prior_density,

log density function for the prior distribution of theta

log_theta_proposal_density,

log density function for theta proposals

theta_proposal_sampler,

distribution function to sample new theta proposals

Value

cpmmc object

Examples

1
2
3
4
5
6
7
8
9
cpmmc_obj <- cpmmc(data = rnorm(10, 1, 1),
theta_0 = 0,
u_0 = array(rnorm(5*10), dim = c(5,1,10)),
rho = 0.9,
log_marginal_estimator_func = function(x) {dnorm(x, 1, log=T)},
log_theta_prior_density = function(x) {dnorm(x, log = T)},
log_theta_proposal_density = function(old_theta, new_theta) {dnorm(new_theta-old_theta, log = T)},
theta_proposal_sampler = function(theta) {rnorm(1, mean = theta)}
)

JTT94/cpmmc documentation built on May 14, 2019, 12:08 p.m.