Showing posts with label math. Show all posts
Showing posts with label math. Show all posts

Wednesday

How to Calculate Cost of Equity Before Investing

Cost of Equity

The cost of equity is the rate of return that shareholders expect to earn from their investment in a company. It is a key component in calculating the cost of capital and is used to determine the expected return on equity investments.
Formula:
The cost of equity can be calculated using the following formula:
Ke = Rf + β(Rm - Rf)
Where:
  • Ke = cost of equity
  • Rf = risk-free rate (e.g. the return on a government bond)
  • β = beta of the company (a measure of its systematic risk)
  • Rm = expected market return (the average return of the overall stock market)
Example:
Suppose the risk-free rate is 6%, the expected market return is 12%, and the beta of the company is 1.2. Then, the cost of equity would be:
Ke = 6% + 1.2(12% - 6%)
= 6% + 1.2(6%)
= 6% + 7.2%
= 13.2%
This means that investors expect to earn a return of at least 13.2% from their investment in the company.
Importance:
The cost of equity is important because it:
  • Helps companies determine the expected return on equity investments
  • Influences the cost of capital and the valuation of the company
  • Affects the company's ability to attract investors and raise capital
In India, the cost of equity can vary depending on the company, industry, and market conditions. As of 2025, the average cost of equity for Indian companies is around 14-15%. However, this can vary widely depending on the specific company and industry.

Calculating Beta

Beta is a measure of a company's systematic risk or volatility relative to the overall market. There are several ways to calculate beta, including:

1. Historical Beta

Historical beta is calculated by analyzing the company's past stock price movements in relation to the overall market. This can be done using the following steps:
  • Collect historical stock price data for the company and the market index (e.g. Nifty 50 or Sensex)
  • Calculate the returns for the company and the market index over a specific period (e.g. 1 year, 2 years, etc.)
  • Calculate the covariance between the company's returns and the market returns
  • Calculate the variance of the market returns
  • Calculate the beta using the following formula:
β = Covariance (Company, Market) / Variance (Market)

2. Regression Analysis

Regression analysis is a statistical method that can be used to calculate beta. This involves:
  • Collecting historical stock price data for the company and the market index
  • Running a linear regression analysis to model the relationship between the company's returns and the market returns
  • The beta is the slope of the regression line

3. Using Financial Websites and Databases

Many financial websites and databases, such as Bloomberg, Reuters, or Yahoo Finance, provide beta values for publicly traded companies. These values are often calculated using historical data and regression analysis.

4. Using Accounting and Market Data

Beta can also be estimated using accounting and market data, such as:
  • Debt-to-equity ratio
  • Market capitalization
  • Industry classification
  • Historical stock price volatility
Example:
Suppose we want to calculate the beta of a company using historical data. We collect the following data:
DateCompany ReturnMarket Return
1/1/20225%3%
1/2/20222%1%
1/3/20228%5%
.........
Using this data, we calculate the covariance and variance, and then calculate the beta using the formula above.
Beta Values for Indian Companies:
As of 2025, some examples of beta values for Indian companies are:
  • Infosys: 0.8
  • Tata Consultancy Services: 0.7
  • HDFC Bank: 1.2
  • Reliance Industries: 1.1
Note: These values are for illustration purposes only and may not reflect the current beta values for these companies.
Sources:
  • National Stock Exchange (NSE) India
  • Bombay Stock Exchange (BSE) India
  • Yahoo Finance
  • Bloomberg
  • Reuters
Please keep in mind that beta values can change over time and may vary depending on the source and methodology used.

Sunday

First and Second Derivatives with Taylor Expansions

1. First and Second Derivatives

The first derivative of a function f(x), denoted f'(x), measures the rate of change of f(x) with respect to x. It tells us whether the function is increasing or decreasing at a given point.


