SimEquityRSLN: Regime Switching LogNormal Equity Return Model

Description Usage Arguments Value Examples

View source: R/sim-equity.R

Description

Simulate monthly equity returns from a 2-state RSLN model

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
SimEquityRSLN(
  n = 1,
  pswitch = c(0.011, 0.059),
  means = c(0.008, -0.011),
  vols = c(0.039, 0.113),
  t = 12,
  state0 = c(0, 1),
  mean_uncond = 0,
  z_rand = NULL,
  type = c("arithmetic", "log"),
  .detail = FALSE
)

Arguments

n

number of simulated trials

pswitch

vector of length two with transition probabilities for each state

means

vector of length two with monthly mean returns conditional on state (added to optional unconditional mean)

vols

vector of length two with monthly volatility conditional on state

t

number of future monthly timesteps

state0

Optional intial state. If unchanged will simulate from unconditional state probabilities

mean_uncond

Optional vector of length (n * t) additional ANNUAL return unconditional on state (e.g. real return + inflation)

z_rand

Optional normal standard deviate vector of length (n * t)

type

type of output returns: arithmetic (discrete) or log (continuous)

.detail

Include additional detail state, mean, volatility

Value

data in the form of a tibble object with columns trial, time, mo_return, cum_return, accum

Examples

1
SimEquityRSLN(n=10, pswitch=c(.011, .059), means=c(.008, -.011), vols = c(.039, .113))

ZScore314/ESG documentation built on Feb. 11, 2022, 12:15 a.m.