Forecasting  NEPSE Index using Brownian Motion and Monte Carlo Simulation in Python

Forecasting NEPSE Index using Brownian Motion and Monte Carlo Simulation in Python

Forecasting the NEPSE Index, Nepal's benchmark stock market index using method derived from quantitative mathematics like Brownian Motion and Monte Carlo Simulation providing a quantitative framework to analyze and predict potential future movements in the index.

Brownian Motion models the random, continuous paths of price fluctuations, effectively capturing the volatility and randomness or uncertainity in financial markets. By incorporating historical data, this stochastic process can simulate the natural randomness in stock index changes over time.

Article content

Monte Carlo Simulation builds on this by generating numerous hypothetical price trajectories using the principles of Brownian Motion. By running thousands of iterations, it provides a comprehensive range of possible outcomes, enabling analysts to estimate probabilities and risk levels associated with specific price levels.


Article content


For the NEPSE Index, these tools are particularly valuable in managing investment portfolios, assessing risk, and aiding decision-making in an emerging market context. The combined use of these methods enhances the accuracy and depth of market analysis, supporting both strategic planning and operational forecasting.


To begin forecasting using Brownian Motion theory and Monte Carlo, we need to load the essential Python libraries. These libraries help with data manipulation, numerical computations, and visualization. Here's the code to load the required packages:

Article content

Then, load the data obtained NEPSE or any other website, we have used the NEPSE index data from 1997 to 2024 for the purpose of the analysis.

Article content

Now, Calculate the stock index returns using the simple captial apprication formula (p1-p0)/p0, which will be used as the historical data for the purpose of forecasting the index values.

Article content

Define the starting index value (S0), time horizon, number of trading days, and the number of simulation paths. Annualized return (mu) and volatility (sigma) are calculated from historical log returns.

Article content

Simulate multiple index trajectories using a stochastic process (Brownian motion). This generates possible future index paths based on historical trends and volatility.

Article content

Visualize the simulated paths to understand the range of possible outcomes over the specified time horizon.

Article content

The plot shows potential future trajectories of the NEPSE Index over a year, highlighting the expected growth with increasing uncertainty due to market volatility.

Article content

Analyze the results by calculating the expected value, standard deviation, and the probability of an increase in the index over the forecast horizon.

Article content


Article content

Major Insights for 2024 based on the forecasting :

  • Expected Index Value (1 year): The NEPSE Index is forecasted to have an average value of 156.58 after one year.
  • Standard Deviation of Index Value: The potential variation (volatility) around the expected value is 30.39, reflecting significant uncertainty.
  • Probability of Index Increase: There is only a 28.30% chance that the index will increase, indicating a bearish outlook based on the simulation.

To view or add a comment, sign in

More articles by Koshish Jung Lamichhane

Insights from the community

Others also viewed

Explore topics