ZigZagIIDGaussian: ZigZagIIDGaussian

Description Usage Arguments Value Examples

View source: R/RcppExports.R

Description

Applies the Zig-Zag Sampler to a IID Gaussian distribution

Usage

1
2
ZigZagIIDGaussian(variance, dim = 1L, n_iter = -1L, finalTime = -1,
  x0 = numeric(0), v0 = numeric(0))

Arguments

variance

scalar indicating variance

dim

dimension

n_iter

Number of algorithm iterations; will result in the equivalent amount of skeleton points in Gaussian case because no rejections are needed.

finalTime

If provided and nonnegative, run the sampler until a trajectory of continuous time length finalTime is obtained (ignoring the value of n_iterations)

x0

starting point (optional, if not specified taken to be the origin)

v0

starting direction (optional, if not specified taken to be +1 in every component)

Value

Returns a list with the following objects:

Times: Vector of switching times

Positions: Matrix whose columns are locations of switches. The number of columns is identical to the length of skeletonTimes. Be aware that the skeleton points themselves are NOT samples from the target distribution.

Velocities: Matrix whose columns are velocities just after switches. The number of columns is identical to the length of skeletonTimes.

Examples

1
2
result <- ZigZagIIDGaussian(1, 2, 1000)
plot(result$Positions[2,], result$Positions[1,],type='l',asp=1)

RZigZag documentation built on July 20, 2019, 9:03 a.m.