CutModel: Function to set the cut model

Description Usage Arguments Value Author(s) Examples

View source: R/CutModel.R

Description

This function combines all probability density and observations involved in the cut distribution. Including two density functions for phi and theta and the observations Z and Y.

Usage

1
CutModel(px = px, py = py, prox = prox, rprox = rprox, proy = proy, rproy = rproy, Z = Z, Y = Y, d_x = d_x, d_y = d_y, cpp_yes = FALSE, cpp_package = '')

Arguments

px

The density1: Z|phi * phi

py

The unnormalized density2: Y|theta&phi * theta

prox

The proposal density for phi

rprox

The proposal samling function for phi

proy

The proposal density for theta in the auxiliary chain

rproy

The proposal samling function for theta in the auxiliary chain

Z

The observations of Z

Y

The observations of Y

d_x

The dimension of theta

d_y

The dimension of phi

cpp_yes

Logic value, indicate if you are using a C code to write density function px and py and build them within a package XX.

cpp_package

If cpp_yes == TRUE, name the package XX here.

Value

It produce a list of density function and observations. This simplifies the process when these functions and observations are loaded in other functions.

px

The density1: Z|phi * phi

py

The unnormalized density2: Y|theta&phi * theta

prox

The proposal density for phi

rprox

The proposal samling function for phi

proy

The proposal density for theta in the auxiliary chain

rproy

The proposal samling function for theta in the auxiliary chain

Z

The observations of Z

Y

The observations of Y

d_x

The dimension of theta

d_y

The dimension of phi

Author(s)

Yang Liu

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## The function is currently defined as
function(px = px, py = py, Z = Z, Y = Y, d_x = d_x, d_y = d_y, cpp_yes = FALSE, cpp_package = ''){
  if(cpp_yes){
    rm(px)
    rm(py)
    library(cpp_package,character.only=TRUE)
    return(list(px=px,py=py, Z = Z, Y = Y, d_x = d_x, d_y = d_y))
  }else{
    return(list(px=px,py=py, Z = Z, Y = Y, d_x = d_x, d_y = d_y))
  }
}

MathBilibili/Stochastic-approximation-cut-algorithm documentation built on Dec. 25, 2021, 2:44 p.m.