rtnorm_rw_fac: Random walk truncated normal distribution (factory)

Description Usage Arguments Details Value

Description

This is a factory that creates a random walk normal distribution that adds some noise to the provided values, subject to an indicator constraint.

Usage

1
rtnorm_rw_fac(indicator, sd = 1, fraction = 0.97)

Arguments

indicator

an indicator function that takes a matrix and return a boolean vector, each element of which corresponds to a column of the input matrix, indicating its feasibility . (num mat -> bool vec)

sd

the "standard deviation" of the normal distribution at the first iteration, that is when k = 1. (num)

fraction

the percentage of "standard deviation" (relative to the previous iteration) left after each iteration. (num)

Details

This factory essentially creates a rejection sampler that samples from a truncated normal distribution.

This proposal is designed to decrease after each iteration. The default option is to decrese 3 percentage from the "standard deviation" at the previous iteration. The "standard deviation" mentioned in this section refers to the standard deviation of the untruncated normal random walk, not the actual standard deviation of the proposal distribution.

Value

a function that takes a matrix of current states (each column corresponds to a state) (num mat) and the current iteration count (num), and produces a matrix of proposed states (num mat).


weiyaw/blackbox documentation built on June 7, 2019, 5:12 a.m.