The advanced stochastic model is used widely in finance to analyze stock trend and price regulation. Here is an advanced stochastic model based on Markowitz portfolio theory.

Running Guide

The stocks data is based on 30 companies which have the highest market value. If you want to change the stocks set please adjust the stock codes in stocks excel form. Also the original time period setting in Python script is from 2010-01-01 to 2017-01-01 so please change the time setting in script if you want to analysis the data of different time period. Here is an sample output of the program:



Title: Advanced Stochastic Model

Data Source: Yahoo Finance

Development Language: Python3

Developer: Yangying Ren

Install Instruction

Please make sure that your computer has installed Python3. You will find two files after unzipping the document, a stocks excel form and a python file. Run the python file under Python development environment.

Return Distribution Histogram: 

To analyze the return of each market first we need to find out what kind of distribution model it belongs to. Histogram is a direct but imprecise way to estimate it. From the image we can figure out that most of companies' returns follow the normal distribution.

Q-Q plot

Q–Q (quantile-quantile) plot is a probability plot, which is a graphical method for comparing two probability distributions by plotting their quantiles against each other. Here we use Q-Q plot to estimate again whether the return data follows the normal distribution by comparing sample quantities with theoretical quantities.

Efficient-Frontier Line:

Each yellow point on the image represents a portfolio which has the highest return comparing with other portfolio with same risk. The line made by these points is efficient-frontier line. It represents the efficient part of risk-return spectrum. The star at the left below corner is the portfolio with the minimum risk which is also the tangent point of efficient-frontier line.

© 2019 by Yangying Ren. 

  • lofter_logo_edited
  • Twitter - Black Circle
  • LinkedIn - Black Circle