19
$\begingroup$

One question and AI-generated response per answer. Community wiki flag and an explanation of why the AI response is wrong are encouraged. The AI program can optionally be identified. Including the date that the answer was provided by the AI will be useful as well, as AI models typically improve over time

This is likely to be useful and educational - not just entertaining.

$\endgroup$
3
  • 3
    $\begingroup$ Pretty cool question! $\endgroup$ Commented Sep 26, 2023 at 18:10
  • 2
    $\begingroup$ I see that all of the answers that specify a model mention ChatGPT version 3.5. I understand the desire not to give money to the so-called OpenAI, but since they claim that version 4.0 has better "creativity and advanced reasoning," and there seems to be some degree of truth to that hyperbolic assertion, perhaps it would be good to have some from that model as well. Surely only one person needs to pay to test whether the answers change between models, right? $\endgroup$ Commented Sep 27, 2023 at 10:48
  • 1
    $\begingroup$ Can ChatGPT Pass The CFA Exam? AI Researchers Tried To Find Out $\endgroup$ Commented Nov 5, 2023 at 15:22

16 Answers 16

15
$\begingroup$

Question: "How do you convert annual yield quote to semi-annual?"

Wrong answer:

To convert an annual yield quote to semi-annual, you simply divide the annual yield by two. This is because semi-annual yields are calculated based on two compounding periods per year.

For example, if a bond has an annual yield of 5%, then its semi-annual yield would be 2.5%:

Semi-annual yield = Annual yield / 2

Semi-annual yield = 5% / 2

Semi-annual yield = 2.5%

It is important to note that converting annual yield quotes to semi-annual does not change the underlying yield of the bond. It simply makes it easier to compare yields on bonds with different coupon frequencies and to other fixed-income securities.

Correct answer:

In general, if $f_1$ and $f_2$ are frequencies (1 - annual, 2 - semiannual, 4 - quarterly, 12 - monthly...), and $y_{f_1}$ and $y_{f_2}$ denote the yields corresponding to these frequencies, then ${\left(1+\frac{y_{f_1}}{f_1}\right)}^{f_1}={\left(1+\frac{y_{f_2}}{f_2}\right)}^{f_2}$, so $y_{f_2} = \left(\left(1+\frac{y_{f_1}}{f_1} \right)^{\frac{f_1}{f_2}} -1 \right)\times {f_2} $.

In this concrete case, $f_1=1$, $f_2=2$, $y_2 = \left(\left(1+y_1 \right)^{\frac{1}{2}} -1 \right)\times {2}.$

$\endgroup$
3
  • $\begingroup$ i think it will give you the correct answer if you add "assuming compounding" at the end of your original question $\endgroup$ Commented Sep 26, 2023 at 8:09
  • 1
    $\begingroup$ Although the question, as currently written, doesn't require it, I think specifying the AI engine that was used to generate the answer (and on what date) will greatly increase the answer's usefulness and longevity. $\endgroup$ Commented Sep 26, 2023 at 8:59
  • 2
    $\begingroup$ thanks. It's clear to a human reader, but apparently not to the AI, that semi-annual refers to the compounding frequency. $\endgroup$ Commented Sep 26, 2023 at 15:54
10
$\begingroup$

A classic:

Does Modern Portfolio Theory as proposed by Markowitz assume normality of returns?

ChatGPT:

Yes, Modern Portfolio Theory (MPT) as proposed by Markowitz does assume normality of returns. It assumes that the returns of individual assets are normally distributed, which means that they follow a bell-shaped curve. This assumption allows for the calculation of expected returns and risk measures such as variance and standard deviation, which are central to MPT's optimization process of constructing efficient portfolios. However, it is important to note that in practice, asset returns often do not strictly follow a normal distribution, and this assumption is one of the limitations of MPT.

The foundational 1952 paper does not mention "normality" or "gaussianity" anywhere and indeed the whole theory remains valid as long as second moment ($\Sigma$) exists.

$\endgroup$
1
  • 6
    $\begingroup$ This one makes "sense" since I've heard so many humans (and likely writing humans) erroneously mention it when discussing MPT $\endgroup$ Commented Sep 27, 2023 at 4:57
5
$\begingroup$

Question:

Can a portfolio that is efficient (meaning that it lies on the Capital Market Line) be undervalued (i.e. having a positive alpha)?

Answer by ChatGPT:

ChatGPT

Yes, it is possible for a portfolio that lies on the Capital Market Line (CML), also known as the efficient frontier, to be undervalued, meaning it has a positive alpha. Let's break down how this can occur:

Efficient Portfolio on the CML: An efficient portfolio on the CML is constructed using a combination of risky assets (typically stocks) 

and a risk-free asset (such as government bonds). This portfolio represents the optimal trade-off between risk and return given the available set of assets. In other words, it has the highest expected return for a given level of risk (standard deviation).

Alpha: Alpha measures the excess return of a portfolio or investment compared to its expected return, given its level of risk. A 

positive alpha indicates that the portfolio has outperformed its expected return, while a negative alpha suggests underperformance.

Now, here's how a portfolio on the CML can have a positive alpha:

The CML is constructed based on historical data, expected returns, and risk measurements. It represents a theoretical benchmark that 

assumes markets are perfectly efficient and asset prices reflect all available information.

Real-world conditions often deviate from the idealized assumptions of market efficiency. Factors such as market sentiment, behavioral 

biases, or temporary mispricing of assets can lead to opportunities for skilled investors to generate returns that exceed what the CML would predict.

Skilled portfolio managers, through active management or exploiting market inefficiencies, can construct portfolios that 

perform better than the CML's predictions. This outperformance, if sustained, results in a positive alpha.

However, it's important to note that generating a positive alpha is not easy and typically requires expertise, research, and the 

ability to identify mispriced assets or market inefficiencies.

In summary, while the Capital Market Line represents the efficient frontier of portfolios based on market data and expectations, real-world conditions and investor skill can lead to portfolios that outperform this benchmark, resulting in a positive alpha. Positive alpha suggests that the portfolio has added value beyond what would be expected based on its risk and the theoretical CML.

