Learn R Programming

BIPOD (version 0.2.1)

BBSim: Function for simulation of p dimensional Brownian bridge

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

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

Value

An n*p matrix

Details

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

Examples

Run this code
(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")

Run the code above in your browser using DataLab