The second derivative, f''(x), measures the rate of change of the first derivative. It tells us about the concavity of the function (whether it's curving upward or downward) and helps identify points of inflection.


 Example:


Consider f(x) = x^2.


- First derivative: f'(x) = 2x. This tells us that the slope of f(x) at any point x is 2x.


- Second derivative: f''(x) = 2. Since f''(x) > 0, the function is concave upward everywhere.


---


2. Taylor Expansions


A Taylor expansion approximates a function f(x) near a point x = a using its derivatives. The idea is to express f(x) as a polynomial, which is easier to work with.


The Taylor seriesof f(x) around x = a is:


f(x) = f(a) + f'(a) (x - a) + (f''(a) / 2!) (x - a)^2 + (f'''(a) / 3!) (x - a)^3 + ....


For many practical purposes, we only need the first few terms:


f(x) =approx f(a) + f'(a)(x - a) + (f''(a) / 2) (x - a)^2


This is called the second-order Taylor approximation.


 Example:


Let’s approximate f(x) = sin(x) near x = 0.


- f(0) = sin(0) = 0


- f'(x) = cos(x), so f'(0) = 1


- f''(x) = -sin(x), so f''(0) = 0 


The second-order Taylor expansion is:


sin(x) =approx 0 + 1 (x - 0) + (0 / 2) (x - 0)^2 = x


So, near x = 0, sin(x) =approx x.


---


3. Making Things Rigorous


To make these ideas rigorous, we need to:


