instruction
stringlengths
35
27.7k
I have the following exercise, where a closed-form solution is needed for the PV of the cash flows. The teacher's solution is the following: But I fail to understand how exactly we get to it in the 1st place. A detailed, step-by-step solution would be immensely appreciated.
Suppose that I am placing a market order directly in the order book of an exchange. For market orders, it seems quite clear that larger orders obtain larger spreads due to the fact that - without loss of generality - a large market buy order must reach further into the limit sell orders of the order book than would a s...
Is it possible to get hourly or minute-by-minute data (in the form of a dataframe) in Python using one of the API wrappers (xbbg or pdblp)? Using the former, blp.bdh and blp.bdip don't seem to work. The latter only gives bar data, which I understand isn't available for more than 140 days.
Wanted a reference request for any source has discussed how to clean/adjust historical volatility/ historical implied volatility time series for Earnings. The RV/IV time series data have a lot of outliers around earnings which can be detrimental to model data for normal regimes.
Asset pricing uses the concept of a stochastic discount factor (SDF). I have read various things about it but have not seen a concrete example. Could you give a concrete example of an SDF, e.g. one that has been estimated in an academic paper or being used by practitioners? (E.g. could it be F-distributed? Lognormally ...
may I know how to arrive at $3.8m/DV01 SOFR futures based on the net long 3M SOFR as at 13 Dec. The net long is 23,333. Original Text: Hedge funds were net buyers in around \$3.8m/DV01 SOFR futures over the week, turning net long the futures for the first time since March; further out the curve hedge funds extended net...
what does a negative and a positive intercept imply in spanning regression or factor redundancy test? For example, value factor is regressed on the mkt, smb, rmw, and cma and the intercept is negative and insignificant. What will be the interpretation of this intercept in connection with the set of other factors?
What is the trade description behind a call option on a forward? How can it be described with words and not with mathematical formulas? So what is the intuition behind the following payoff: $$Payoff_{1}=\max\left(F\left(T,\tilde{T}\right)-K,0\right)$$ and how does it differ from the following payoff: $$Payoff_{2}=\max\...
I feel I am fundamentally misunderstanding something when it comes to options on futures. On the bottom of page 98 of 2nd edition Option volatility and Pricing by Natenberg he says: "In the US, options on futures are subject to stock-type settlement, while outside the US, options on futures are usually subject to futur...
I'm interested in real practices of hedging interest rate caps and floors. There are plenty of articles explaining pricing of interest rate derivatives, but not so many explaining hedging such derivatives in practice. How do banks manage their interest rate caps and floors books? The easiest approach seems to be delta-...
I understand the finance 101 explanation of how to minimize variance of a long-short portfolio using a covariance matrix. I also know that it doesn't really work because the covariance matrix is unstable out of sample. It has been suggested that in practice factor risks are more stable out of sample, but I don't quite ...
I have the european volatility surface of a given asset. What is the correct procedure to compute the price of the options with american exercise type?
This may sound like a basic question but I have seen many large institutional investors have this as part of their asset allocation and am wondering why they do this? Does it make sense to have a large allocation to short term funds (such as repo and other short term fixed income instruments); and simultaneously have a...
I'm trying to program a basic forex simulator in order to test strategies. But I don't know how is influenced the market when a position is opened or closed. For example, if I open a 10 000 000 € BUY order on EURUSD, I think It will decrease the quote of the EURUSD value. But maybe I'm wrong, and I don't know how much ...
Looking at Opdyke, J.D., Comparing Sharpe Ratios: So Where are the P-Values?, page 22 (Appendix A) an application is given for the Propagation of Errors formula on a ratio of two random variables: $$\operatorname{Var} (x_1/x_2)=\left[ \frac{E[x_1]}{E[x_2]}\right]^2\left[\frac{Var(x_1)}{E[x_1]^2} + \frac{Var(x_2)}{E[x_2...
The classical Markowitz objective is: $$ f(w) = w^T \mu - \frac{\lambda}{2} w ^T \Sigma w = \mathbb{E}[r^Tw] - \frac{\lambda}{2} \sigma^2(r^Tw) $$ where $\mu$ is the vector of mean returns. This is a quadratic function, and we can directly/analytically solve for the solution in the unconstrained case, as well as in cas...
Everyone knows assumptions of normality etc are bad and that the expected distributions of financial quantities (such as returns) change depending on the circumstances. We know that we can compute the asymptotic optimal EV position sizing by solving the integral associated with a distribution (generalized Kelly). So wh...
I am aware that there is an active CDS market for insurance from US sovereign default (in terms of treasury bond) as Dimitri Vulis commented. I am looking for the historical data in time series on this CDS (premium). I was trying to get historical CDS data from Bloomberg and found ticker US CDS USD 5Y as viewed below ...
In Joel Greenblatt's Magic Formula why is the holding period one year? Why not rebalance the portfolio once each two years? Or three years?
For vanilla options put-call parity $$ C - P = F $$ must hold. On the other hand, it can happen that puts can have different implied vols than calls, due to for example shorting restrictions, borrowing costs, or if the underlying is not traded. My interpretation would be that a long call and short put must have the sam...
My current understanding of the theory behind the convergence of options prices using trees is the following: Suppose $S = (S_{t})_{0\leq t\leq T}$ is the underlying process and $g(S_{t}:0\leq t\leq T)$ is the option we want to evaluate. Then we want to construct trees $S^{N}$such that $S^{N} \Rightarrow S$ (Here $\Rig...
I recently came across an example (Section 5.2.9 here) which does a simple delta hedging experiment. Below are the details: Market conditions Interest rates are at a 2% level --> r = 0.02 The underlying stock pays no dividend and follows a Geometric Brownian Motion (GBM) with µ = 10% and σ = 20% The initial spot price...
New to Vol trading - wondering if there are any good references on calculating PnL from options strategies if I only have a volatility surface (delta or moneyness) and no individual options prices. Also wondering is it possible to compute variance swap PnLs directly from implied volatility surfaces? Or do I need a pric...
I am reading this market making paper, and am trying to understand the transformation presented on page 6. A good resource for background relevant to the transformation is this other market-making paper. Could anyone point me to a resource on this transformation?
I know this is back to basics but I am perplexed by it!!! Assume that the future value (FV) of an investment at the end of year 1 is 112, the annual arithmetic expected return is 12%, hence the present value (PV) today is 100 since 112/(1.12)=100. It is also evident that the monthly arithmetic average expected return i...
I have two very simple question about the implied volatility of a swaption and how it relates to actual rates level. Suppose we have two famous models, Bachelier and Black. Under either model, the swap rate $S(T)$ for a standard swaption with maturity $T$ and Brownian Motion $W(t)$ is given by for Bachelier $S(T) = S(t...
Look in any finance textbook or search about CAPM, it will say that CAPM is a model about how portfolios have systematic risk (risk that can't be diversified away) and idiosyncratic risk (risk that can be diversified away). But it appears to me that this is impossible to justified based on CAPM alone, which is a model ...
The term "algo wheel" has been flying around for some time yet I have yet to find a consistent definition. It obviously has to do with making trading strategies more comparable, but where did the term first come up, what are different versions/solution providers and where is a good starting point? On top of it, has any...
In the SABR model, the parameter beta largely controls the back-bond behaviour of the model. How do people estimate beta? One approach is to regress atm vol vs forward, i.e. $$\ln(\textrm{atm vol}) = \ln(\alpha) - (1-\beta) \times \ln(\textrm{forward}).$$ which comes from the SABR model (expansion). Are any other appro...
Consider an extension to the (one-dimensional) geometric Brownian motion model, $$dS_t = \mu(t,S_.)S_t dt + \sigma(t, S_.)S_t dB_t,$$ where $\mu$ and $\sigma$ are previsible path functionals, i.e. they depend on the path, denoted by $S_.$ of the stock price, at least up to the current time $t$. Then consider the functi...
So I have the following formula for the Pricing of a Quanto Option (see image below). While I understand this formula pretty well, I am not sure what is referred to as "domestic exchange rate" (can be seen in the two last lines of the picture). Indeed, does domestic exchange rate mean domestic/foreign, or foreign/domes...
So I currently work in MO G10 rates sales support and we always get referrals from our setts department to recalculate discrepancy's in vanilla swaps trades coupon payments, this issue is, training within my bank is very limited and would love to get some help in calculating these, does anyone have any links to excel t...
Most financial advisors recommend to inexperienced investors to put a large part of their investment in broad index funds (e.g. SPY). They will usually reiterate that most actively managed funds underperform their benchmarks, that most day traders lose money, etc., in other words that beating the market is exceptionall...
I am currently calculating daily returns of a stock with the following formula: $$R_t = \frac{P_t - P_{t-1}}{P_{t-1}}$$ However, once I have the data, I am unable to establish a range to classify the daily returns as a usual move or as an unusual move Is there a statistical method to differentiate the days with unusual...
When delta-neutral market making it is important to construct a mid price. Often the mid price of the asset you are trading is influenced by another (correlated) asset. What methodologies would you recommend to combine the returns of the leading asset into the mid price for the asset I am trading? Linear regression (va...
Suppose that the current stock price is $€100$, the exercise price is $€100$, the annually compounded interest rate is 5 percent, the stock pays a $€1$ dividend in the next instant, and the quoted call price is $€3.50$ for a one year option. Identify the appropriate arbitrage opportunity and show the appropriate arbit...
Consider a GBM model with Heston volatility: $$dS_t = \mu S_t dt + \sqrt{V_t} S_t dB_t^1$$ $$dV_t = \kappa(\theta-V_t)dt+\xi \sqrt{V_t}dB_t^2,$$ where $(B_t^1, B_t^2)$ is a correlated BM. Let $$\mathscr{F}_t^S=\sigma(S_u : u\leq t),$$ and consider the filter estimate of the variance $V$ $$\hat{V}_t = \mathbb{E}(V_t | \...
I am in a Black Scholes market with the usual riskless asset $B$ and risky asset $S$ with dynamics given by \begin{align*} dB_t &= rB_t dt, B_0 = 1, \\ dS_t &= rS_t dt + \sigma S_t dW_t^{\mathbb{Q}}. \end{align*} I am asked to use the probabilistic risk-neutral pricing formula to calculate the price of an option with p...
I’m looking for some papers/articles for the transition from LIBOR to SOFR for future flow transactions/securitizations (such as Diversified Payment Rights). Would be happy if you could share some as there are very few sources on the SOFR transition of this product type.
A cohort-based model groups individuals with at least one common characteristic over a period of time through a state-transition process. A population-based model reflects as much information as possible about a demographic of the target population. Based on these definitions, a population-based model should be preferr...
In the paper by Beiglböck et al, I encountered the following description of the no-arbitrage framework (see screenshot below). What is the meaning of this coordinate process $S_i$? How does it relate to the usual postulation of The First Fundamental Theorem of Asset Pricing, i.e, that a discrete market on a discrete pr...
I am struggling to reconcile the cashflow of a floating rate bond. I created a reference index of 5% flat, then a bond that pays quarterly coupon with Actual/360. For example, I'd expect the coupon on 4/15/2023 (accrual from 1/15-4/15) to be 90/360*5%*100 = 1.25 exactly. Maybe it needs to be converted from continuous t...
A compound Poisson random vector $Y$ is well defined in this site in wikipidia. Nothing prevents me from compound strictly stationary stochastic processes instead of compound random vectors. The definition is the same: let $X= (X_t)_{t\in \mathbb Z}$ be a strictly stationary stochastic processes, so $Y= (Y_t)_{t\in \ma...
When making a high-frequency or mid-frequency prediction on an assets return, what are the advantages and disadvantages of making a continuous prediction vs a prediction that only fires on a particular event? For example my model might have a number of features: order imbalance, trade imbalance etc Do I want to make a ...
I am trying to implement the calibration algorithm presented in the "ESSVI Implied Volatility Surface" white paper from Factset by Akhundzadeh et al. The eSSVI model includes 2 variables that must be calibrated to option market IV data slice by slice $(ρ_2,ψ_2)$ with a specific bound constraint to take note of: $$ |\rh...
https://economics.stackexchange.com/questions/16115/what-is-the-equation-mathbbemr-1 The above post asks what $$\mathbb{E}[mR]=1$$ means and gets some great answers. From the first answer is seems that the physical rather than risk neutral probabilities are used to take the expectation. I'm reading the paper "Character...
I am required to prepare a portfolio containing 10 companies and analyse their returns over 10 years utilising the Fama-French 3 factor and Carhart 4 factor models. I chose the largest market cap companies from the DJIA in 2022 and obtained the following results for my 10-year sample (2012 - 2021): Variable Coeffic...
I'm tasked with the problem of setting up a cap/floor trading on an emerging market which doesn't have any interest rate derivatives traded yet besides plain vanilla interest rate swaps. We intend to sell these options to non-financial companies as an insurance against raising or falling rates, so only ask quotes are o...
When backtesting a trading strategy using Walk Forward Analysis/Optimization, I see people split each window into training and testing sets. Suppose you want to select the best combination of MAs for your MACD strategy, you would first try the different combinations on your training set, select the best one, and report...
I am reviewing a fellow students paper, and it is argued in this paper that the Sharpe Ratio can differ based on which model is used to analyze the portfolio returns. Here a model based on the Arbitrage Pricing Theory which includes macroeconomic variables, and a classic CAPM model. It is argued that the they calculate...
I was listening to a podcast and this guy mentioned the following (literally): The entire group is probably running 800 million at risk. So I'm going to say like call that like a, if you think of risk as the 1% tail risk you said may 250 million standard deviation, so it's probably somewhere around like a two and a ha...
How could we calculate VaR for a futures contract or a option position? I know that a VaR is calculated by the return multiply the investment amount, but how could we calculate the investment amount of a future contract or options? Espeically for short position, the above formula become more confused. Anyone give a hin...
I try to make a P&L explanation of a swap from the delta, gamma, to the N instruments of the rate curve (money market, futures and swap). I use a perturbative shock of 1bp for each instrument of my rate curve used in the pricing: the result I get is strongly degraded if I integrate the gamma in the P&L explanation (th...
I have a strong background in finance and I know how to code, but I am lacking the statistical modelling part. I have started courses in mathematics and statistics. However, it is turning out very difficult to adapt that general knowledge to the actual in-use strategies. So, I have thought about starting with papers th...
I have 2 discount factor curves; DF 1 I expected every DF curve to have the shape of the 2nd one (almost a straight line), what does it mean economically when a DF curve has the shape of the 1st one? or maybe the curve is wrong? How could a shorter CF 2036 offer a higher yield than the latter CF 2041 DF 2 EDIT: In th...
For a pairs trade, when calculating the zscore should I include the intercept point in the calculation: spread = price2 - (gradient * price1) - intercept zscore = (spread - average)/standard_deviation or should I exclude the intercept: spread = price2 - (gradient * price1) zscore = (spread - average)/standard_deviatio...
Looking at the spread between 3 month commercial paper and the 3 month bill (using say, Fred), how/why (economically speaking) can this spread be negative? Are there some mechanics in the commercial paper markets at play that could make this happen? Or are there some idiosyncrasies with how these data-series/rates are ...
I'm working on a Interes Rate Risk in Banking Book model for EVE calculation. It doesn't matter if you know what it is or not, I just need help with one step. That step is the creation of risk free yield curve for Euro currency. I'm using Moorad Choudhry book 'Banking Principles 2nd'. In one of the examples, he provide...
For a pairs trade, when calculating the zscore should I include the gradient (slope) from OLS in the calculation: spread = price2 - (gradient * price1) zscore = (spread - average)/standard_deviation Should the spread calculation include the gradient: spread = price2 - (gradient * price1) or just spread = price2 - pri...
why doesn't futures contract just stipulate a specific contract to be delivered. Is it because the futures seller cannot readily buy specific bond contracts?
With the Fed raising interest rates so fast and so drastically, classical interest rate models such as the Black Karasinski (BK), Hull-White (HW), etc., may have trouble calibrating to current rate levels and at the same time passing backtesting due to resent negative rates, For example, you can shift BK to capture the...
I am re-reading Michael Lewis' Flash Boys book, and I have a question about how a High Frequency Trader was able to front-run an order in a particular example mentioned in the book. On page 78, chapter Ronan's Problem, it describes how the president of a large hedge fund noticed that his trading costs had increased sub...
I have persistent, deep problems with the concept of 'risk-neutrality'. To make it more precise, let's look at the following explanation taken from a book: "In a world where investors are risk neutral, the expected return on all securities is the risk-free rate of interest, r. The reason is that risk-neutral investors...
I am trying to calibrate SVI model using the following code import numpy as np from scipy import optimize from matplotlib import pyplot as plt spot = 1.3444 forward = 1.342782 t = 30 / 365.0 vols = np.array([9.420, 9.772, 9.237, 10.144, 9.196, 10.724, 9.265, 11.161, 9.390, 11.908, 9.751]) / 100 strikes = np.array([1.34...
On Jorion's 'Value at Risk' chapter about risk mapping, interest rate swaps are decomposed in a portfolio of forward contracts so they can be mapped into risk factors. I'm trying to implement this for some commodity swaps which P&L depend on three risk factors: the commodity forward price, the BRL risk free rate, and t...
I didnt find the answer in QuantLib library. This will surely help to get the track of quantlib version and installed package versions.
I am looking for a portfolio of ETFs and mutual funds that tracks market, size, value and momentum factors. One ETF/mutual fund per factor. So say that I want an ETF that tracks the value factor (let's call the return on that ETF $r^{value}_t$), what I am looking for is for an asset whose regression: $r^{value} = \alp...
I am trying to code the HAR (and eventually the HARQ) from Bollerslev et al 2016 and Corsi 2009. $$ RV_t = \beta_0 +\beta_1 RV^d_{t-1} + \beta_2 RV^W_{t-1}+\beta_3 RV^M_{t-1}+u_t $$ Bollerslev estimates the parameters as: $\beta_0 = 0.1123, \beta_1 = 0.2273, \beta_2 = 0.4903$, and $\beta_3= 0.1864 $ With these all bein...
I am working on a project and need to map different IDs. Is LEI and Bloomberg Ticker one to one mapping? I can use Bloomberg formular =BDP(A1,"LEGAL_ENTITY_IDENTIFIER") to convert ticker "DUK US Equity" in excel A1 to LEI, but did not find formular to reverse it. So I suspect there will be a non-1-1 mapping issue here....
I need to compute monthly realized variance from daily data for Fama-French factors. Knowing that Fama-French factors is the difference of return between different type of stocks, for example SMB factor is the difference between returns on portfolios of small stocks and portfolios of big stocks, should I again take the...
Tradition mean-variance optimization uses the following objective function in optimization: $$ \mu w^T - \lambda w^T \Sigma w $$ Which I'm trying to adapt to a factor model. I've come up with: $$ f \mu w^T - \lambda w^T \Sigma w f f^T $$ where: $f$ is the factor loadings (exposures) $\lambda$ is the risk aversion para...
Is it true that far wings of the volatility smile have an outsized influence on the price of a variance swap? Is there a mathematical argument demonstrating this idea? What do we generally refer as far wings (5% probability to hit the level or 1% probability etc.)? I could find no paper detailing this dependence.
I've created some macroeconomic factors (e.g. analogs of real GDP growth) that I believe have explanatory power for asset returns. By a factor here, I mean a stationary time-series of real numbers. I'd like to create so-called "mimicking portfolios" for these factors - e.g. portfolios of assets in my base universe whos...
When trying to value an American option we often use grid-based methods (e.g. Monte Carlo in combination with Longstaff Schwartz; or Finite Difference Methods). As such, we are in fact estimating the value of a Bermudan option with discrete time points where we can exercise the option, i.e. $0=t_0 < t_1 < ... < t_n = T...
I know that $$\sum_{i=1}^n i \frac{CF_i}{CF_{Total}}$$ is Macaulay Duration, but what is $$\sum_{i=1}^n i^2 \frac{CF_i}{CF_{Total}}$$. I have given it a thought like it is a second moment of something and for a few internet search this has a correlation with Convexity. Is it just convexity if not, what is it ?
I had a bid volatility data that had a concave shape. my question is how can I extrapolate for the the extreme strikes, and does the bid volatility goes to zero when strike->0 and strike-> infinity. I tried to approximate the smile by the following polynomial $(k,t)\rightarrow a_1+a_2k+a_3k^2+a_4t+a_5kt$ but I do not ...
I have heard that traders use a straddle to hedge volatility swaps (in the FX context), although I could not figure out the specifics. Is this type of hedge used in practice? And if yes, how does it work? Is there an approximation formula that could be written down to justify such a hedging strategy? This is a question...
When we talk about the single-period CAPM, the return in a particular period t can be defined as $(P_t - P_{t-1})/P_{t-1}$. Investors plan at t-1 and get a payoff at t. After this period, the same mechanics take place. Does the “new” Pt-1 have to necessarily be equal to Pt? In other words, is the return in each period ...
So we are looking at some security names with limited amount of listed options. Some of them only have listed options that expire in less than a year. Is there a quick way to extrapolate the vol surface / term structure based on listed options, forward price, and maybe index options with longer maturity? Many thanks!
I am reading the paper "A statistical theory of continuous double auction". The paper can be found at, https://www.santafe.edu/research/results/working-papers/statistical-theory-of-the-continuous-double-auctio On page 20, section F-3 titled "Screening of the market-order rate", the author states as follows. I am trying...
In a BS world (constant volatility, no transaction costs, continuous hedging) If I buy or sell an option and continuously delta-hedge, I know how to calculate the final expected PnL based on implied vs realized volatility, but how do I calculate the PnL at some point in time before expiry of the option? For example, I ...
Here's an apparent paradox that puzzles me. EMH states that asset prices reflect all information available. Investors are assumed to be rational. We can note: $E(p_{t+1}|\Phi_{t}) = (1+E(r_{t+1}|\Phi_{t}))*p_{t}$ Where E is the expected value operator. $p_{t}$ the price at time t, $r_{t+1}$ the expected one-period retu...
I'm running some stress tests and I have data on equity shocks available. Is there a relationship which, for the same issuer, links the returns of the shares with those of the bonds issued?
Here's a question that's been on my mind on-and-off for some time now. It's well known that Black-Scholes is an unsuitable model for pricing in the current (post 80s) market as it fails to capture the volatility smile/skew. A crude way around this is to calibrate a volatility surface by finding the volatility for which...
We have the following model for the short rate $r_t$under $\mathbb{Q}$: $$dr_t=(2\%-r_t)dt+\sqrt{r_t+\sigma_t}dW^1_t\\d\sigma_t=(5\%-\sigma_t)dt+\sqrt{\sigma_t}dW^2_t$$ What is the PDE of which the solution gives the price of the floorlet with the following payoff in $t=1$: $$X=0.5\bigg[ 2.5\%-L(0.5,1) \bigg]^+$$ where...
I am studying Monte Carlo Simulation with Stratified Sampling following Martin Haugh's lectures notes. As is it explained the variance of the estimator is $$ Var(\hat{\theta}_{st,n}) = \sum_{j=1}^{m} \frac{p_{j}\sigma_{j}^2}{n_{j}} $$ At the footnote of page 12 he specifies that $$Var(\hat{\theta}_{st,n})= \sum_{j=1}^{...
Say I have a portfolio of stocks, stock A, stock B and stock C, with the below positions: stock A: long 100 USD stock B: long 50 USD stock C: short 200 USD How do I calculate the portfolio variance given the covariance matrix? I guess this question boils down to: how do I obtain the weights for each stock? If I divid...
I am in the process of building a LMM model and I ideally want to use this not only to price LIBOR swaps at the current time but also provide a price distribution in a future time. For example we have that the forecasted IRS and/or forecasted LIBOR rate will follow a LN(5,0.05) distribution. Such that I can then use si...
Let me define the Spot price process of an underlying as follows: $$dS_{t}=\mu_{S}S_{t}dt+\sigma_{S}S_{t}dW_{t},$$ where $\left(W_{t}\right)_{t\geq0}$ is an appropriate Wiener-process, so $\left(S_{t}\right)_{t\geq0}$ is a simple geometric Brownian motion. Let me define the following payoff: $$X=S_{T}-K$$ In this case ...
In view of this question I asked some time ago, I tried to calibrate a Vasicek model to some cap volatilities, given as follows. I consider the maturities (in years) $$ 0.5,1,2,3,4,5,7,10,15,20 $$ and the corresponding ATM market cap volatilities with $\tau_i = 0.25$ year fraction according to the Book by Brigo and Mer...
I am building a tool with Quantlib (Python) to work on the forward pricing of different types of assets (inflation linked, amortizing, vanilla, zero coupon bonds). For a number of reasons I am using the bonds cashflow series as provided by an internal system. From the same system I can get the discount factors associat...
I am trying to add a holiday to my calendar in QuantLib such that my option pricing model considers this in pricing where I would expect that the time to expiry should decrease with the inclusion of a holiday, and my option reduce in price. However, when I use the .addHoliday method it successfully adds the holiday to ...
I'm working with Python and use the statsmodels.tsa.vector_ar.vecm.coint_johansen function to analyze if several stocks have a stationary error term with respect to pairs trading. I pass the log of the close prices for the stocks into the function and chose constant term for det_order (0) and number of lagged differenc...
I am looking for a parsed dataset with historical data for company credit ratings. I know NRSROs need to make their historical data public. I found Moody's (https://ratings.moodys.com/sec-17g-7b), S&P and Fitches data, but I'm having a hard time turning it into a readable format like csv. I also found a nicely parsed ...
For a swaption, I had 2 questions: how would I guage the PnL based on RV vs IV on a swaption? I'm guessing its 0.5 x gamma x (RV^2-IV^2)(or realized variance - implied variance) Not 100% sure on this. I understand to calculate the theta of a swaption it's 0.5 x gamma x IV^2 (daily bp vol) However for say, the 1y1y ...
I'm new to this, and just trying to understand what options prices imply about asset growth. I'm looking at the following expression for the underlying asset price in the Black-Scholes model, in particular: S(t) = S(0)*exp((r - 0.5*\sigma^2)*dt + \sigma*dW(t) Where S(t) is the asset price at time t in years, r is the r...
How does the quantlib set up hour time, say in the example below: ql.Date(20, 1, 2023), US calendar, what is the time, 12 AM US time? local machine time? say I would like to set up a NY 4 pm time, is it possible?
Taken from Wikipedia: A hidden semi-Markov model (HSMM) is a statistical model with the same structure as a hidden Markov model except that the unobservable process is semi-Markov rather than Markov. This means that the probability of there being a change in the hidden state depends on the amount of time that has elap...
I'm trying to implement an SDE in R using Yuima. Most of examples and literature show how to implement and how the math works for SDE where drift and diffusion terms are scalar. What if I want to implement an SDE like this: $$ dX_t = (b + BX(t))dt + \Lambda dW(t) $$ where $b$ is a vector of length $3$, $B$ is a $3\time...
We have 2 risky and 1 risk-free asset. E1 = 4%, STD1=10% E2 = 5.5%, STD2 = 20% rf=1.5% The covariance matrix and it's inverse are given: |0.01 0.006| |0.006 0.04| inverse: |109.9 -16.5| |-16.5 27.5| ue (vector of excess returns) (2.5 4) Now the formula for the weights of the tangency portfolio should be: $\fra...