Skip to content
View Swastikmitra34's full-sized avatar
🎯
Focusing
🎯
Focusing

Block or report Swastikmitra34

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Please don't include any personal information such as legal names or email addresses. Maximum 100 characters, markdown supported. This note will be visible to only you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
Swastikmitra34/README.md

Hi there 👋

Profile

Swastik Mitra - Quantitative Analyst/Mathematician

Welcome to my GitHub profile! Here you'll find my projects and contributions related to quantitative analysis, artificial intelligence and actuarial science.

Black-Scholes Equation

The Black-Scholes partial differential equation is:

$$ \frac{\partial V}{\partial t} + \frac{1}{2} \sigma^2 S^2 \frac{\partial^2 V}{\partial S^2} + r S \frac{\partial V}{\partial S} - r V = 0 $$

Animated Welcome

And the solution for a European call option price c(s,t) is given by:

$$ C(S, t) = S_0 \Phi(d_1) - K e^{-r(T-t)} \Phi(d_2) $$

where

$$ d_1 = \frac{\ln\left(\frac{S_0}{K}\right) + \left(r + \frac{\sigma^2}{2}\right)(T-t)}{\sigma \sqrt{T-t}} $$

and

$$ d_2 = d_1 - \sigma \sqrt{T-t} $$

JavaScript Scikit-learn Python TensorFlow Scikit-learn R C C++ numpy Pandas SciPy Matplotlib IoT OpenCV Jupyter PyTorch

Visitor Count

GitHub Stats

[Financial Risk Model]

A model to assess financial risk using Python.

def create_life_table(age_data, mortality_rates):
    """
    Create a basic life table from age data and mortality rates.

    :param age_data: List of ages
    :param mortality_rates: List of mortality rates corresponding to each age
    :return: DataFrame containing the life table
    """
    # Create an empty DataFrame
    life_table = pd.DataFrame({'Age': age_data, 'Mortality Rate': mortality_rates})
    
    # Calculate qx (probability of death between age x and x+1)
    life_table['qx'] = life_table['Mortality Rate'].apply(lambda x: x / (1 + x))
    
    # Calculate lx (number of people alive at the beginning of each age x)
    life_table['lx'] = 100000  # Assuming an initial population of 100,000
    life_table['lx'] = life_table['lx'].shift(1) * (1 - life_table['qx'])
    life_table['lx'] = life_table['lx'].fillna(100000)
    
    # Calculate tx (total number of person-years lived from age x onward)
    life_table['tx'] = life_table['lx'].cumsum()
    
    # Calculate ex (life expectancy at age x)
    life_table['ex'] = life_table['tx'] / life_table['lx']
    
    return life_table

# Example data
ages = list(range(0, 101))  # Ages from 0 to 100
mortality_rates = [0.01] * 100 + [0.02]  # Example constant mortality rates

# Create life table
life_table_df = create_life_table(ages, mortality_rates)
print(life_table_df.head())

Popular repositories Loading

  1. my-favourite-PDFs- my-favourite-PDFs- Public

    access to my favourite math books

    1

  2. swastikmitra.github.io swastikmitra.github.io Public

    HTML 1

  3. godelomniverse godelomniverse Public

    HTML 1

  4. Swastikmitra34 Swastikmitra34 Public

  5. -swastik-.github.io -swastik-.github.io Public