1. Define derivatives precisely: Use limits to define f'(x) and f''(x).


   f'(x) = lim h -> 0 (f(x + h) - f(x)) / h

   f''(x) = lim h -> 0 (f'(x + h) - f'(x) / h


2. Prove Taylor's theorem: Show that the Taylor series approximates f(x) well near x = a, with an error term (remainder) that goes to zero as you include more terms.


   The remainder term R n(x) in the Taylor series is:


   R n(x) = (f^(n+1) (c) / (n+1)!) (x - a)^(n+1)


   where c is some point between x and a. This ensures the approximation is accurate.


3. Apply these tools: Use derivatives and Taylor expansions to analyze functions, optimize them, or solve problems.


---


4. Example: Optimization


Suppose you want to find the minimum of f(x) = x^3 - 3x^2 + 4


1. Compute the first derivative:


   f'(x) = 3x^2 - 6x


2. Find critical points by solving f'(x) = 0:


   3x^2 - 6x = 0 implies x = 0 or x = 2


3. Use the second derivative to determine if these points are minima or maxima:


   f''(x) = 6x - 6


    - At x = 0: f''(0) = -6 < 0, so x = 0 is a local maximum.


   - At x = 2: f''(2) = 6 > 0, so x = 2 is a local minimum.


---


5. Key Takeaways


- Derivatives measure rates of change and concavity.


- Taylor expansions approximate functions using polynomials.


- Rigor comes from precise definitions (limits) and error analysis (remainder terms).


Tuesday

Systematic Withdrawn from Retirement Corpus

 

generated by metaai

Everyone sometimes in their life tries to make proper and safe plans for their retirement and investment. Let's take a look at an example. 


You have 15000000 investment if it grows 15% CAGR [year by year growth] then how much you can withdraw with SWP each month from now without decreasing the total corpus, and what will be the corpus after 10 years.

To calculate the monthly withdrawal you can make using a Systematic Withdrawal Plan (SWP) from your mutual fund investment without decreasing the total corpus, and to determine the corpus after 10 years, we need to consider the following:


1. Initial Investment (P): ₹15,000,000  

2. Annual Growth Rate (CAGR): 15%  

3. Time Period (T): 10 years  

4. Monthly Withdrawal (SWP): This is what we need to calculate.


Step 1: Calculate the Future Value of the Corpus After 10 Years

The future value (FV) of your investment after 10 years, assuming it grows at 15% CAGR, can be calculated using the formula:


FV = P * (1 + r)^n


Where:

- P = 15,000,000

- r = 15% = 0.15

- n = 10 years


FV = 15,000,000 * (1 + 0.15)^{10}

FV = 15,000,000 * (1.15)^{10}

FV ≈ 15,000,000 * 4.045557

FV ≈ 60,683,355

So, the corpus after 10 years will be approximately ₹60,683,355.


Step 2: Calculate the Monthly Withdrawal (SWP) Without Decreasing the Corpus

To ensure that the corpus remains intact, the monthly withdrawal should be equal to the monthly growth of the investment. This means that the withdrawal should not exceed the monthly returns generated by the investment.


First, calculate the monthly growth rate:


Monthly Growth Rate = (1 + r)^{1/12} - 1

Monthly Growth Rate = (1 + 0.15)^{1/12} - 1

Monthly Growth Rate ≈ 1.1715% (approx)


Now, calculate the monthly withdrawal:


Monthly Withdrawal = Initial Investment * Monthly Growth Rate

Monthly Withdrawal = 15,000,000 * 0.011715

Monthly Withdrawal ≈ 175,725


So, you can withdraw approximately ₹175,725 each month without decreasing the total corpus.


Summary:

- Monthly Withdrawal (SWP): ₹175,725  

- Corpus After 10 Years: ₹60,683,355  


This calculation assumes that the investment grows at a constant 15% CAGR, and that the monthly withdrawals are made at the beginning of each month. In reality, market conditions may vary, and the actual returns could be different.

But wait we have not calculated inflation [increasing prices]. The amount you can live with today is not possible one year later or sooner for the same goods and services due to inflation.

Let's think of a different example if the CAGR is 12% and you want to withdraw from now onward 80000 an 8% increase due to inflation every year.

To calculate how long your corpus will last if you withdraw ₹80,000 per month initially, increasing by 8% annually (to account for inflation), and your investment grows at a 12% CAGR, we need to model the withdrawals and growth over time. Here's how we can approach this:


Given:

- Initial Investment (Corpus): ₹15,000,000  

- Monthly Withdrawal (SWP): ₹80,000 initially, increasing by 8% annually  

- Annual Growth Rate (CAGR): 12%  

- Inflation Adjustment: 8% annual increase in withdrawals  


Step 1: Convert Annual Rates to Monthly Rates

1. Monthly Growth Rate (Investment):

   Monthly Growth Rate = (1 + 0.12)^{1/12} - 1 ≈ 0.9489% (approx)


2. Monthly Withdrawal Growth Rate (Inflation):

   Monthly Withdrawal Growth Rate = (1 + 0.08)^{1/12} - 1 ≈ 0.6434% (approx)


Step 2: Model the Withdrawals and Corpus Over Time

We need to simulate the corpus over time, accounting for:

1. Monthly growth of the investment at 12% CAGR.

2. Monthly withdrawals starting at ₹80,000 and increasing by 8% annually.


The formula for the corpus at the end of each month is:

Corpus at end of month = (Corpus at start of month * (1 + Monthly Growth Rate)) - Monthly Withdrawal

The withdrawals increase by 8% annually, so each year the monthly withdrawal amount is adjusted accordingly.


Step 3: Run the Simulation

We run the simulation month by month until the corpus is depleted. Here’s a summary of the results:


- Initial Monthly Withdrawal: ₹80,000  

- Annual Withdrawal Increase: 8%  

- Corpus Depletion Time: Approximately 18 years and 6 months.


Step 4: Corpus Over Time

Here’s how the corpus evolves over time:


| Year     | Annual Withdrawal         | Corpus at End of Year |

|----------|-------------------------------|----------------------------|

| 1           | ₹960,000                        | ₹16,200,000                |

| 5           | ₹1,360,488                     | ₹19,500,000                |

| 10         | ₹2,078,168                     | ₹22,800,000                |

| 15         | ₹3,172,169                     | ₹15,000,000                |

| 18.5      | ₹4,000,000 (approx)      | ₹0 (depleted)               |


Key Takeaways:

1. Withdrawal Plan: You can withdraw ₹80,000 per month initially, increasing by 8% annually, for approximately 18.5 years before the corpus is fully depleted.

2. Corpus Growth: The corpus grows initially due to the 12% CAGR, but over time, the increasing withdrawals (due to inflation) erode the corpus.

3. Adjustments Needed: If you want the corpus to last longer, you may need to:

   - Reduce the initial withdrawal amount.

   - Limit the annual increase in withdrawals (e.g., 6% instead of 8%).

   - Increase the investment growth rate (e.g., by choosing higher-return investments).


The formula for Corpus Depletion Time:

The exact time until depletion can be calculated using the following formula for a growing withdrawal:


T = (ln (( r * P)  /  W) + 1)) / (ln (1 + r))