This is definitely not correct. An efficient portfolio that lies on the Capital Market Line must have zero alpha (and be in equilibrium). The opposite is not true.

$\endgroup$
4
$\begingroup$

True or false. A mean-variance investor, when deciding between multiple portfolios to add to an already well diversified portfolio, should pick the portfolio with the highest sharpe ratio.

This is false. It should be the one with the highest appraisal ratio. AI always says it's true.

Edit: @Dimitri just tried, answer below:

"Should a mean-variance investor deciding between multiple portfolios to add to an already well diversified portfolio pick the portfolio with the highest Sharpe ratio or the highest appraisal ratio?" and the AI said: " A mean-variance investor should pick the portfolio with the highest Sharpe ratio when deciding between multiple portfolios to add to an already well-diversified portfolio. The Sharpe ratio is a measure of risk-adjusted return, and it is calculated by dividing the excess return of an investment by its standard deviation. Excess return is is the return of an investment in excess of the risk-free rate, such as the yield on Treasury bills. The appraisal ratio is a measure of absolute return, and it is calculated by dividing the return of an investment by the risk-free rate. It does not take into account the riskiness of the investment. A mean-variance investor is interested in maximizing their expected return for a given level of risk, or minimizing their risk for a given level of expected return. The Sharpe ratio is a better measure of risk-adjusted return than the appraisal ratio because it takes into account the riskiness of the investment. In the example you provided, portfolio 2 has a higher Sharpe ratio than portfolio 1. This means that portfolio 2 offers a higher expected return per unit of risk than portfolio 1. Therefore, a mean-variance investor should pick portfolio 2 to add to their already well-diversified portfolio. However, it is important to note that the Sharpe ratio is a historical measure, and it does not guarantee future performance"

$\endgroup$
3
  • $\begingroup$ Yes, I just tried: "Should a mean-variance investor deciding between multiple portfolios to add to an already well diversified portfolio pick the portfolio with the highest Sharpe ratio or the highest appraisal ratio?" and the AI said: " A mean-variance investor should pick the portfolio with the highest Sharpe ratio when deciding between multiple portfolios to add to an already well-diversified portfolio. The Sharpe ratio is a measure of risk-adjusted return, and it is calculated by dividing the excess return of an investment by its standard deviation. Excess return is (cont) $\endgroup$ Commented Sep 26, 2023 at 14:31
  • $\begingroup$ (cont) is the return of an investment in excess of the risk-free rate, such as the yield on Treasury bills. The appraisal ratio is a measure of absolute return, and it is calculated by dividing the return of an investment by the risk-free rate. It does not take into account the riskiness of the investment. A mean-variance investor is interested in maximizing their expected return for a given level of risk, or minimizing their risk for a given level of expected return. The Sharpe ratio is a better measure of risk-adjusted return than the appraisal ratio (cont) $\endgroup$ Commented Sep 26, 2023 at 14:32
  • $\begingroup$ (cont) , because it takes into account the riskiness of the investment. In the example you provided, portfolio 2 has a higher Sharpe ratio than portfolio 1. This means that portfolio 2 offers a higher expected return per unit of risk than portfolio 1. Therefore, a mean-variance investor should pick portfolio 2 to add to their already well-diversified portfolio. However, it is important to note that the Sharpe ratio is a historical measure, and it does not guarantee future performance..." $\endgroup$ Commented Sep 26, 2023 at 14:33
4
$\begingroup$

Asking ChatGPT 3.5:

How is the CBOE VIX calculated?

Answer:

The CBOE Volatility Index, often referred to as the VIX, is calculated using a formula that involves the prices of a specific set of options on the S&P 500 index. The VIX is a measure of implied volatility, or expected market volatility, over a certain period of time. It is commonly known as the "fear gauge" because it tends to rise when there is uncertainty or fear in the financial markets.

Here is a simplified explanation of how the VIX is calculated:

  1. Selection of Options: The CBOE selects a range of call and put options on the S&P 500 index with various expiration dates. These options are typically short-term options with expiration dates ranging from 23 to 37 days.

  2. Calculation of Implied Volatility: The CBOE calculates the implied volatility for each of the selected options using the prices at which these options are trading in the market. Implied volatility represents the market's expectations for future volatility.

  3. Weighting: The implied volatilities calculated in step 2 are then weighted to give more weight to options that are closer to the current market price of the S&P 500 index. This is done to reflect the sensitivity of options prices to changes in the underlying index.

  4. Aggregation: The weighted implied volatilities are aggregated to calculate the VIX. The VIX is essentially the square root of the weighted average of the squared implied volatilities. The formula looks like this:

    VIX = 100 * √(T * Σ[Weight * (Implied Volatility^2)])

    Where:

    • T is the time to expiration of the options, expressed as a fraction of a year.
    • Σ represents the summation over all the selected options.
    • Weight is the weight assigned to each option based on its proximity to the current S&P 500 index level.
    • Implied Volatility is the calculated implied volatility of each option.
  5. Annualization: Finally, the VIX is annualized by multiplying it by the square root of 12, as options prices are typically quoted on an annualized basis.

The resulting VIX value represents the expected annualized volatility of the S&P 500 index over the specified time frame, usually around one month. It provides insight into market sentiment and is widely used by traders and investors to gauge market risk and make informed decisions.

Please note that the actual calculation involves more intricate details, including interpolation and extrapolation of option prices, to ensure a continuous time series. The CBOE regularly updates the methodology for calculating the VIX to maintain its accuracy and relevance.

Correct answer The VIX methodology is neither computing implied vols from options, nor is it giving more weight to options closer to the current market price. The current formula uses weights that are being inversely proportional to squared strikes (1/K2) and option prices directly (not IV). See here for a simple (graphical) explanation.

If you ask ChatGPT

how is the CBOE VIX currently calculated

the AI answer that

As of my last knowledge update in September 2021, the CBOE VIX (Volatility Index), also known as the "fear gauge," was calculated using the methodology I described earlier.

