Create synthetic market data for testing and simulation purposes. Useful when real market data is unavailable or for controlled experiments.
generate_synthetic_data(
n_days = 252,
n_assets = 1,
initial_price = 100,
annual_return = 0.08,
annual_volatility = 0.2,
correlation_matrix = NULL
)
Number of trading days to simulate
Number of assets to simulate
Initial price for all assets (default: 100)
Expected annual return (default: 0.08)
Annual volatility (default: 0.20)
Optional correlation matrix between assets
List with same structure as load_market_data()
if (FALSE) { # \dontrun{
synthetic_data <- generate_synthetic_data(n_days = 252, n_assets = 3)
plot(synthetic_data$prices[, 1], type = "l", main = "Synthetic Price Series")
} # }