Skip to content

Instantly share code, notes, and snippets.

@kikoso
Created April 12, 2025 07:48
Show Gist options
  • Save kikoso/cfecbc8c171f7649732bde16f75bcc40 to your computer and use it in GitHub Desktop.
Save kikoso/cfecbc8c171f7649732bde16f75bcc40 to your computer and use it in GitHub Desktop.
Portfolio Simulation using the same Seed
val rng1 = Random(123)
val rng2 = Random(123)
val accumulatedResults = (1..simulations).map {
val accumulatedReturnsA = simulatePortfolioAccumulatedReturns(portfolioA, rng1)
val accumulatedReturnsB = simulatePortfolioAccumulatedReturns(portfolioB, rng2)
SimulationResult(it, accumulatedReturnsA, accumulatedReturnsB)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment