Questions tagged [simulations]
Reproduction of the characteristics or the outcome of a phenomenon or process using math or programming. Here limited to events related with quantitative finance as defined in the help center.
272
questions
1
vote
0
answers
69
views
Ornstein-Uhlnbeck Process with Jumps
I am trying to simulate an OU Process (Vasicek version) with jumps and I would like to derive the drift and diffusion term when jumps are incorporated, which will enable me to perform monte carlo ...
0
votes
0
answers
28
views
Fitting a multidimensional Ornstein-Uhlenbeck pProcess
If I have a dataset X, where each row is a time point and we have several variables, say 100, (so this is a multivariate time series), what is the best way to fit a multidimensional Ornstein-Uhlenbeck ...
0
votes
0
answers
33
views
Distribution fitting to data with (isolated) extreme observations
Let's assume I have 2 time series of daily observations of a given experiment. The data of one time series show a very long tail (either side) and in absolute sense the difference between the lowest ...
0
votes
0
answers
46
views
How to exactly sample two Cox-Ingersoll-Ross processes that share the same Brownian motion
Lets say that I have two CIR processes
\begin{align}
dX_t &= b_x(a_x - X_t)dt + s_x \sqrt{X_t}dB_t \newline
dY_t &= b_y(a_y - Y_t)dt + s_y \sqrt{Y_t}dB_t
\end{align}
And I want to sample from ...
0
votes
0
answers
31
views
Quantlib IndexManager
I am doing some research on how to leverage QuantLib for calculating XVAs in Python and I am now struggling to understand something. Basically, I would like to simulate n paths. Each one of the paths ...
1
vote
0
answers
51
views
Scaled VaR: approximation vs reality
Previous question: Understanding VaR rescaling
After understanding the usual VaR scaling formula
$$\text{VaR}_{T,\alpha}=\sqrt{T}\text{VaR}_{1,\alpha}$$
I wanted to know by how much it deviates from ...
0
votes
0
answers
64
views
Pricing a zero coupon callable bond
Suppose I have a 20-year zero bond with a call date in 10 years and a zero interest rate of 2%, which is currently valued at a Z-spread of 100. Now I would like to evaluate the right of termination ...
0
votes
0
answers
114
views
Confusion About PFE Calculation and XVA Pricing Engine's Exclusive Reliance on Parameter Simulation
Potential Future Exposure (a credit risk metric) is calculated using
$$PFE(\tau) = \text{max}\Big(0, \mathcal{P}_{derivative}(\tau) - CVA(\tau)\Big)$$, where $\mathcal{P}$ is the price / fair value / ...
0
votes
0
answers
87
views
What are state-of-the-art methods for forecasting of rates and volatilities?
Usually forecasting is based on a model for the evolution of a value $x(t)$ based on some parameters ${\beta}$ that can then be estimated using various statistical means.
For yield curves and ...
1
vote
0
answers
35
views
Option Price keeps decreasing as the time-steps increase
I have been writing a code in Python, trying to find a European Benchmark of the Gatheral Double-Mean Reverting model (since there is no available benchmark values online), using the Euler scheme.
For ...
3
votes
1
answer
384
views
Understanding the calibration of High-frequency trading in a limit order book
I am trying understand and replicate this thesis, which is based on, High-frequency trading in a limit order book by (Avellaneda and Stoikov, 2008) and Optimal market making, by Olivier Gueant, 2017, ...
0
votes
2
answers
183
views
My Montecarlo Simulation is not working?
My aim is to predict 1 year ahead and daily, the price of a stock under certain scenario.
These scenarios are the ones that this year the stock will have a similar year, in terms of standard deviation ...
1
vote
0
answers
82
views
Reserves using Thiele differential equation
I am trying to solve the Thiele differential equations
$$
\frac{d}{dt}V^1(t)=r(t)V^1(t)-b^1(t)-\mu_{12}(t)(V^2(t)-V^1(t))-\mu_{10}(t)(V^1(t)) \\
\frac{d}{dt}V^2(t)=r(t)V^2(t)-\mu_{21}(t)(V^1(t)-V^2(t))...
2
votes
0
answers
164
views
Simulate Spot Process with Forward Variance (Bergomi)
I am reading Bergomi's book (Stochastic Volatility Modeling), and in section 8.7 The two-factor model (page 326), the following dynamics are given:
\begin{align}
dS_t &= \sqrt{\xi_t^t}\,S_t\,...
0
votes
0
answers
85
views
Deriving probability of hitting stop loss given annual return and Sharpe
Suppose I have a strategy with a mean return and defined Sharpe. Given a preset stop loss, I want to calculate the probability of the stop being hit.
In the example below I use the following ...
0
votes
0
answers
117
views
Use filtered historical simulation to calculate VaR on a repo trade
I would like to calculate the VaR for a repo trade using filtered historical simulation incorporating GARCH.
So, for example, in the first leg, 3000 of bond goes out on day 1. In the second leg, 3000 ...
0
votes
0
answers
111
views
How can we simulate daily return based on multi-factor model?
This is an interesting question for simulation. The question is a bit lengthy but I'm trying my best to make it super clear here.
Now I have some multi-factor model, say some US barra risk model from ...
0
votes
0
answers
787
views
Simulating Hull-White Model in Python
I first simulated the short rate in the Vasicek model using the following code, which is equivalent to simulating the following normal distribution $r_{t} \sim N\left(r_{0}e^{-at} + b\left(1-e^{-at}\...
2
votes
1
answer
224
views
Queue Reactive Model for large spread assets
Im working on the implementation of the Queue Reactive Model by Lehalle (https://arxiv.org/pdf/1312.0563.pdf), but I have encountered some implementation problems for my specific assets.
First, the ...
0
votes
0
answers
92
views
OLS estimation for ornstein uhlenbeck process
I am reading the following paper. In particular, in section 4 - numerical determination of OTRs, it mentions applying Ordinary Least Square on Eq(5). However, what I don't know is whether ${P_{0,0}, ...
0
votes
0
answers
64
views
Valuation via decomposition or via simulation of the underlying?
My question might be very straight forward but I have seen both approaches being followed in practice so I am curious to see if there are arguments in favor or against each one. I am explaining my ...
6
votes
0
answers
366
views
Delta-hedge experiment of American Put option
I am trying to run a delta-hedge experiment for an American Put option but there's a (systematic) hedge error which I cannot seem to understand or fix.
My implementation is found in the bottom of this ...
2
votes
1
answer
115
views
Fatigue with Historic Backtesting - Alternatives?
It seems to me like historic backtesting is the best of bad options out there for me to test my systematic strategies - even ones that are more macro-level trend spotting. I can't test enough ...
3
votes
0
answers
174
views
Pathwise sensitivities of American options - Derivative of the American payoff function
How can I compute the derivative of the payoff function for an American put option?
In the paper "Smoking adjoints: fast Monte Carlo Greeks" by Giles and Glasserman (2006) they compare two ...
3
votes
0
answers
156
views
Continuation value in Longstaff-Schwartz: Why the expected value?
In the paper by Longstaff and Schwartz on American option pricing, the continuation value at time $t_k$ is given by:
\begin{align}
F(\omega;t_k) = \mathbb{E}_Q\Big[\sum_{j=k+1}^Kexp\Big(-\int_{t_k}^{...
1
vote
0
answers
244
views
Longstaff-Schwarz LS Monte Carlo - which approach is correct? [closed]
I'm trying to understand Least-Square Monte Carlo approach for pricing american options. I'm familiar with Tsitsiklis and van Roy (2001) approach where we are going backwards with:
$V_T = h(S_T)$, ...
1
vote
1
answer
205
views
GARCH process simulation in R
I'm trying to learn how to simulate the GARCH(1,1) for option pricing using Monte Carlo. I need to learn how to code the equations for the stock log returns and the variance process. I'm trying to ...
0
votes
0
answers
84
views
Heston Process: Accept-Reject Sampling to Alleviate the Problem of Negative Variances
I've read even in recent papers, and on page 21 of the book "The Volatility Surface" by Jim Gatheral (2006), all the debate over whether to reflect or truncate negative variances whilst ...
0
votes
1
answer
350
views
Choosing a time step in Monte Carlo simulation of forward rates in LIBOR Market Model
Lets talk about the Monte Carlo simulation of forward rates in Euler discretization scheme under the $T_N$-forward measure, a so called terminal measure. Suppose that we have a number of time steps ...
1
vote
0
answers
37
views
Inflation in wealth forecast [closed]
I am building a model to simulate people's wealth in the next years.
Say Mr X has a portfolio with an expected return of 3% (annual). From this I can simulate the return of his portfolio in the next ...
2
votes
1
answer
335
views
Optimize interest rate swap calculations in Monte Carlo Simulation
I’m running a simulation in which I want to calculate the NPV of 100 swaps over 1000 (or even much more) different interest rate curves.
It looks like Quantlib is not really fast in performing these ...
1
vote
0
answers
282
views
CEV model effective simulation
I want to simulate the following CEV process : $$ dM_t = \sigma_t M_t^{\eta} dW_t $$
Using Euler discretization to $M_t$, if at a given time $t$, $M_t$ takes a negative value then $M_{t+1} = M_t + \...
1
vote
0
answers
123
views
Simulating the same stock price with different methods/distributions
I would like to ask if we could simulate stock price paths with different methods/techniques.
What I mean is : say we have a specific stock price hence we can extract historical mean and standard ...
4
votes
1
answer
282
views
Simulating Iterated Brownian Motions
I was going through an interesting article (https://arxiv.org/pdf/1112.3776.pdf) while I was trying to read about subordinated processes. I wanted to simulate subordinated processes (in R or python) ...
2
votes
1
answer
400
views
Cholesky decomposition reduces volatility of simulated Wiener Process / Brownian Motions
I am trying to simulate $n$ correlated geometric brownian motions (GBM) given a specified correlation matrix $\Sigma$ by following this procedure which uses Cholesky decomposition.
However, when I ...
1
vote
1
answer
676
views
Euler Discretization python code
Write the Euler discretization of the 1-dimensional stochastic equation
$dXt = b (t, X_t) \space dt + \sigma (t, X_t) \space dW_t$
For this part I would say all right because it is a purely ...
0
votes
0
answers
116
views
Inconsistency between simulation and the probability of a "stock" hitting take profit before stop loss
Let's assume a stock at time $t$ is worth $X(t)$. If the returns of $X(t)$ are i.i.d. and normally distributed,the probability of $X(t)$ hitting a value $H>X(t)$ before $L<X(t)$ is $\frac{H-X(t)}...
0
votes
1
answer
1k
views
What are common ways to realistically simulate the stock market using historical market data?
I am currently using the FinRL library to try to automate Trading using Reinforcement Learning. However, I wanted to understand how FinRL simulates the stock market using historical data. I read here ...
2
votes
1
answer
117
views
Simulating Correlation (but sample correlation is always too low)
I am trying to simulate correlation in order to price a correlation swap (via Monte-Carlo). For simplicity, let's assume we have 2 assets, and everything is correlated with $\rho$, and there is no ...
1
vote
1
answer
411
views
Why we introduce correlations between Wiener processes? [closed]
Wiener processes are used to model various assets, and I wonder why we are introducing correlations between the Wiener processes and what is the interpretation? Because when the correlations between ...
1
vote
1
answer
477
views
Simulating the Value-at-Risk with $t$ distributed returns
I want to understand how the value at risk and the simulating the VaR with simple Monte Carlo method. But I want just a confirmation and are welcome any comments, since I don't have the full picture ...
0
votes
0
answers
196
views
Simulating sum of squared brownian motions process
I'm trying to simulate the following stochastic process:
\begin{equation}
R_t = \sum_{i=1}^nB_{i,t}^2
\end{equation}
which has the following dynamics:
\begin{equation}
\begin{aligned}
dR_t = \sum_{...
0
votes
2
answers
172
views
seek clarification about PFE
I'm a software developer want to know a little about quant basics. My undserstanding of PFE is that a PFE of a trade at a future time point is commonly defined by taking the average of the highest (or ...
1
vote
0
answers
122
views
Backtesting - treatment of holidays for global (i.e. multi-market) portfolios
Assume a daily trading strategy where each day we rebalance our portfolio weights:
Situation A: all constituents of our portfolio are from the same market (e.g. a portfolio of S&P 500 stocks)
...
2
votes
1
answer
173
views
Interpolation of $\mu(t,X(t))dt+\sigma(t,X(t))dW(t)$
Let's assume that we have SDE
$$dX(t)=\mu(t,X(t))dt+\sigma(t,X(t))dW(t)$$
and we simulate it on a time grid which contains points $t_k$ and $t_{k+1}$. How can we then calculate value of $X$ at time $...
1
vote
1
answer
653
views
Simulating Correlated Stock Returns in Python (SciPy)
I'm looking to generate stock returns with inter-stock correlation in Python. However, the output is not behaving properly and may have accidental temporal correlation causing issues.
This code is ...
-1
votes
2
answers
588
views
Why can’t delta’s be used to price double no touch options?
Here is the link to a MATLAB one touch option pricing calculator I used:OT
I tried several inputs and I noticed that the one touch option price is approximately twice the delta of an equivalent ...
0
votes
1
answer
105
views
Efficient method for expanding 1 sim routine to the number of simulations? Brownian Bridge used with multiple underlying assets in a MC simulation,
I believe this is a (fairly) simple question for those familiar with quantitative finance and MC/QMC methods of pricing complex options. Or potentially its just a simple Python loop vectorization ...
0
votes
0
answers
261
views
How can I simulate the barrier option call model in Python?
We have a barrier call option of European type with strike price $K>0$ and a barrier value
$0 < b< S_0$,
where $S_0$ is the starting price.According to the contract, the times $0<t_1<....
3
votes
1
answer
580
views
backtesting guide for research
I am a master student in finance and I am working on my portfolio management thesis. Within my thesis I will have to backtest a portfolio strategy for a balanced portfolio.
I am looking for a guide/ ...