Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [simulations]

The tag has no usage guidance.

1
vote
1answer
95 views

Monte Carlo simulations in Python using quasi random standard normal numbers using sobol sequences gives erroneous values

I am trying to perform Monte Carlo Simulations using quasi random standard normal numbers. I understand that we can use sobol sequences to generate uniform numbers, and then use probability integral ...
1
vote
0answers
29 views

Pricing call option on bond under CIR model by simulating noncentral chi square distribution

In the original paper of CIR model, there is a pricing formula about call option on bond $$ \begin{array}{l}{C(r, t, T ; s, K)} \\ {=P(r, t, s) \chi^{2}\left(2 r^{*}[\phi+\psi+B(T, s)] ; \frac{4 \...
0
votes
3answers
59 views

Python libraries for Monte Carlo simulations?

I am learning about monte carlo simulations and I have found many blogs explaining its implementation in python. Because its a widely known and an important technique for structuring asset prices. I ...
0
votes
1answer
54 views

Historical Simulation of Bond, Stock and Option Portfolio

If I have a portfolio consisting of 1-one stock of unit price equal to S, 2-one 9% coupon American bond with 20 years to maturity and a par value of $1000, 3-and one European call option on the ...
1
vote
2answers
125 views

Choosing a proxy for asset credit event correlations

I'm interested in modeling the joint likelihood for rating changes and default events across a portfolio of bonds. To estimate the correlation between these assets, I can use a third-party factor ...
1
vote
0answers
42 views

Jump Diffusion Model - Volatility and Mean of Jumps

I am trying to understand the concept of jump diffusion model. So far what I've understood is that by adding a Jump parameter to a GBM (Geometric Brownian Motion) we can generate a Jump diffusion ...
2
votes
1answer
144 views

How to interpret and define statistics of GBM output

I am trying to model the future prices of a number of commodities. For this, I am applying geometric Brownian motion, writing a Monte Carlo code in Python. Given that I want to estimate tommorows ...
2
votes
1answer
155 views

How to model High/Low prices for Stocks with Monte Carlo

I'm using monte carlo simulation to model stock paths and measure risk, but I was wondering if there is a way to simulate the full bar/candle chart with open, high, low and close prices , as I'm only ...
5
votes
2answers
520 views

Credit Valuation Adjustment Implementation

I am trying to help a friend with her thesis on Counterparty Credit Risk where she intends to have a somewhat lengthy treatment on Credit Valuation Adjustment (CVA). Specifically I am looking to help ...
3
votes
1answer
210 views

Why is it more accurate to simulate ln(S) rather than S?

Let's take a process $S$ that satisfies: \begin{equation} dS = \mu S dt + \sigma S dz \end{equation} with $dz$ a Wiener process, $\sigma$ the volatility of $S$, $\mu$ the expected return of $S$. From ...
0
votes
1answer
43 views

Simulating stock prices with and without intermediate paths

So I am simulating stock prices with what I believe to be geometric Brownian motion using parameters from the usual Black-Scholes framework (Please correct me if I am wrong) with the following formula:...
1
vote
1answer
97 views

Simulating assets of different currencies

I have a situation as follows: One year call option on a Euro stock with a Euro denominated strike. Knock in feature as follows - The option can only pay out if the growth in the Euro stock over ...
1
vote
0answers
35 views

Negative theta in Log-linear stochastic volatility model

I was asked to simulate the following geometric Brownian motion to get paths for the SPX stock price. the process follows a Log-Linear stochastic volatility. $dS_t = \mu S_tdt+e^VS_tdW_1 $ where ...
1
vote
2answers
96 views

Distribution of data for GBM

I am running some Monte Carlo simulations with GBM on time series of commodity prices. First of all, the price data is annual between 1900-1950. I would firstly like to know if it is bad practice to ...
0
votes
1answer
74 views

Simulated Sharpe Ratio Calculation for Leveraged Portfolio

I've written some VBA code to simulate the effect of borrowing money, investing it, and repaying the loan daily. PseduoCode: Start with a portfolio value of P = 1 Each day borrow P, invest 2*P, ...
26
votes
5answers
50k views

How to simulate stock prices with a Geometric Brownian Motion?

I want to simulate stock price paths with different stochastic processes. I started with the famous geometric brownian motion. I simulated the values with the following formula: $$R_i=\frac{S_{i+1}-...
2
votes
0answers
89 views

Longstaff-Schwartz, special american option simulation using Python (numpy package)

I got a put option, which can be exercised 3 times, all at different times, which are each month of a year $$t_1 = \frac{1}{12}, t_2 = \frac{2}{12} ... t_{12} = 1$$. Respectively, if exercised at $$...
2
votes
1answer
527 views

Forecasting conditional returns in DCC-GARCH-copula approach in R

anyone who could help me interpreting and modifying this code? I have a dataset and want to reserve the last 100 returns for out-of-sample analysis. After specifying and fitting the garch-spd-copula, ...
1
vote
1answer
246 views

Shifted Log-Normal model

I am trying to understand how the shifted log-normal model works, in which we shift a log-normal model by a factor before the simulation so that interest rates don't turn negative during the ...
1
vote
0answers
26 views

Why no prepayment fee for the reverse mortgage?

I am currently studying the costs (to lender) of adding certain additional options to the reverse mortgage, including the option of prepayment. Would there be any scenarios of housing price/mortgage ...
0
votes
1answer
149 views

negative values in geometric brownian motion

A GBM $ \frac{dx}{x} = \mu dx + \sigma dW $ solves to $x_t = x_o e^{(\mu - \sigma^2)t + \sigma W_t}$ From the solution, it is clear that $x_t$ cannot become negative. However, it is not so clear ...
0
votes
1answer
73 views

Single vs Multi factor interest rate model

How do we explain the difference beween a single and multi factor interest rate model. Short term interest rate is one of the factor which is used in drift and vol calculation but what are other ...
2
votes
0answers
63 views

Generating Correlated Quasi Random Numbers

Hi I am trying to generate correlated quasi random numbers using a sobol sequence in matlab. My Problem is the Following: Using "standard" random numbers it is easy to generate the 6 correlated random ...
2
votes
1answer
110 views

Merton's Jump diffusion model: Specify poisson rate

Currently applying the Merton's jump diffusion to test how Option price change as parameters change. However, I am struggling to specify the poisson rate $\lambda$. We know that: $P(\text{There is a ...
1
vote
0answers
94 views

Multivariate Hawkes Process Simulation

I am trying to implement Ogata's thinning algorithm to simulate multivariate Hawkes Processes in Python (the algorithm can be found here: https://www.math.fsu.edu/~ychen/research/Thinning%20algorithm....
3
votes
0answers
64 views

Solving BSDE in R

I was wondering how to implement a BSDE approximation in R. For example, if I have the toy BSDE $$ dX_t = \mu dt + \sigma dW_t ; X_T\sim N(\mu_1,\sigma_1), $$ for fixed real numbers $\mu,\mu_1,\sigma,...
4
votes
1answer
148 views

Simulate double exponential process with correlated jumps?

So, I'm trying to simulate a correlated double exponential jump process for two assets, and I understand the pure exponential jump process ($\eta_1$ and $\eta_2$, the probability of an upward jump ...
0
votes
1answer
98 views

time step choice impact in Vasicek model simulations

I am trying to make some computations using Vasicek short rate model. Especially I a trying to compare exact expectation(obtained with the formula) and the expectation from Monte Carlo simulation. ...
5
votes
1answer
1k views

How does the 2-factor Hull White model propagate the forward rates curve?

I've been trying to get a grasp on some of the basics of interest rate modeling, and am looking to simulate rates using the 2 factor Hull White model, which I am aware offers a more realistic model of ...
0
votes
1answer
38 views

In CVA simulation, timesteps vs number of simulations?

On a CVA system with limited computational power. For pricing, What is best, More timesteps and less number of simulations or less timesteps and more number of simulations? for example with a whole ...
1
vote
0answers
22 views

Simulating Taxed Equity Return Series (U.S.)

I'm looking to learn how to correctly simulate taxes on dividends and capital gains on simulated return series for U.S. Equities with dividend reinvestment. I understand I will have to keep track of ...
0
votes
1answer
163 views

How to simulate this Gamma expansion in a Python way

Here is the simulation that I want to do: For each of the 10 million simulation paths, I have n = 100 lambda values in sequence (the lambda vector is the same for all paths), Using each of the lambda ...
1
vote
1answer
73 views

Simulating trading strategies

I want to simulate real time trading strategies. For simplicity, let's say I only want to simulate a long-only portfolio on S&P500. I have a couple of questions: Is there a place online where ...
1
vote
0answers
87 views

Monte Carlo Simulation of correlated returns based on different frequencies

I am simulating through Monte Carlo, multivariate correlated returns of different products composing an Oil&Gas portfolio. The historical prices (from which I computed the log-returns) of the ...
4
votes
1answer
705 views

Monte Carlo - Multivariate Simulation of Returns

I am implementing a Monte Carlo simulation in R to generate multivariate correlated returns. In doing this I have used the Cholesky decomposition, applied to the covariance matrix. However, I saw that ...
8
votes
2answers
4k views

Simulation of GBM

I have a question regarding the simulation of a GBM. I have found similar questions here but nothing which takes reference to my specific problem: Given a GBM of the form $dS(t) = \mu S(t) dt + \...
1
vote
0answers
36 views

Bootstrapping to Judge the Fit of a Sampled Return Distribution

Consider the following: I have sampled yearly stock returns from a specified distribution. What I want to do is compare how well my sampled distribution fits the empirical distribution of yearly ...
9
votes
2answers
668 views

CDS spread scenarios from historical market data

I'm searching for information on the best way to generate scenarios to be used in VaR or ES calculations, for CDS spreads. Given that we need significant historical data in order to achieve a decent ...
1
vote
0answers
165 views

Open Source library for calculating exposures?

I would like to know an open source quantitative library/ies that can calculate exposures out of the box (I have investigated a bit on OpenGamma/Strata libraries with no luck and the website of ...
1
vote
0answers
80 views

Implementing Pykthin Multi-factor adjustment

I've made a mistake in the implementation of Pykthin Multi-factor adjustment which I'm fairly certain comes from me not understanding the model completely. The model was developed to drastically ...
1
vote
2answers
984 views

Simulating a path of bond yields by Monte Carlo (Python)

I have a number of given time series for bond yields (given in a dataframe in pandas package in Python). I need to do the following task in Python: "1. Simulate 1000 path 30 steps ahead for any yield ...
1
vote
1answer
262 views

How to sample from a copula in matlab

I have two random variables (say, X and Y). Each of these rv's are defined by their CDFs (CDF_X and CDF_Y). These CDFs were obtained empirically, so they are a "stair" graph. I also have a copula C ...
1
vote
1answer
351 views

Books about Monte Carlo Simulation on derivatives with Python

I am looking for a good reference for Monte Carlo simulation applied to derivatives with Python. Most books I found until now deal with C++... I have found "Derivatives Analytics with Python" by Yves ...
1
vote
1answer
270 views

Terminal Variance in the Heston Model

I am trying to understand the basics of financial models. Random Walk as a model for asset prices. We use gaussian random numbers to generate a Gaussian Random walk. The variance of the terminal ...
3
votes
0answers
60 views

Equity Options - “How do I build a forward simulation model with regards to shocks in spot pricing and IV?”

I am trying to build a "What-If" Portfolio, consisting of a total of 20 options, across different tenors, strikes (delta), but on the same security. Simply put, the objective is for me to test the ...
1
vote
2answers
284 views

Simulation curves; PRIIPS category 3

Once the yield matrix has been computed, the eigenvectors must be calculated to project the yield matrix on the 3 main dimensions. Tehen is wasted to calculate the yield matrix to be used for the ...
2
votes
2answers
344 views

Deduce expected exposure profile from option/structure delta?

I am thinking about whether there exists a relationship between the delta of an option (or any structured derivative) and it's expected positive/negative exposure? An intuitive question would be the ...
2
votes
1answer
654 views

How are Brownian Bridges used in derivatives pricing in practice?

A similar question has already been asked in the past, unfortunately the 2nd question of the OP was never really addressed. Most references found on internet on Brownian Bridge and Monte-Carlo ...
5
votes
1answer
660 views

SDE simulation: P or Q?

Let's take a GBM under $P$: $dS=\mu dt+\sigma dW_{t}^{P}$ and then under $Q$ $dS=r dt+\sigma dW_{t}^{Q}$, where $dW_{t}^{Q} = dW_{t}^{P} + (\mu - r)/\sigma dt $ Now, let's say that I have ...
4
votes
2answers
562 views

Monte Carlo, convexity and Risk-Neutral ZCB Pricing

I've built a simplistic Excel monte carlo model to price a zero-coupon bond, but it came up with a slightly unepxected result so I wanted to confirm whether my maths is just a little rusty or my model ...