get_feasibles: Generate feasible states

Description Usage Arguments Details Value

Description

Generate feasible states by constantly adding random noises to supplied (non-feasible) states.

Usage

1
2
get_feasibles(theta, indicator, N = NCOL(theta), dist = rcauchy,
  dist_para = list(scale = 2))

Arguments

theta

a matrix with each column corresponding to an (unfeasible) state. (num mat)

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)

N

the number of feasible states.

dist

the distribution of the random noise. This must be a sampler such as rnorm, rcauchy and rt. (function)

dist.para

a list of parameters used in dist. (list)

Details

This is a rejection sampler that repeatedly adds noises to theta feasible states are attained (i.e. when indicator returns 1). If N < ncol(theta), N states will be randomly sampled from theta, whereas if N > ncol(theta), additional states will be sampled from theta to make up the number.

This function will terminate after 10000 of failed trials.

Value

a list consisting of a matrix of transitioned states, a vector of objective function values corresponding to the transitioned states, and the acceptance proportion (useful for diagnostic purpose).


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