However, the current VIX methodology was introduced in 2003 (ignoring weekly options that were added in 2014).

$\endgroup$
4
$\begingroup$

Question for ChatGPT 3.5:

Is 50 delta ATM?

Answer

Yes, a 50 delta option is considered "at-the-money" (ATM). Delta is a Greek letter used in options trading to measure the sensitivity of an option's price to changes in the underlying asset's price. It represents the probability that the option will expire in-the-money (ITM).

  • A delta of 0 indicates that the option is far out-of-the-money (OTM), meaning the probability of it expiring ITM is very low.

  • A delta of 0.5 or 50% indicates that the option is ATM. At this point, the option has an equal probability of expiring ITM or out-of-the-money (OTM).

  • A delta of 1 indicates that the option is in-the-money (ITM), meaning it has a high probability of expiring ITM.

So, when you have a 50 delta option, you have an option that is right at the money, meaning the strike price is very close to the current market price of the underlying asset. It's important to note that delta can change as the underlying asset's price moves, so an option that starts as ATM may become ITM or OTM as the underlying price changes.

Correct answer

You can see how far 50D can be from ATM in this answer. Delta is an increasing function of time and IV. Moreover, the delta also does not represent the probability that the option will expire ITM (it proxies it at best).

Using Julia for pricing an ATM option with 1y to expiry, zero interest rates and dividends shows, for a somewhat unrealistic IV of 300% that delta is ~93% whereas the probability that the option will expire ITM is about 6%:

function BSM(S,K,t,rf,d,σ) d1 = ( log(S/K) + (rf - d + 1/2*σ^2)*t ) / (σ*sqrt(t)) d2 = d1 - σ*sqrt(t) delta = exp(-d*t)*N(d1) return delta, N(d2) end Call = BSM(100,100,1,0,0,3) DataFrame("Delta" => Call[2], "Prob. ITM" => Call[3]) 

enter image description here

$\endgroup$
0
4
$\begingroup$

Question

How do I calculate the OAS spread of a bond?

Chat-GPT 3.5 Answer

The Option-Adjusted Spread (OAS) of a bond is a measure that takes into account the embedded options, such as call options or put options, in a bond's structure. It represents the additional yield over the risk-free benchmark (typically a Treasury bond) that compensates investors for the bond's credit risk and any embedded option risk. Calculating the OAS spread involves several steps:

  1. Determine the Bond's Clean Price: Start by determining the bond's clean price in the market. The clean price is the bond's market price without including any accrued interest. It is the price at which the bond is traded, excluding any interest that has accumulated since the last coupon payment.

  2. Calculate the Present Value of Cash Flows: Calculate the present value of all expected future cash flows from the bond, including both coupon payments and the face value of the bond at maturity. Use the bond's YTM (Yield to Maturity) as the discount rate for these cash flows. The YTM is the market yield that equates the present value of the bond's cash flows to its clean price.

  3. Calculate the Present Value of Cash Flows Assuming No Options: Recalculate the present value of the bond's cash flows, but this time assume that the bond has no embedded options. This means you treat the bond as if it were a plain vanilla bond with no call or put options. Use the same YTM as in step 2 as the discount rate.

  4. Calculate the OAS: The OAS spread is the difference between the YTM and the spread you calculated in step 3. Mathematically, it can be expressed as:

OAS Spread = YTM - Spread assuming no options

Where:

YTM is the yield to maturity of the bond, which you calculated in step 2. Spread assuming no options is the spread you calculated in step 3. The OAS spread represents the compensation investors receive for taking on the risk associated with the embedded options in the bond. A positive OAS indicates that investors are receiving additional yield for this risk, while a negative OAS would suggest that investors are accepting a lower yield compared to a plain vanilla bond with similar credit risk.

Real Answer

The intuition is not necessarily wrong but if I read this answer for the first time without any knowledge about OAS I wouldn't know what to do with it. A better description is offered on the Wikipedia page. In short: you need a tree or some sort of grid. The YTM is not directly used (other than to get the price of the bond). Step 2 and 3 appear to be the same thing to me as well since YTM assumes no optionality.

The last sentence about positive and negative OAS is also confusing and not really relevant. Corporate bonds generally have a positive spread.

img

$\endgroup$
4
$\begingroup$

I hesitated to post this because ultimately ChatGPT is an AI-powered language model, capable of generating human-like text based on context and past conversations. I do not expect an english major to answer this question either. On the other hand, the AI pretends to know the answer (although it does not actually compute the price unless you specify that you want the USD value).

As found on ChatGPT Experts

Question for ChatGPT 3.5:

An investor wants to buy a call option with a strike of 110 for a stock trading for USD 100 per share that expires in 6 months. the risk free rate is 5% and the stock's volatility is 30%. What is the exact USD price of the option using Black Scholes.

Answer:

To calculate the exact price of the call option in USD using the Black-Scholes model, we'll use the formula:

$C = S_0N(d_1) - Xe^{-rt}N(d_2)$

Where:

  • C = Price of the call option in USD
  • $S_0$ = Current stock price = \$100 per share
  • X = Strike price of the option = \$110 per share
  • r = Risk-free interest rate = 5% or 0.05
  • t = Time to expiration = 6 months = 0.5 years
  • $\sigma$ = Volatility of the stock = 30% or 0.30

First, we need to calculate $(d_1)$ and $(d_2)$ using the Black-Scholes formulas:

$ d_1 = \frac{\ln(S_0/X) + (r + (\sigma^2)/2)t}{\sigma\sqrt(t)}$

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

Now, let's calculate $(d_1)$:

$d_1 = \frac{\ln(100/110) + (0.05 + (0.30^2)/2) * 0.5}{0.30 * \sqrt(0.5)}$

First, calculate the values inside the parentheses:

$\ln(100/110) = \ln(0.9091) \approx -0.0953$

$(0.05 + (0.30^2)/2) * 0.5 = (0.05 + 0.045) * 0.5 = 0.0475$

Now, calculate $(d_1)$:

$d_1 = \frac{-0.0953 + 0.0475}{0.30 * \sqrt{0.5}}$ $ d_1 = \frac{-0.0478}{0.2121} \approx -0.2253$

Next, calculate $(d_2)$:

$d_2 = -0.2253 - 0.30 * \sqrt{0.5} \approx -0.5706$

Now, use a standard normal distribution table or calculator to find $N(d_1)$ and $N(d_2)$.

  • $N(d_1) \approx 0.4107$
  • $N(d_2) \approx 0.2857$

Finally, plug the values into the Black-Scholes formula to calculate the exact price of the call option in USD:

$C = 100 * 0.4107 - 110 * e^{-0.05 * 0.5} * 0.2857$

Now, calculate the values inside the formula:

$C = 41.07 - 110 * 0.9751 * 0.2857$

$C = 41.07 - 31.60$

Now, calculate the final price of the call option in USD:

$C \approx 9.47$

So, the exact price of the call option using the Black-Scholes model is approximately $9.47 in USD per share.

Correct answer The generated answer is actually quite impressive. Yet, if you compute the values, you realize d2 is wrong, and the actual option value is 5.58, not 9.47.

In Julia:

# generic put call pricer function BSM(S,K,t,rf,σ) d1 = ( log(S/K) + (rf + 1/2*σ^2)*t ) / (σ*sqrt(t)) d2 = d1 - σ*sqrt(t) c = exp(-d*t)S*N(d1) - exp(-rf*t)*K*N(d2) return c, d1, d2, N(d1), N(d2) end s,k,r,t,σ = 100, 110, 0.05, 0.5, 0.3 call = BSM(s,k,t,r,σ) DataFrame("option value" => call[1], "d1" => call[2] , "d2" => call[3] , "N(d1)" => call[4] , "N(d2)" => call[5] ) 

Result

enter image description here

Interestingly, asking ChatGPT what the result of $d_2 = -0.2253 - 0.30 * \sqrt{0.5}$ is provides the correct answer.

To calculate the expression: -0.2253 - 0.30 * sqrt(0.5) First, calculate the square root of 0.5: sqrt(0.5) ≈ 0.7071 (rounded to four decimal places) Now, substitute this value back into the original expression: -0.2253 - 0.30 * 0.7071 Next, multiply 0.30 by 0.7071: 0.30 * 0.7071 ≈ 0.21213 (rounded to five decimal places) Now, subtract 0.21213 from -0.2253: -0.2253 - 0.21213 ≈ -0.43743 So, the result is approximately -0.43743.

Google bard claims its 8.49 and shows as the final step:

0.6827 * 100 - 0.6179 * 110 * exp(-0.05 * 0.5) = 68.27 - 67.99 = 8.49

It does seem to learn on the go though, because after asking what 68.27 - 67.99 is, bard responses that

68.27 - 67.99 = 0.28.

I apologize for my previous mistake. I am still under development and learning to perform many kinds of tasks. I will try my best to avoid making similar mistakes in the future.

$\endgroup$
3
  • 2
    $\begingroup$ At least version 3.5 is quite capable of getting things wrong that English majors should likely know, too. For instance, "In Dracula, why can he not go out in the sun?" Correct answer: he can, he just cannot use his powers. GPT 3.5 answer: "In Bram Stoker's novel 'Dracula,' the character Count Dracula is depicted as a vampire, and like many vampire legends, he is said to be vulnerable to sunlight. Sunlight is often portrayed as harmful to vampires, causing them to burn or disintegrate." $\endgroup$ Commented Sep 27, 2023 at 11:03
  • 1
    $\begingroup$ "Who is the murderer in Curtain by Agatha Christie?" gives "The murderer in Agatha Christie's novel 'Curtain' is revealed to be Hercule Poirot himself. The novel was written by Christie as her final Poirot mystery, and it was published posthumously in 1975." Most people would say that the murderer was Norton, who kills six people and is the main antagonist, even if Poirot technically did commit a murder. $\endgroup$ Commented Sep 27, 2023 at 11:03
  • 1
    $\begingroup$ @Obie 2.0, I believe you are right, the quality of responses is a very general problem. I added a question where Google Bard even makes up its own guidelines. $\endgroup$ Commented Dec 18, 2023 at 21:25
3
$\begingroup$

Asking ChatGPT 3.5: "Can you summarize the SABR model"

Mr SABR was such a key figure that they chose his name, despite having decided to use the first initials of the model's creators.

Asking who creaed the SABR model did not make it any better.



Google bard initially answers this question correctly.

However, asking what the name stands for results in a similar response:

The original paper states on P.8 that the authors chose the name

"stochastic-αβρ model", which has become known as the SABR model

because they make α (the volatility) a stochastic process and β and ρ are other parameters of the model.

$\endgroup$
3
$\begingroup$

I tried the following prompt:

Write Python program to create a schedule in QuantLib having London, UK, holiday calendar, issue date on December 1, 2023, long first coupon paid on April 1, 2024, followed by quarterly coupon periods, until the maturity date January 1, 2025.

This was the response from Google Bard:

import QuantLib as ql # Create the London holiday calendar london_calendar = ql.UnitedKingdom() # Define the schedule parameters issue_date = ql.Date(1, 12, 2023) maturity_date = ql.Date(1, 1, 2025) tenor = ql.Period(ql.Quarterly) # Quarterly coupons calendar = london_calendar business_convention = ql.Following # Adjust to following business day if a holiday date_generation = ql.DateGeneration.Forward end_of_month = False # Coupon payments not necessarily on end of month # Create the schedule with a long first period schedule = ql.Schedule(issue_date, maturity_date, tenor, calendar, business_convention, business_convention, date_generation, end_of_month) # Set the first coupon date explicitly to April 1, 2024 schedule.firstDate = ql.Date(1, 4, 2024) # Print the schedule print(schedule) 

Problem 1: print(schedule) outputs:

<QuantLib.QuantLib.Schedule; proxy of <Swig Object of type 'Schedule *' at 0x0000017A3DA20720> >

