Description Usage Arguments Value Examples
gensamplepathnts
generate sample paths
of the NTS process with parameters (α, θ, β, γ, μ).
If only three parameters are given, it generate sample paths
of the standard NTS process with parameters (α, θ, β).
1 | gensamplepathnts(npath, ntimestep, ntsparam, dt)
|
npath |
Number of sample paths |
ntimestep |
number of time step |
ntsparam |
A vector of the NTS parameters (α, θ, β, γ, μ). A vector of the standard NTS parameters (α, θ, β). |
dt |
the time length of one time step by the year fraction. "dt=1" means 1-year. |
Structure of the sample path. Matrix of sample path. Column index is time.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | 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')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.