instruction stringlengths 15 26.1k |
|---|
I am trying to use the Vech-HAR (the mulitvariate HAR) model in order to forecast some covariances.
I have been looking into the model proposed by Chiriac(2010) that states the model as:
[![enter image description here][1]][1]
[1]: https://i.stack.imgur.com/TyA7a.png
Here $X_t = vech(P_t)$ where $P_t$ come... |
I am trying to use the Vech-HAR (the mulitvariate HAR) model in order to forecast some covariances.
I have been looking into the model proposed by Chiriac *Modelling and forecasting multivariate realized volatility* (2010) ([link][1]) that states the model as:
[![enter image description here][2]][2]
Here $X_t =... |
I have two lists to describe the function y(x) that represents strikes and the relative value of the skew of a volatility surface:
x_points = [22.56, 27.07, 31.58, 36.10, 40.61, 45.12, 49.63, 54.14, 58.66, 63.17, 67.68] %strikes value
y_points = [97.44, 87.32, 79.73, 75.47, 73.58, 74.53, 78.61, 83.64,... |
It is known that if the CAPM holds then the E(R) = CAPM predicted return and all securities lie on the SML. However, in each period, there is an error term that is non-zero in every single observation but that is 0 on average (as in any regression) In my view, if the CAPM perfectly holds and we run a regression between... |
Error term, R-square and perfectly holding CAPM? |
I would like to simulate a local volatility underlying
$$ dS_t = S_t\sigma(t, S_t)dW_t $$
and have looked at QuantLib's `LocalVolTermStructureHandle` to do so.
So far:
```
today = ql.Date().todaysDate()
calendar = ql.NullCalendar()
dayCounter = ql.Actual365Fixed()
spot = 100
rate = 0.0
initial_value = ql.... |
1. How are asset prices set when investors face heterogeneous expectations? Does some form of "negotiation" take place so that the market price is set?
2. Can investors face heterogeneous costs of capital (even under homogeneous expectations)? Would this be an explanation for differences across portfolios? For exam... |
Is there a difference between heterogeneous expectations and heterogeneous cost of capital? How are assets priced in these situations? |
I'm currently using QuantLib to perform financial calculations in my application, but I'm having trouble finding a DayCount convention that supports the India financial year calendar (April 1 to March 31).
I've tried using the Actual/365 (Fixed) convention, but this assumes a calendar year of January 1 to December 3... |
Does QuantLib have a DayCount convention that supports India financial year calculations? |
Given a strategy with normal returns with mean 5% and standard deviation 10% what is the optimal leverage (up to a maximum of 2x) to maximize the expected wealth? With the same setting, if trading is discretized in 5 rounds, what is the optimal leverage?
With a Monte Carlo approach, the optimal leverage seems to be ... |
I'm trying to predict the one-day ahead movement of the S&P 500 with Temporal Convolutional Networks [1] to capture some "memory".
[![TCN architecture][2]][2]
I use daily close data with the loss function $\mathrm{MSE}(f(x_0, \ldots, x_T), y_T)$ where $f(x_0, \ldots, x_T) = \hat y_T := x_{T+1}$ is the output of ... |
As @Bob Jansen says above the last price is actually an excellent predictor, but you should do it in the return space.
[Goyal and Welch (2007)][1] try to do this with multiple predictors and find that nothing consistently beats the naive average historical return. It would be very interesting if your model converges... |
Theta is the change of an options value with respect to time. But theta itself changes over time. Today's option theta is not the same as tomorrow's option theta. What is the greek name for this value? And where can I learn more about it?
This would seem like a useful measurement in things like calendar spreads wher... |
Consider an (inhomogeneous) Poisson process $N_t$ with intensity $\lambda_t$. Then I want to compute the following integral
$\mathbb{E} \left(\int f(t,N_{t-}) d\tilde{N}_t\right)^2$
for some smooth enough function $f$ and $d\tilde{N}_t=dN-\lambda_t dt$ denotes the compensated process.
Is it true that
$$ \... |
Let
\begin{align*}
X_t=\left(\int_0^t f(s,N_{s-}) d\tilde{N}_s\right)^2
\end{align*}
and
\begin{align*}
Y_t = \int_0^t f(s,N_{s-}) d\tilde{N}_s.
\end{align*}
By It$\hat{\text{o}}$'s product rule for jump processes (see Corollaries 11.4.10 and 11.5.5 of [this book][1]),
\begin{align*}
X_t &= 2\int_0^t Y_s dY_... |
The classic textbook theta decay shows that it accelerates until expiry. It is frequently shown with regards to the option value as shown below.
[![enter image description here][1]][1]
This only holds for ATM options though, because an ITM option will not be worth zero at expiration, and an OTM option will alrea... |
The following structured note (full terms of which are available at [EDGAR][1]) is linked to the S&P500, but seems to be at least as good as the underlying in all situations. I don't understand how the bank can afford to issue it. I know owners of the note forgo dividends and are exposed to the credit risk of the issue... |
How to construct a forward exposure portfolio with bonds? |
Imagine that the underlying stock price is 110. The call option has a strike price of 100. The annualized volatility is 25% and the interest rate is 10%. Finally, the time to maturity is 0.5 years. We sell this call option and we want to hedge it.
According to the Black-Scholes model, this option has a delta of 0.81... |
With a calendar spread (buying back, selling front), max loss is defined as some variant of "maximum potential loss is the cost of opening the trade (Premium Paid − Premium Received = Total Debit)"
What is the intuition/rationale behind this being the max loss? |
kwinto's answer is correct. This paper [1] might be helpful in understanding the chain of reasoning (specifically equations (3) and (4) in the cited paper).
Gatheral et al. observe the discrete volatility process $m(q,\Delta)$,
$$m(q,\ell) = \frac{1}{N}\sum_{k=1}^N|\log(\sigma_{k\ell})-\log(\sigma_{(k-1)\ell})|^q.$... |
kwinto's answer is correct. This paper [1] might be helpful in understanding the chain of reasoning (specifically equations (3) and (4) in the cited paper).
Gatheral et al. observe the discrete volatility process $m(q,\ell)$,
$$m(q,\ell) = \frac{1}{N}\sum_{k=1}^N|\log(\sigma_{k\ell})-\log(\sigma_{(k-1)\ell})|^q.$$
... |
I'm reading Merton's *Optimum Consumption and Portfolio Rules in a Continuous-time Model*, and don't understand the step where he goes from discrete to continuous time. Specifically, my confusion is about the snippet below.
By the footnote, $P(t)$ is assumed to be right-continuous. If so, then $\lim_{h\to 0}P(t+h)=P... |
With a calendar spread (buying back, selling front), max loss is defined as some variant of "maximum potential loss is the cost of opening the trade (Premium Paid − Premium Received = Total Debit)"
What is the intuition/rationale behind this being the max loss? (edit: assuming that the position is closed when the sh... |
I'm reading Merton's *Optimum Consumption and Portfolio Rules in a Continuous-time Model*, and don't understand the step where he goes from discrete to continuous time. Specifically, my confusion is about the snippet below.
By the footnote, $P(t)$ is assumed to be right-continuous. If so, then $\lim_{h\to 0}P(t+h)=P... |
Consider the following three derivative styles and assume zero dividends for simplicity.
The "american style", "european style", and "infinite" style:
$$L_{A}(S,K,t,T)=f(K,S)\cdot I(t\leq T)$$
$$L_{E}(S,K,t,T)=f(K,S)\cdot I(t=T)$$
$$L_{\infty}(S,K,t,T)=f(K,S)$$
* If $f(K,S)=(S-K)^+$, we have the varian... |
I'm reading Merton's *[Optimum Consumption and Portfolio Rules in a Continuous-time Model][1]*, and don't understand the step where he goes from discrete to continuous time. Specifically, my confusion is about the snippet below.
By the footnote, $P(t)$ is assumed to be right-continuous. If so, then $\lim_{h\to 0}P(t... |
I'm still troubled by a rather basic question, namely when is a perfect fit to the vanilla skew really necessary?
I think if you are trading vanilla options and/or Europeans that can in theory be perfectly replicated by vanillas (obviously) a `perfect' fit to the vanilla skew is desirable.
Other than that I'm no... |
When is a perfect fit desirable? |
Look at eq.(7), its RHS is an explicit expansion of what is defined in LHS of eq.(2) with $q=2$. Now, look at RHS of eq.(2), it defines $E[|Z|^2] \ l^{2H}$. So, $\nu = \sqrt{E[|Z|^2]}$ is the volatility by definition. Volatility of what? Right, of $ \log \sigma $.
Alternatively, just look at eq. (3)-(4). In (3) $\si... |
Options skew: when is a perfect fit desirable? |
I'm reading Merton's *[Optimum Consumption and Portfolio Rules in a Continuous-time Model][1]*, and don't understand the step where he goes from discrete to continuous time. Specifically, my confusion is about the snippet below.
By the footnote, $P(t)$ is assumed to be right-continuous. If so, then $\lim_{h\to 0}P(t... |
I am reading the [article][2] where different approximations for pricing of basket options presented. I have tried to repeate the result obtained by the Gentle's method on Python.
We define the price of a basket of
stocks as the weighted average of the prices of $n$ stocks at maturity $T$
$$
B(T) =\sum^n_{i=1}
w... |
I strongly recommend Robert Shiller's ["Financial Markets"][1].
[1]: https://youtube.com/playlist?list=PL8FB14A2200B87185 |
I am reading the [article][2], where different approximations for the pricing of basket options are presented. I have tried to reproduce the result obtained by the Gentle's method in Python.
We define the price of a basket of stocks as the weighted average of the prices of $n$ stocks at maturity $T$
$$
B(T) =\sum^... |
I am reading the [article][2], where different approximations for the pricing of basket options are presented. I have tried to reproduce the result obtained by the Gentle's method in Python.
We define the price of a basket of stocks as the weighted average of the prices of $n$ stocks at maturity $T$
$$
B(T) =\sum^... |
Consider the following three derivative styles and assume zero dividends for simplicity.
The "american style", "european style", and "infinite" style:
$$L_{A}(S,K,t,T)=f(K,S)\cdot I(t\leq T)$$
$$L_{E}(S,K,t,T)=f(K,S)\cdot I(t=T)$$
$$L_{\infty}(S,K,t,T)=f(K,S)\quad(\text{as in }L_A\text{ with }T\rightarrow \... |
To my understanding, QuantLib does not have a notion of a fiscal year. It does implement an Indian calendar, which is the calendar used by the National Stock Exchange of India and which can be initialized via
Calendar myCal=India();
In terms of the day count convention you would then have to find the appropriate ... |
For normal banks, higher interests means more profits. Why is SVB Bank the opposite? |
What made SVB Bank to be uniquely negatively affected by higher interest rates? |
I am looking for volatility surface parametrisation model used for bond options. I know that most popular for options on equities its SVI, on FX its Vanna-Volga, on rates its SABR. What about bond options? |
I am trying to understand if there is a version of the black model that can use Normal volatilities instead of Lognormal volatilities while valuing interest rate caps and floors? |
Is there a way to use normal volatility in the Black model to value interest rate caps? |
I am trying to understand if there is a version of the Black–Scholes–Merton model that can use Normal volatilities instead of Lognormal volatilities while valuing interest rate caps and floors? |
Is there a way to use normal volatility in the Black–Scholes–Merton model to value interest rate caps? |
The following 5 year, zero coupon, structured note, issued at par (full terms of which are available at [EDGAR][1]) is linked to the S&P500, but seems to be at least as good as the underlying in all situations. I don't understand how the bank can afford to issue it. I know owners of the note forgo dividends and are exp... |
For simplicity, let's suppose the underlier follows a Geometric Brownian Motion $S_t\sim\text{GBM}(\mu, \sigma), t\ge 0$ with $S_0=1$. A discretely-observed binary autocall note is a derivative structure with observation dates $t_1<t_2<\cdots<t_n$ and pays the investor a high coupon $c$ on the first observation date on... |
I am a little confused. I have calculated the tracking difference of an Index and an ETF using the return getting 0,4% tracking difference per year. I have then leveraged both, the Index and the ETF to a lever of 2 getting 0.63% tracking difference per year. I have then done some testing with hypothetical value and got... |
I am a little confused. I have calculated the tracking difference of an Index and an ETF using the return getting 0,4% tracking difference per year. I have then leveraged both, the Index and the ETF to a lever of 2 getting 0.63% tracking difference per year. I have then done some testing with hypothetical value and got... |
I am looking for volatility surface parametrisation model used for treasury futures bond options. I know that most popular for options on equities its SVI, on FX its Vanna-Volga, on rates its SABR. What about bond options? |
Say I have a T daily observations for the last ten years on a new predictor $x_t$ which I think is a predictor of the expected weekly return on the stock market, $r_{t,t+5} = r_{t+1}+...+r_{t+5}$, where $r_t$ is log return for that period. In this case, how can I test the null hypothesis that $x_t$ has no predictabilit... |
I'm currently learning Quantlib using C++ and am following the very good instructions here:
https://www.quantlib.org/slides/dima-ql-intro-2.pdf
Specfically on building piecewise yieldcurves (slide 102) the example code gives the following output:
Settlement Date:September 15th, 2009
Zero 3M: 0.299690 ... |
I'm currently learning Quantlib using C++ and am following the very good instructions here:
https://www.quantlib.org/slides/dima-ql-intro-2.pdf
Specifically on building piecewise yieldcurves (slide 102) the example code gives the following output:
Settlement Date:September 15th, 2009
Zero 3M: 0.299690... |
I'm currently learning Quantlib using C++ and am following the very good instructions here:
https://www.quantlib.org/slides/dima-ql-intro-2.pdf
Specifically on building piecewise yieldcurves (slide 102) the example code gives the following output:
Settlement Date:September 15th, 2009
Zero 3M: 0.299690... |
I had a question about the coupon level determination for a simple reverse convertible product.
Assuming risk free rates are 4% while premium on short put is 5%, typical text-books would then quote the coupon at 9%.
Can't I expect a slightly higher coupon, by reinvesting the put premium received at inception at the... |
Using QuantLib I want to price a Floating rate bond whose coupons are capped at some rate.
I understand I could price the coupon caps separately and then add that to a zero-bond.
However, I've noticed that in `FloatingRateBond` QuantLib allows to specify `caps` attribute for cap rates of the coupons.
What I d... |
am trying to simulate the SFGK model from the paper "Statistical theory of the Continuous Double Auction", Eric Smith, J. Doyne Farmer, Laszlo Gillemot and Supriya Krishnamurthy [1].
The model simulates the Limit order book for various parameter values. The arrival processes are assumed to be poisson. The simulatio... |
In many market impact papers, there is a standard power-law relation in the form of
$$MI = Y\sigma(\frac{Q}{V})^{\delta}$$
where $\sigma$ is volatility, $Q$ is volume traded, $V$ is market volume and $MI$ is the price impact. $Y$ and $\delta$ are constants to be fit, where $\delta$ is usually from 0.4~0.7.
Sou... |
While valuing Interest Rate Caps/Floors in Bloomberg, I saw that we have an option for selecting both Model and Volatility. So, my question is how exactly does Bloomberg value the cap/floor, when we use model as "Black Scholes Merton" and Volatility as "Normal". Is it that Bloomberg converts Normal vol to Lognormal vol... |
How does Bloomberg calculate Interest Rate Caps/Floors with Black Scholes Merton Model and Volatility set as "Normal"? |
From Joshi's Quant Interview book:
The statistics department from our bank tells you that the stock price has followed a mean reversion process for the past 10 years, with annual volatility of 10% and daily volatility 20%. You want to sell a Euro option and hedge it. Which volatility do you use?
Now, I see from t... |
In many market impact papers, there is a standard power-law relation in the form of
$$MI = Y\sigma(\frac{Q}{V})^{\delta}$$
where $\sigma$ is volatility, $Q$ is volume traded, $V$ is market volume and $MI$ is the price impact. $Y$ and $\delta$ are constants to be fit, where $\delta$ is usually from 0.4~0.7.
Sou... |
I'm currently learning Quantlib using C++ and am following the very good instructions here:
https://www.quantlib.org/slides/dima-ql-intro-2.pdf
Specifically on building piecewise yieldcurves (slide 102) the example code gives the following output:
Settlement Date:September 15th, 2009
Zero 3M: 0.299690... |
In many market impact papers such as "[Anomalous price impact and the critical nature of liquidity in financial markets](https://arxiv.org/pdf/1105.1694.pdf)" by Tóth et al (2018), there is a standard power-law relation in the form of
$$MI = Y\sigma(\frac{Q}{V})^{\delta}$$
where $\sigma$ is volatility, $Q$ is vol... |
I am trying to compute the YTM of the following Zero-Coupon Bond:
[![enter image description here][1]][1]
The issue date was 13-01-2022 and the maturity date was 14-01-2023.
For me, it seems strange that the price remains "almost constant" when expiration approaches, I expect to tend to 100.
Also, I've manu... |
I am trying to find a way to validate available stock market data (because I found so much disagreement between different sources) and went through a 10-K report, hoping to find any mentioning of the market price of common stock of that company (Exxon Mobil in this case). I know that the market price is somewhat irrele... |
These are extension questions to Joshi's Quant Interview Book.
(1) Given the choice between two different static replicating portfolios that match an option's payoff, what criteria would you use to decide between the two?
-- The first things that come to my mind are the following:
(i) Which replicating portfol... |
am trying to simulate the SFGK model from the paper "Statistical theory of the Continuous Double Auction", Eric Smith, J. Doyne Farmer, Laszlo Gillemot and Supriya Krishnamurthy [1].
The model simulates the Limit order book for various parameter values. The arrival processes are assumed to be poisson. The simulatio... |
I am trying speed up below code for faster speed,
```python
df = df.ewm(span=lookback).std()
```
I wrote a numba version but it is very slow in large dataset
```python
from numba import njit
@njit
def ewmstd(arr, span):
'''
var_pandas = df.ewm(span=N).var()
std_pandas = df.ewm(span=N).std()
... |
How to use talib calculate the ewmstd? |
In Lorenzo Bergomi, Stochastic Volatility Modeling, Chapter 5 Appendix A.1, Equation (5.64), seems to assume $\hat\sigma$ to be constant. If that is the case, why do we bother to invoke the Feynman-Kac formula? We can simply use the Black-Scholes formula. |
In Lorenzo Bergomi, Stochastic Volatility Modeling, Chapter 5 Appendix A.1, Equation (5.64), as shown below, seems to assume $\hat\sigma$ to be constant. If that is the case, why do we bother to invoke the Feynman-Kac formula? We can simply use the Black-Scholes formula.
[![enter image description here][1]][1]
... |
I am trying speed up below code for faster speed,
```python
df = df.ewm(span=lookback).std()
```
I wrote a numba version but it is very slow in large dataset
```python
from numba import njit
@njit
def ewmstd(arr, span):
'''
var_pandas = df.ewm(span=N).var()
std_pandas = df.ewm(span=N).std()
... |
How to use Ta-Lib to calculate the ewmstd? |
I am trying to understand the risk exposures of vanilla options that also have a European barrier on realized volatility. For example, the option could knock out if the realized volatility over the time of the option exceeds a certain value (which could be set to be relatively low in order to cheapen the option). How w... |
As you say, TA-Lib does not have a built-in function to calculate the exponentially-weighted moving standard deviation. You can use ta.EMA to modify your function. Is this what you are looking for?
import numpy as np
import talib as ta
def talib_ewmstd(arr, span):
N = span
a = 2. ... |
As you say, TA-Lib does not have a built-in function to calculate the exponentially-weighted moving standard deviation. You can use ta.EMA in your function. Is this what you are looking for?
import numpy as np
import talib as ta
def talib_ewmstd(arr, span):
N = span
a = 2. / (1 +... |
I am looking for historical quotes for US TIPS (treasury inflation protection security). What is a reliable source of data to get this information?
Here's what I have tried:
1. I have looked into this question: [What data sources are
available online?][1]. But nothing useful on TIPS.
2. I have looked in... |
In Sheldon Natenberg's *Options Volatility & Pricing*, he writes:
> There is an important distinction between an option position and an underlying position. The expected value for an underlying contract depends on all possible price outcomes. The expected value for an option depends only on the outcomes that result... |
How to calculate expected value for an underlying contract and expected value for an option? |
I think the issues is because of the payoff function. You should replace the maximum() with HeavisideApprox(). Read this paper: [https://papers.ssrn.com/sol3/papers.cfm?abstract_id=1626547][1]
Here's the codes:
# use either jax or autograd functions, same format
import autograd.numpy as np # import jax.n... |
I think the issues is because of the payoff function. You should replace the maximum() with HeavisideApprox(). Read this paper: [https://papers.ssrn.com/sol3/papers.cfm?abstract_id=1626547][1]
Here's the codes:
# use either jax or autograd functions, same format
import autograd.numpy as np # import... |
From call-put parity one can derive that $\Delta_C - \Delta_P = 1$. We also know that $\Delta_C = e^{-qt}N(d_1)$. If $e^{-qt} = 0.85$ then there is no value for $d_1$ for a $\Delta_C = 0.9$ as $ 0 <= N(d_1) <= 1 $. Therefore there is no way to get a strike with $\Delta_C = 0.9$.
But from the first equation, we have... |
I wanted to get sell, buy and recent trades of a currency in intervals of seconds but was only able to find APIs which offer a minimum interval of one minute (I checked Polygon and Alpha Advantage). Is there anything available to obtain real-time forex data in seconds, or is there nothing? |
Is there a API to obtain real-time forex data in seconds? |
In Trading Volatility by Bennett, he says:
> If there is a sudden decline in equity markets, it is reasonable to
> assume realised volatility will jump to a level in line with the peak
> of realised volatility. Therefore, low-strike, near-dated implieds
> should be relatively constant (as they should trade near t... |
Does skew flatten with a decline in volatility? |
In Trading Volatility by Bennett, he says:
> If there is a sudden decline in equity markets, it is reasonable to
> assume realised volatility will jump to a level in line with the peak
> of realised volatility. Therefore, low-strike, near-dated implieds
> should be relatively constant (as they should trade near t... |
In Excel, I have the monthly stock price data for the past five years for Asset A and Asset B. I have calculated the monthly returns, mean returns, variances, and standard deviations for both stocks as well as the covariance and correlation.
Then I calculated the weighted portfolios of Asset A and Asset B calculatin... |
I am trying to find a way to validate available stock market data (because I found so much disagreement between different sources) and went through a 10-K report, hoping to find any mentioning of the market price of common stock of that company (Exxon Mobil in this case). I know that the market price is somewhat irrele... |
I am aware that Day One Profit is something that all banks calculate and report etc. I have not managed to find a free comprehensive review of it, what is it, how it's calculated, who and why requests to calculate it, what are its implications etc. Most are either too technical or too specific considering prior knowled... |
What is Day One Profit and why is it a matter/important? |
Why do we use the micro price (`(Bsize * Aprc + Asize * Bprc) / (Asize + Bsize)`) rather than fixing `Asize` and `Bsize` to some constant and weighting the `Aprc` and `Bprc` to this value? Does the micro price not suffer if someone places a new low ask/high bid but in small size? |
Why do we use the micro price $(B_{\text{size}} \times A_{\text{price}} + A_{\text{size}} \times B_{\text{price}}) / (A_{\text{size}} + B_{\text{size}})$ rather than fixing $A_{\text{size}}$ and $B_{\text{size}}$ to some constant and weighting the $A_{\text{price}}$ and $B_{\text{price}}$ to this value? Does the micro... |
Why do we use the micro price $$p_m = \frac{B_{\text{size}} A_{\text{price}} + A_{\text{size}} B_{\text{price}}}{ A_{\text{size}} + B_{\text{size}}}$$ rather than fixing $A_{\text{size}}$ and $B_{\text{size}}$ to some constant and weighting the $A_{\text{price}}$ and $B_{\text{price}}$ to this value? Does the micro pr... |
In section 25.1, sub-section "Credit Default Swaps and Bond Yields", of "OPTIONS, FUTURES, AND OTHER DERIVATIVES", John Hull defines "CDS–bond basis = CDS spread - Bond yield spread", and claims "The effect of the CDS is to convert the corporate bond to a risk-free bond (at least approximately). [...] [This] suggests t... |
Why do we have CDS + Bond = Treasury? |
I can use Black Scholes or Bjerksund Stensland to solve for delta given spot price, strike, expiration, vol, interest rate, etc. But is there a direct solution to solve for spot price given delta, strike, expiration, vol, etc? I can search for delta by plugging in different values of spot price and seeing what value ... |
I can use Black Scholes or Bjerksund Stensland to solve for delta given spot price, strike, expiration, vol, interest rate, etc. But is there a direct solution to solve for spot price given delta, strike, expiration, vol, etc? I can search for delta by plugging in different values of spot price and seeing what value ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.