R/simulations_models.R
generate_synthetic_returns.Rd
This function simulates returns based on a Heston-style stochastic volatility process, optionally incorporating jumps (with configurable distributions), microstructure noise, and regime switching via a Markov chain.
generate_synthetic_returns(
n_days = 252 * 10,
mu = 2e-04,
kappa = 0.05,
theta = 1e-04,
sigma_v = 0.01,
rho = -0.7,
lambda_jump = 0.05,
jump_size_dist = "normal",
sigma_jump = 0.02,
noise_dist = "normal",
noise_scale = 5e-04,
noise_df = 5,
regime_params = NULL,
random_seed = NULL
)
Number of trading days to simulate (default: 252 * 10).
Drift (mean return) per time step.
Mean-reversion speed of the variance process.
Long-run average variance.
Volatility of volatility (vol of variance process).
Correlation between volatility and returns (leverage effect).
Jump intensity (expected jumps per day).
Distribution of jump sizes ("normal", "log_normal", or "exponential").
Scale parameter for jump size distribution.
Type of microstructure noise ("normal" or "student_t").
Standard deviation (or scale) of added microstructure noise.
Degrees of freedom for Student-t noise (if used).
List specifying regime switching behavior. Includes a transition matrix, and multipliers for `theta` and `kappa` during high-volatility regimes.
Optional random seed for reproducibility.
A `data.table` with columns: `date`, `returns`, `variance`, `volatility`, `regime`.