gensamplepathnts: gensamplepathnts

View source: R/distNTS.R

gensamplepathntsR Documentation

gensamplepathnts

Description

gensamplepathnts generate sample paths of the NTS process with parameters (\alpha, \theta, \beta, \gamma, \mu). If only three parameters are given, it generate sample paths of the standard NTS process with parameters (\alpha, \theta, \beta).

Usage

gensamplepathnts(npath, ntimestep, ntsparam, dt)

Arguments

npath

Number of sample paths

ntimestep

number of time step

ntsparam

A vector of the NTS parameters (\alpha, \theta, \beta, \gamma, \mu). A vector of the standard NTS parameters (\alpha, \theta, \beta).

dt

the time length of one time step by the year fraction. "dt=1" means 1-year.

Value

Structure of the sample path. Matrix of sample path. Column index is time.

Examples

library("temStaR")
#standard NTS process sample path
alpha <- 1.2
theta <- 1
beta <- -0.2
ntsparam <- c(alpha, theta, beta)
npath <- 5
ntimestep <- 250
dt <- 1/250
simulation <- gensamplepathnts(npath, ntimestep, ntsparam, dt)
matplot(colnames(simulation), t(simulation), type = 'l')

#NTS process sample path
alpha <- 1.2
theta <- 1
beta <- -0.2
gamma <- 0.3
mu <- 0.1
ntsparam <- c(alpha, theta, beta, gamma, mu)
npath <- 5
ntimestep <- 250
dt <- 1/250
simulation <- gensamplepathnts(npath, ntimestep, ntsparam, dt)
matplot(colnames(simulation), t(simulation), type = 'l')


aaron9011/temStaR-v0.90 documentation built on June 1, 2025, 4:15 p.m.