Replacing print with

for i, date in enumerate(schedule): print(f"#{i} {date.ISO()}") 

outputs:

#0 2023-12-01 #1 2024-03-01 #2 2024-06-03 #3 2024-09-02 #4 2024-12-02 #5 2025-01-02 

Problem 2: these are not the dates that we're looking for. Changing schedule.firstDate did not have the desired effect.

Problem 3: Sidetracking, my pet peeve: "London" holidays are not the same as "Scotland" holidays and there is no such thing as UnitedKingdom() holidays, except in EU programmers' imagination.

Clicking "Regenerate draft" caused Bard to change the Schedule call to:

schedule = ql.Schedule(issue_date, maturity_date, tenor, calendar, business_convention, business_convention, date_generation, end_of_month, firstDate=ql.Date(1, 4, 2024)) 

Problem 4: Between SWIG, Quantlib and Python, we can't pass named keywords like firstDate - Python throws TypeError: Schedule.__init__() got an unexpected keyword argument.... This date should have been passed as a positional argument instead. A cleaned-up version is at the end of this answer.

ChatGPT 3.5 generated the following more convoluted code:

from QuantLib import * def create_schedule_with_custom_dates(): issue_date = Date(1, 12, 2023) long_first_coupon_date = Date(1, 4, 2024) maturity_date = Date(1, 1, 2025) tenor = Period(3, Months) # Quarterly coupons calendar = UnitedKingdom() convention = ModifiedFollowing # Create schedule with custom dates schedule = Schedule(issue_date, maturity_date, tenor, calendar, convention, convention, DateGeneration.Backward, False) # Set custom long first coupon date schedule[0] = long_first_coupon_date return schedule def main(): schedule = create_schedule_with_custom_dates() for date in schedule: print(date) if __name__ == "__main__": main() 

Problem 5:

 schedule[0] = long_first_coupon_date ~~~~~~~~^^^ TypeError: 'Schedule' object does not support item assignment 

ChatGPT 4.0 in Microsoft CoPilot generated this code:

# Import QuantLib library import QuantLib as ql # Define the parameters issue_date = ql.Date(1, 12, 2023) # December 1, 2023 maturity_date = ql.Date(1, 1, 2025) # January 1, 2025 coupon_frequency = ql.Period(ql.Quarterly) # Quarterly coupons calendar = ql.UnitedKingdom() # London, UK, holiday calendar convention = ql.ModifiedFollowing # Business day convention end_of_month = False # Do not adjust to end of month first_coupon_date = ql.Date(1, 4, 2024) # April 1, 2024 first_coupon_period = ql.Period(ql.Semiannual) # Long first coupon # Create the schedule schedule = ql.Schedule(issue_date, maturity_date, coupon_frequency, calendar, convention, convention, ql.DateGeneration.Forward, end_of_month, first_coupon_date, first_coupon_period) # Print the schedule print("The schedule is:") for date in schedule: print(date) 

Problem 6: Semiannual is AI's hallucination. The odd first coupon is meant to be 4 months long.

Problem 7: Passing the hallucinatory first_coupon_period in the position where the constructor expects nextToLastDate causes Python to throw:

TypeError: Wrong number or type of arguments for overloaded function 'new_Schedule'. Possible C/C++ prototypes are: ... 

Conclusion: none of the generative AI programs wrote a program that ran correctly, but Bard came close.

For reference, here is a cleaned up version of Bard's code:

import QuantLib as ql # Define the schedule parameters issue_date = ql.Date(1, 12, 2023) maturity_date = ql.Date(1, 1, 2025) # bumped to January 2 because of New year's Day tenor = ql.Period(ql.Quarterly) # Quarterly coupons calendar = ql.UnitedKingdom() # London, UK, holiday calendar... NOT! business_convention = ql.ModifiedFollowing # Adjust to business day if a holiday date_generation = ql.DateGeneration.Forward end_of_month = False # Coupon payments not necessarily on end of month first_coupon_date = ql.Date(1, 4, 2024) # bumped to April 2 because of Easter Monday # Create the schedule with a long first period schedule = ql.Schedule(issue_date, maturity_date, tenor, calendar, business_convention, business_convention, date_generation, end_of_month, first_coupon_date) # Print the schedule for i, date in enumerate(schedule): print(f"#{i} {date.ISO()}") 

which produces the desired output:

#0 2023-12-01 #1 2024-04-02 #2 2024-07-01 #3 2024-10-01 #4 2025-01-02 
$\endgroup$
2
$\begingroup$

Not exactly quantitative finance but it shows how extremely misleading AI can be. Not only does it get facts wrong, it even makes up its own EBA guidelines.

Initially I asked how to measure CSRBB (credit spread risk in the banking book). I received this response from Google Bard (excerpt):

The "credit spread per basis point" delta (CS01) is a measure of the sensitivity of an asset or liability to a change in credit spreads...

Regulators in the European Union require banks to measure and manage their CSRBB exposure. The European Banking Authority (EBA) has issued guidelines on how to do this.

I'll include screenshots to show what followed:

enter image description here

To the best of my knowledge, this is not the case. Therefore, I asked where to find this in the guidelines.

enter image description here

The problem here is that EBA/GL/2022/05 is not about CSRBB, so I asked can you show this specific section to me.

enter image description here

Now, I specifically mentioned that EBA/GL/2022/05 is about Compliance Management not CSRBB. Bard wrote that I am correct and apoligized with the following:

I apologize for the error I made in my previous response. I am still under development, and I am always learning new things. I will try to be more careful in the future.

However, enter image description here

and it keeps getting worse with every response:

enter image description here

enter image description here

enter image description here

I tried replicating a day later but the response was different. However, asking Does CSRBB (Credit Spread Risk in the Banking Book) in the EBA guidelines suggest to use CS01 it responded the following (excerpt):

Yes, the EBA guidelines for credit spread risk arising from non-trading book activities (CSRBB) recommend using CS01 to calculate CSRBB for the standardized approach (STA). CS01 stands for credit spread duration, and it is a measure of the sensitivity of an asset or liability to a parallel shift in credit spreads...