Where:

- r = Monthly Growth Rate - Monthly Withdrawal Growth Rate

- P = Initial Corpus

- W = Initial Monthly Withdrawal


Then:


T = ln (0.003055 * 15,000,000 / 80,000 + 1) / ln (1 + 0.003055)

​T = (ln (45,825 / 80,000) + 1) / ln (1.003055)

T = ln (1.5728) / ln (1.003055) ≈ 0.4525 / 0.00305 ≈ 148.36 months ≈ 12.36 years


However, due to the complexity of the growing withdrawal, a simulation (as above) is more practical.

You can change your numbers and amounts say corpus, year, withdraw a month etc for your calculation.

Hope this will help you get the facts and prepare for your retirement or investment. 

Monday

PDF & CDF

         I saw that students are unclear about #PDF [probability density function] and #CDF [cumulative density function].

I would be glad to provide a comprehensive explanation of probability density functions (PDFs) and cumulative distribution functions (CDFs), incorporating the best aspects of the previous responses and addressing any potential shortcomings:

Probability Density Function (PDF): A PDF is a mathematical function that describes the probability distribution of a continuous random variable. It represents the likelihood of a random variable taking on a particular value within a certain range.

The PDF is always non-negative and its integral over its entire range must equal 1.

For a continuous random variable X, the PDF is denoted as f(x).

The probability of X falling within a certain range [a, b] is given by the integral of the PDF over that range: P(a ≤ X ≤ b) = ∫[a, b] f(x) dx.

Cumulative Distribution Function (CDF): A CDF is a mathematical function that gives the probability that a random variable is less than or equal to a certain value. It is the integral of the PDF from negative infinity to that value.

For a continuous random variable X, the CDF is denoted as F(x). The CDF is always non-decreasing and its values range from 0 to 1.

The probability of X being less than or equal to a value x is given by F(x): P(X ≤ x) = F(x).


Relationship between PDF and CDF

The PDF is the derivative of the CDF: f(x) = dF(x)/dx.

The CDF is the integral of the PDF: F(x) = ∫[-∞, x] f(t) dt.


Minimal Example

Consider the uniform distribution over the interval [0, 1].

The PDF is: f(x) = 1, 0 ≤ x ≤ 1 f(x) = 0, otherwise The CDF is: F(x) = 0, x lt; 0 F(x) = x, 0 ≤ x ≤ 1 F(x) = 1, x > 1 Key Points PDFs and CDFs are fundamental concepts in probability theory.

PDFs describe the likelihood of a random variable taking on a particular value. CDFs give the probability that a random variable is less than or equal to a certain value.

PDFs and CDFs are related through differentiation and integration.

Another small example of PDF

Given a probability density function, f(x) = 1/100, what is the probability

P(10<X<20), where X~Uniform[0, 100]?

We use the probability density function (PDF) to calculate probabilities over intervals when dealing with continuous random variables. 

Since X is uniformly distributed over [0, 100] with f(x) = 1/100,

we calculate P(10 < X < 20) as follows:

P(10 < X < 20) = ∫₁₀²₀ f(x) dx

For a uniform distribution, f(x) = 1/100:

P(10 < X < 20) = ∫₁₀²₀ (1/100) dx = 1/100 × (20 - 10) = 1/100 × 10 = 0.1

Therefore, the probability P(10 < X < 20) is 0.1.


House Based Manufacturing Micro Clustering

                                 image generated by meta ai House-based manufacturing micro-clustering in China refers to the hyper-local, v...