BPSStudentT {RZigZag} | R Documentation |
BPSStudentT
Description
Applies the Zig-Zag Sampler to a Student T distribution (IID or spherically symmetric)
Usage
BPSStudentT(dof, dim = 1L, n_iter = -1L, finalTime = -1,
x0 = numeric(0), v0 = numeric(0), sphericallySymmetric = TRUE,
refresh_rate = 1, unit_velocity = FALSE)
Arguments
dof |
scalar indicating degrees of freedom |
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 |
x0 |
starting point (optional, if not specified taken to be the origin) |
v0 |
starting direction (optional, if not specified taken to be a random vector) |
sphericallySymmetric |
boolean. If false, sample iid Student T distribution, if true (default) sample spherically summetric Student t dsitribution. |
refresh_rate |
|
unit_velocity |
TRUE indicates velocities uniform on unit sphere, FALSE (default) indicates standard normal velocities |
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
dim = 2
dof = 4
result <- BPSStudentT(dof, dim, n_iter=1000,sphericallySymmetric = TRUE)
plot(result$Positions[1,], result$Positions[2,],type='l',asp=1)