The EBA guidelines recommend using CS01 because it is a relatively simple and easy-to-understand measure of credit spread risk. It is also relatively easy to calculate, which makes it a good choice for banks that are not using the internal models approach (IMA).

However, the EBA guidelines also note that CS01 may not be the most accurate measure of credit spread risk for all banks. This is because CS01 assumes that all credit spreads will shift by the same percentage, which may not be the case in reality. In some cases, credit spreads for different credit quality categories may move by different percentages...

The EBA guidelines recommend that banks use a 5% parallel shift in credit spreads when calculating CS01 for the STA. This is because 5% is a reasonable assumption for the most likely type of change in credit spreads.

To Summarize:

Not only does Google bard mix up Guidelines, it also provides fake text that makes you believe it is actually directly from the guidelines. The responses also change frequently, although they were at least consistently wrong...

The silly 5+7 example at the end shows that that the current state of AI is all about artificial, and nothing about intelligence really.

$\endgroup$
2
$\begingroup$

How do you delta hedge a sold put?

Asked to Gemini, ChatGPT and copilot.

Chatgpt

Delta hedging a sold put option involves taking an offsetting position in the underlying asset to neutralize the directional risk (delta). Since a sold put has a negative delta, you need to buy shares of the underlying asset to hedge it.

Copilot

Delta hedging a sold put involves offsetting the risk of price movements in the underlying asset. Since selling a put exposes you to potential losses if the underlying asset declines, the idea is to take an opposing position in the asset to neutralize these price fluctuations.

Here's how you can delta hedge a sold put: Delta hedging means buying the underlying asset in proportion to the absolute value of the put's delta. For example, if the put's delta is -0.4 and you sold one put contract representing 100 shares, you'd buy 40 shares (100 × 0.4) of the underlying asset.

Gemini

Delta hedging a sold put option involves managing the risk associated with changes in the underlying asset's price. Since a sold put has a negative delta, meaning its value increases as the underlying asset's price decreases, you need to counteract this by buying shares of the underlying asset.

I asked Gemini a few more details and lined out that I would lose with the option and the shares if the underlying declined. Here is the response:

You're absolutely right to bring us back to the practical application of this knowledge. Let's get this right, and clearly explain how to delta hedge a sold put, now that we've cleared up the delta sign confusion. Delta Hedging a Sold Put (Short Put): * Understanding the Position Delta: * As we've established, while the put option itself has a negative delta, your position as the seller has the inverse impact. * Therefore, as the underlying asset price decreases, your liability increases. * To hedge this, you need to buy shares of the underlying asset.

.

$\endgroup$
1
$\begingroup$

Asking Google Bard:

How to best estimate dv01 when perturbing interest rates by 1 basis point admits arbitrage?

Answer:

Estimating dv01 (duration contribution to the value of a security) when perturbing interest rates by 1 basis point admits arbitrage can be challenging due to the unpredictable price movements caused by arbitrage activity. However, there are a few approaches that can be used to obtain a reasonable estimate.

  1. Historical Analysis: Examining historical data can provide insights into the relationship between interest rate changes and price movements for similar securities. By analyzing past instances of arbitrage and the subsequent price adjustments, it may be possible to identify patterns and develop a model to predict the impact of arbitrage on dv01 calculations.

  2. Arbitrage-Free Pricing Models: Employing arbitrage-free pricing models can help estimate dv01 values by considering the theoretical relationships between various interest rate derivatives and their underlying assets. These models incorporate the risk-free interest rate and the expected future path of interest rates to determine the fair prices of derivatives.

  3. Scenario Analysis: Conducting scenario analysis involves simulating the impact of different interest rate scenarios on the prices of relevant securities. By simulating a range of interest rate changes, it is possible to observe the price movements and identify arbitrage opportunities. This information can then be used to adjust dv01 estimates accordingly.

  4. Real-Time Market Monitoring: Continuously monitoring market data can provide valuable insights into arbitrage activity and its impact on security prices. By observing real-time price movements, it is possible to identify arbitrage opportunities and adjust dv01 estimates accordingly.

  5. Combination of Approaches: Combining multiple approaches can provide a more comprehensive and accurate estimation of dv01 when arbitrage is present. For instance, historical analysis can provide a baseline estimation, while arbitrage-free pricing models can refine the estimates. Scenario analysis and real-time market monitoring can further refine the estimates by considering the impact of arbitrage opportunities.

It is important to note that estimating dv01 under arbitrage conditions is inherently uncertain, and the accuracy of the estimates will depend on the specific market conditions and the availability of relevant data. However, by employing a combination of the aforementioned approaches, it is possible to obtain a reasonable approximation of dv01 values even in the presence of arbitrage.

This is not completely wrong, but the suggestion that I was hoping for was to use a smaller bump so as not to admit arbitrage, and rescale the impact to 1bp.

$\endgroup$
1
$\begingroup$

On the 6th of July 2025, I asked Mistral to solve the following partial differential equation $3x^3 z' + x^2 z = 1$ (even if the question is not pure quantitative finance, I find it relevant for this topic as PDE as widely used in this domain).

Response :

The equation you've provided is a partial differential equation (PDE) involving two variables, $x$ and $z$. Solving PDEs can be complex and often requires specific techniques depending on the form of the equation. The given equation is:

$3x^3 z' + x^2 z = 1$

Assuming $z'$ represents the partial derivative of $z$ with respect to $x$, we can rewrite the equation as:

$3x^3 \frac{\partial z}{\partial x} + x^2 z = 1$

This is a first-order linear partial differential equation. To solve it, we can use the method of integrating factors. Let's proceed step-by-step.

  1. Rewrite the equation in standard form:

$\frac{\partial z}{\partial x} + \frac{1}{3x} z = \frac{1}{3x^3}$

  1. Identify the integrating factor $\mu(x)$:

The integrating factor $\mu(x)$ is given by:

