univariate_sampler: Create a univariate distribution sampler

Description Usage Arguments Details Value

Description

Generate a function which generates samples from the distribution given the inverse and collocation points.

Usage

1
2
3
4
univariate_sampler(inverse_cdf, col_pts, xdist = "norm", gss = 1,
  transform = identity, inv_transform = identity)

conditional_sampler(inverse_cdf, col_pts, gss = 1)

Arguments

inverse_cdf

The inverse cdf (i.e. quantile) function of the distribution to be sampled.

col_pts

The collocation points to use for interpolation (usually generated by scmc::optimal_points()).

xdist

A string indicating the distribution of the cheap variable X ni the method. Should be a <name> for which functions "p<name>" and "r<name>" exist (like "norm" or "unif")

gss

The sigma value of the approximating normal variable if using grid stretching.

transform

A function to apply to the inverse_cdf before interpolation.

inv_transform

A function to apply to the sample after interpolating. Should be the inverse function of the transform argument

Details

The univariate_sampler function is used for generating unconditional distributions using SCMC with 1-D interpolation, whereas the conditional_sampler enables generating samples from random varaibles which are conditioned on other variables. The inverse_cdf function in the conditional case must take k+1 arguments, where k is the number of conditions, and return the inverse cdf for the variable Y|X_1, ..., X_k, taking the arguments in order: (X_1, ..., X_k, p), where p is from (0,1). For example, if we sample Y|X, we have a function invcdf(x, p) = F^{-1}_{Y|X=x}(p).

For univariate_sampler, col_pts should be a vector of nodes. For the conditional_sampler, col_pts should be a list of vectors containing the node points for each dimension.

Value


Blaza/scmc documentation built on May 29, 2019, 6:41 a.m.