Skip to content

TheHarshal30/Eclipse-Model

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Capital Asset Pricing Model (CAPM)

Python


Context

Portfolio optimization is nothing but a process where an investor receives the right guidance concerning the selection of assets from the range of other options, and in this theory, projects/programs are not valued on an individual basis; rather, the same is valued as a part of a particular portfolio.

What is Capital Asset Pricing ?

The capital asset pricing model (CAPM) is a mathematical model that seeks to explain the relationship between risk and return in a rational equilibrium market. Developed by academia, the CAPM has been employed in applications ranging from corporate capital budgeting to setting public utility rates.

Dataset

Here we use some of the NIFTY50 stocks closing prices from 1st Jan 2011 to 9th Nov 2022. This data is pulled from YAHOO FINANCE.

Methodology:

The goal of the CAPM formula is to evaluate whether a stock is fairly valued when its risk and the time value of money are compared to its expected return. Mathematically, we can define the CAPM formula as follows:



Conclusion:

50 years on from its introduction, CAPM is still one of the most widely studied and accepted pricing models but in that timespan, it has generated several critics. Its assumptions have been derided from the outset as unrealistic in real market conditions. Further studies have demonstrated that factors such as market size and company earnings levels provide an argument to add to the basic model’s formula or even ignore it altogether.

However, perhaps one reason why the model maintains its notoriety is its pure simplicity and the premise that it can work extremely well as an overall indicator of predicted returns if the stock has a high association of returns relative to the market return indicator being used. Only time will tell how long its validity will last.

User Guide:

For addinng more stocks in model go to YAHOO FINANCE and choose the stock you want to add and add its name in the stocks list in main.ipynb. After that in "porfolio_weights" change the number of stocks from 4 to the number of stocks you have added.

References:

https://www.investopedia.com
https://www.analystprep.com
https://www.corporatefinanceinstitute.com
https://www.mlq.ai

Support

⭐ Please Star and share the project. Thanks! ❤️

About

Implementing Capital Asset Pricing Model (CAPM) in python for NIFTY50

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published