$\mu(x) = e^{\int \frac{1}{3x} \, dx} = x^{1/3}$

  1. Multiply the equation by the integrating factor:

$x^{1/3} \frac{\partial z}{\partial x} + \frac{1}{3} x^{-2/3} z = \frac{1}{3} x^{-8/3}$

  1. Recognize that the left-hand side is the derivative of $z \cdot x^{1/3}$:

$\frac{\partial}{\partial x} \left( z \cdot x^{1/3} \right) = \frac{1}{3} x^{-8/3}$

  1. Integrate both sides with respect to $x$:

$z \cdot x^{1/3} = -\frac{1}{5} x^{-5/3} + C$

  1. Solve for $z$:

$z = -\frac{1}{5x^2} + \frac{C}{x^{1/3}}$

Thus, the general solution to the partial differential equation is:

$z(x) = -\frac{1}{5x^2} + \frac{C}{x^{1/3}}$

where $C$ is an arbitrary constant.

Correction :

Here, Mistral doesn't solve the first order PDE the right way... When calculating the solution of the homogeneous equation, it computes $\mu(x) = e^{\int \frac{1}{3x} \, dx} = x^{1/3}$ instead of $\mu(x) =e^{-\int \frac{1}{3x} \, dx} = \lvert x \rvert ^{-1/3}$. It then gives the correct result for the particular solution that I also found by doing the method of variation of constants. In the end, the result it gives is correct (it just misses the absolute value around x in the solution of the homogeneous equation) but one step it used is wrong...

$\endgroup$
0
$\begingroup$

Whilst not incorrect, the number of clearly identified "sorrys" is excessive.

Prompt:

Write a proof of Black-Scholes option pricing formula in Lean language using Itô's lemma. Clearly identify all the assumptions.

Response:

While a full, formally verified proof of the Black-Scholes pricing formula in Lean would be a significant undertaking requiring advanced libraries for stochastic calculus and probability theory within Lean, I can provide a sketch of how such a proof would conceptually proceed, along with the key assumptions.

Assumptions of the Black-Scholes Model:

  1. The stock price follows a geometric Brownian motion: $dS_t = \mu S_t dt + \sigma S_t dW_t$ where:

$S_t$ is the stock price at time $t$.

$\mu$ is the constant drift rate of the stock.

$\sigma$ is the constant volatility of the stock.

$W_t$ is a standard Brownian motion.

  1. The risk-free interest rate $r$ is constant.

  2. There are no transaction costs or taxes.

  3. The underlying stock pays no dividends.

  4. Markets are efficient, and there are no arbitrage opportunities.

  5. Trading in the underlying asset and the option is continuous.

Conceptual Outline of the Proof using Itô's Lemma in Lean:

We aim to show that a portfolio consisting of the option and the underlying stock, constructed according to the Black-Scholes formula, is risk-free, leading to the Black-Scholes Partial Differential Equation (PDE), and that the Black-Scholes formula is a solution to this PDE.

Hypothetical Lean Code Snippets (Illustrative and Not Executable):

-- Assuming we have formalized real numbers, calculus, probability theory, -- and stochastic processes in Lean. -- Define the parameters of the model variables (S : ℝ) (t : ℝ) (K : ℝ) (T : ℝ) (r : ℝ) (σ : ℝ) -- Define the standard normal cumulative distribution function (N) -- This would require a formal definition in Lean def N (x : ℝ) : ℝ := sorry -- Define d1 and d2 def d1 (S K T t r σ : ℝ) : ℝ := (Real.log (S / K) + (r + (1 / 2) * σ^2) * (T - t)) / (σ * Real.sqrt (T - t)) def d2 (S K T t r σ : ℝ) : ℝ := d1 S K T t r σ - σ * Real.sqrt (T - t) -- Define the Black-Scholes formula for a European call option def black_scholes_call (S t K T r σ : ℝ) : ℝ := S * N (d1 S K T t r σ) - K * Real.exp (-r * (T - t)) * N (d2 S K T t r σ) -- State Ito's Lemma (for a function of a single stochastic process) -- This would need a formal statement in Lean theorem ito_lemma {f : ℝ → ℝ → ℝ} {S : ℝ → ℝ} {W : ℝ → ℝ} (hf_smooth : ...) -- Conditions on f (e.g., twice continuously differentiable) (hS_gbm : ∀ t, deriv S t = ...) -- S follows a geometric Brownian motion (hW_brownian : ...) -- W is a standard Brownian motion (t : ℝ) : deriv (λ u => f (S u) u) t = (∂ f / ∂ t (S t) t) + (∂ f / ∂ x (S t) t) * (deriv S t) + (1 / 2) * (∂^2 f / ∂ x^2 (S t) t) * (deriv S t)^2 := sorry -- We would need to show that if the stock price follows a geometric Brownian motion, -- then applying Ito's Lemma to the Black-Scholes call option price C(S_t, t) gives: -- dC = (∂C/∂t + μ S ∂C/∂S + 1/2 σ^2 S^2 ∂^2C/∂S^2) dt + σ S ∂C/∂S dW_t -- Proof step: Calculate the partial derivatives of the Black-Scholes formula -- This would involve significant calculus within Lean lemma black_scholes_call_partial_t : ∂ (black_scholes_call S t K T r σ) / ∂ t = sorry := sorry lemma black_scholes_call_partial_S : ∂ (black_scholes_call S t K T r σ) / ∂ S = sorry := sorry lemma black_scholes_call_partial_SS : ∂^2 (black_scholes_call S t K T r σ) / ∂ S ∂ S = sorry := sorry -- Apply Ito's Lemma to the Black-Scholes call option price C(S_t, t) -- This step would formally use the 'ito_lemma' theorem lemma ito_on_black_scholes_call : let C := black_scholes_call S t K T r σ in d C = (∂ C / ∂ t + μ * S * (∂ C / ∂ S) + (1 / 2) * σ^2 * S^2 * (∂^2 C / ∂ S ∂ S)) dt + σ * S * (∂ C / ∂ S) dW_t := sorry -- Consider a portfolio Π consisting of one call option and -Δ shares of the stock, -- where Δ = ∂C/∂S (the option's delta). -- Π = C - ΔS -- The change in the portfolio value dΠ is given by: -- dΠ = dC - Δ dS = dC - (∂C/∂S) dS -- Substitute the expressions for dC and dS: -- dΠ = (∂C/∂t + μ S ∂C/∂S + 1/2 σ^2 S^2 ∂^2C/∂S^2) dt + σ S ∂C/∂S dW_t - (∂C/∂S) (μ S dt + σ S dW_t) -- Notice that the terms involving dW_t cancel out: -- dΠ = (∂C/∂t + μ S ∂C/∂S + 1/2 σ^2 S^2 ∂^2C/∂S^2) dt - μ S (∂C/∂S) dt -- dΠ = (∂C/∂t + 1/2 σ^2 S^2 ∂^2C/∂S^2) dt -- By the no-arbitrage principle, the return on this risk-free portfolio must be equal to the risk-free rate r: -- dΠ = r Π dt = r (C - S ∂C/∂S) dt -- Equating the two expressions for dΠ: -- (∂C/∂t + 1/2 σ^2 S^2 ∂^2C/∂S^2) dt = r (C - S ∂C/∂S) dt -- Rearranging the terms gives the Black-Scholes Partial Differential Equation (PDE): -- ∂C/∂t + r S ∂C/∂S + 1/2 σ^2 S^2 ∂^2C/∂S^2 - r C = 0 -- Proof step: Show that the Black-Scholes formula satisfies this PDE theorem black_scholes_formula_satisfies_pde : let C := black_scholes_call S t K T r σ in (∂ C / ∂ t) + r * S * (∂ C / ∂ S) + (1 / 2) * σ^2 * S^2 * (∂^2 C / ∂ S ∂ S) - r * C = 0 := sorry -- Finally, we would need to show that the Black-Scholes formula satisfies the boundary condition for a call option at maturity (t = T): -- C(S_T, T) = max(S_T - K, 0) -- Proof step: Verify the boundary condition theorem black_scholes_formula_boundary_condition : black_scholes_call S T K T r σ = Real.max (S - K) 0 := sorry 

