BBSim: Function for simulation of p dimensional Brownian bridge

Description Usage Arguments Details Value Examples

View source: R/BBSim.r

Description

Simulation of p-dimensional driftless SDE with constant diffusion, conditional on end points: dV_t=Sigma dW_t, conditional on V_0 and V_T. This function makes a call to C++ and it is therefore relatively fast.

Usage

1
BBSim(start, end, n, Sigma=diag(2), T, t0 = 0,seed = 1)

Arguments

start

Numerical vector of length p: Starting point for the process

end

Numerical vector of length p: Ending point for the process

n

Positive integer: Number of time points where the process is simulated

Sigma

p*p matrix: The diffusion matrix for the process

T

Positive number: End of time interval.

t0

Non negative number, defaults to 0. Start of time interval.

seed

Integer, defaults to 1. Specifies seed for random generator. If <=0 it is set randomly.

Details

An n*p matrix with columns representing simulations for each coordinate.

Value

An n*p matrix

Examples

1
2
3
4
5
6
7
8
(tmp <- BBSim(start = c(1,2),
              end   = c(3,5),
              n     = 10,
              Sigma = diag(2),
              T     = 2,
              t0    = 0,
              seed  = 1))
matplot(tmp,type="l")

BIPOD documentation built on May 29, 2017, 10:07 a.m.