Description Usage Arguments Value Examples
Simulate monthly equity returns from a 2-state RSLN model
1 2 3 4 5 6 7 8 9 10 11 12 |
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 |
data in the form of a tibble
object with columns trial, time, mo_return, cum_return, accum
1 | SimEquityRSLN(n=10, pswitch=c(.011, .059), means=c(.008, -.011), vols = c(.039, .113))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.