Explanation of the Conceptual Steps:

  1. Formalization of Prerequisites: The first and most significant hurdle is to formalize the necessary mathematical concepts within Lean. This includes real numbers, calculus (derivatives, partial derivatives), probability theory (Brownian motion, stochastic processes), and stochastic calculus (Itô's Lemma). This often involves building upon existing mathematical libraries in Lean (like Mathlib) or developing new ones.

  2. Stating Itô's Lemma: A formal statement of Itô's Lemma for the specific type of stochastic process (geometric Brownian motion) and function (the option price) would be required.

  3. Calculating Partial Derivatives: The proof involves calculating the first and second partial derivatives of the Black-Scholes formula with respect to the stock price $S$ and time $t$. This would be done using the rules of calculus within Lean.

  4. Applying Itô's Lemma: Itô's Lemma is applied to the option price function $C(S_t, t)$, considering that $S_t$ follows a geometric Brownian motion. This yields the stochastic differential equation for the option price $dC$.

  5. Constructing a Risk-Free Portfolio: A portfolio consisting of one option and a certain number $(-\Delta)$ of the underlying stock is constructed. The number of shares, $\Delta$, is chosen to eliminate the random component $(dW_t)$ from the portfolio's return.

  6. No-Arbitrage Argument: The principle of no arbitrage dictates that a risk-free portfolio must earn the risk-free rate of return. This allows us to set up an equation.

  7. Deriving the Black-Scholes PDE: By equating the two expressions for the change in the portfolio value (one from Itô's Lemma and the other from the no-arbitrage condition), we arrive at the Black-Scholes Partial Differential Equation.

  8. Verification of the Formula: The final step is to show that the Black-Scholes formula we defined is indeed a solution to the derived Black-Scholes PDE and satisfies the appropriate boundary condition at the option's maturity. This involves substituting the formula and its derivatives into the PDE and verifying the equality.

Conclusion:

While the above provides a conceptual outline, a complete and verified proof in Lean would be a very complex task, requiring a strong foundation in both financial mathematics and the Lean theorem prover. The "sorry" placeholders in the hypothetical Lean code indicate the parts that would require significant formalization and proof effort.

The assumptions listed at the beginning are crucial for the validity of the Black-Scholes formula. If any of these assumptions are violated in the real world, the formula may not accurately predict option prices.

$\endgroup$
1
  • $\begingroup$ Maybe this should have been in proofassistants.stackexchange.com? Using Lean or similar proof assistants in quantitative finance model validation/verification isn't yet as mainstream as it ought to be. $\endgroup$ Commented Apr 4 at 17:45
0
$\begingroup$

Not necessarily factually incorrect, but a good one anyway.

Google Gemini 2.5 Flash

What is a trading floor equivalent of a barrack bunny?

The term "barracks bunny" is military slang for a servicewoman (or sometimes a civilian) who frequently engages in sexual relationships with many other soldiers, typically within the barracks.

There isn't one single, universally recognized or polite trading floor equivalent. However, given the context of a highly male-dominated environment and the meaning of the original term, you could potentially look at a few concepts, though none are a direct, exact match and many are similarly derogatory:

  • A woman who is overly involved in the social/party scene with male traders/bankers: This could apply to a woman who frequents industry-related events, bars, or trips primarily to associate with the male professionals.
  • A derogatory term for a female employee or associate perceived to be gaining professional advantage through sexual relationships (or perceived sexual availability) with male superiors or colleagues.

Important Note: Trading floors, especially historically, have been associated with a male-dominated culture. Many slang terms used in such environments can be highly offensive, inappropriate, and derogatory toward women. The very notion of finding an "equivalent" is rooted in workplace behaviors that are widely considered unprofessional and unacceptable. The use of such terms is a form of workplace harassment and is generally not tolerated by modern professional firms.

Would you like to know more about professional conduct and terminology in the finance industry?

$\endgroup$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.