Stack Exchange Network

Stack Exchange network consists of 174 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
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

The tag has no usage guidance.

-1
votes
1answer
88 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
0answers
30 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 ...
1
vote
1answer
46 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 ...
1
vote
1answer
85 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 ...
1
vote
0answers
41 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 ...
2
votes
1answer
74 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 ...
1
vote
0answers
30 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 ...
1
vote
0answers
53 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 ...
4
votes
1answer
82 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 ...
1
vote
0answers
125 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
2answers
319 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
103 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 ...
0
votes
0answers
100 views

Monte Carlo simulation for price of European call under Merton model

The stock price is modeled by $$S_t = S_0 e^{bt +\sigma B_t + \sum_{k=1}^{N_t} Y_k}$$ with $B_t$ standard Brownian motion, $Y_k$ iid $N(\mu,\delta^2)$, $N_t$ a Poisson process of parameter $\lambda$ ...
1
vote
1answer
119 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 ...
0
votes
1answer
75 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. ...
4
votes
0answers
50 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
1answer
244 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 ...
3
votes
1answer
277 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 ...
1
vote
2answers
208 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 ...
0
votes
0answers
21 views

Analyzing subset of a simulation for stress testing?

I'm using a third-party black box stochastic simulation model. Essentially, this model simulates the joint evolution of macro variables (GDP, inflation, yields etc) over some horizon, and translates ...
1
vote
2answers
88 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 ...
3
votes
1answer
129 views

Projecting a Thiele differential equation with Black Scholes returns

I am trying to solve the equation $\frac{d}{dt}V(t)=r(t)V(t)+\pi-\mu(x+t)(b_d-V(t))$ numerically using the R function 'ode'. This is a Thiele differential equation for a life insurance reserve with ...
1
vote
0answers
87 views

Simulating asset returns: (Academia) state of the art

I want to run some simulation studies of (linear) factor models and for that reasons I am wondering about the features such a simulation should contain - every suggestion is welcome, I'll do my best ...
0
votes
0answers
23 views

Bayesian inference on vanilla options

I am currently trying to implement in python the bayesian approach described in this paper: https://arxiv.org/abs/1401.5666. While the author want to use the bayesian approach in order to blend the ...
0
votes
2answers
145 views

Log normal price simulation

I'm trying to figure out a spreadsheet I have which simulates 50000 returns in excel using the following function: LOGNORM.INV(RAND(),0,0.35)-1 Question: How ...
0
votes
0answers
38 views

How is the accuracy of a term structure simulation measured?

I am not very familiar with financial modeling, I read various methods to model IR term structure and to simulate such models in order to come up with possible future market paths. I am mostly ...
0
votes
0answers
77 views

Comparison of GBM paths with exact formulation and euler Discretization

I wrote the following program to compare the simulation path of a GBM using Euler discretization of the stock price, Euler discretization of the log-stock price and the exact formulation with the ...
0
votes
1answer
160 views

Potential Future Exposure (PFE): Is there any Rigorous Walk Through with Data?

I have searched on the Internet and in several books (including John C. Hull and Jon Gregory) for concrete examples of Potential Future Exposure (PFE), but haven't had any success so far. I would ...
1
vote
0answers
87 views

Simulation of Traders [closed]

I am writing a simulation of how traders will behave in an emergent market. The idea is to see how traders can use information from other traders to make a decisions as to whether they will buy, sell, ...
3
votes
0answers
80 views

Electricity Prices: Change of measure in practice

I'm working on a model of electricity prices. I have empirical data $X(t)$ and managed to find a reasonable fit given by a Levy process $\hat{X}(t)$. I understand in theory what a risk-neutral ...
3
votes
1answer
123 views

How to price the American style Asian option with recent N day average

How to price the American style Asian option with recent N day average, for example, we exercise at t day, then the payment is $$...
1
vote
1answer
77 views

A bug in delta hedging, when for a certain step dS=0

Suppose we are doing a delta hedging simulation according to Black Scholes, where the initial condition are [stockPrice, strike, timeToExpire ,riskFreeRate, dividend, sigma, isCall] = [100, 100, 1, 0, ...
1
vote
1answer
47 views

Extreme cases of normal random numbers and NaN

While trying to implement my version of Euler's method for simulating a SDE in C++, I came up with a problem. It occurs in some cases that the path generated by my method ends up giving values which ...
0
votes
0answers
49 views

Methods for modelling price shocks

I am doing stress-testing of central counterparties, how a price shock affects them. The central counterparties calculate the required collateral based on a "normal" market, the distribution of the ...
1
vote
0answers
33 views

Simulating Asset Prices by Independently Simulating Supply and Demand

If I have an asset, whose supply is generally mean-reverting and whose demand is generally cyclical, could I somehow simulate / project the supply and demand levels across multiple discrete time ...
1
vote
1answer
196 views

In a Monte Carlo simulation, will a delta hedge control variate necessarily reduce the standard error more than an antithetic variate?

I have four Monte Carlo simulations and will list them in order of highest standard error to lowest. Plain MC MC with delta hedge control variate MC with antithetic variate MC with antithetic and ...
2
votes
0answers
86 views

Smooth ornstein uhlenbeck process

I want to simulate paths for a commodity price. I use the historic data in the following way: $X_t$ is the price. $\ln\left(\frac{X_t}{X_{t-1}}\right)$ is the daily return. I calculate the slope of ...
0
votes
1answer
105 views

General Framework For Valuing Mortgages

I am becoming more interested in mortgage valuation and would like some pointers on the basic valuation process for a mortgage. I understand there is likely an entire field of study devoted to valuing ...
-1
votes
2answers
769 views

Monte Carlo Simulation and forward curves

I recently came across a question whether a Monte Carlo simulation should represent a forward curve at each tenor. I encountered an approach at a bank which I would consider as somehow strange. ...
0
votes
0answers
53 views

Get a value for Y, given fitted spd for X and a fitted copula (R)

I have a dataframe D with 2 variables, X and Y. I am doing the following: I fit a spd to the data using spd package in R I get the pseudo-uniform numbers using pspd I put the element in a new matrix ...
2
votes
1answer
2k views

How to generate simulated stock price from historical data using R?

I have created a strategy specifically for a particular stock which I backtested with its historical data. Now I want to forward test it with simulated stock price generated using Monte Carlo. I have ...
0
votes
0answers
60 views

How are Levy driven SDE simulated?

Do you just use an Euler scheme as before? E.g. take this process, OU process with a Levy driver. \begin{equation} \text{d}V_t = -\lambda V_t\text{d}t + dZ_t \end{equation} Do you just have $V_{...
1
vote
0answers
318 views

Stochastic Vol simulation - Quant job interview question

this is a question from a quant interview (FO quant for IR Exotics for a big 4). First it might be useful when preparing your interviews, second, any brainstorming will be appreciated. Note that no ...
1
vote
1answer
213 views

Brownian motion simulation - scaling issue

I'm trying to simulate some BM for 500 observations. I got correlated increments as I needed and they are not exactly N(0,1), so I standardize them (x-mean(x))/sd(x). But then the resulting Brownian ...
5
votes
1answer
357 views

Model reference price of Limit order book

first of all, the description of this Stackexchange forum says its for professionals or academics. I'm doing a lot of self studying and with that I was able to understand some white papers but still I'...
1
vote
0answers
397 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
4answers
532 views

Exploding Libor Rates in Libor Market Model

I have implemented the Libor Market Model in Matlab. When I generate a number of paths, I notice that some of them explode. Does anybody have an idea what could cause this? I already tried solving ...
1
vote
2answers
187 views

How to simulate 3 correlated stock processes following a GBM?

Suppose we have 3 stocks following GBMs. We are given the distribution of the daily log returns which is multivariate normal. Suppose I want to sample the stock price tomorrow ($\Delta t = 1$ day), ...
1
vote
2answers
107 views

Simulate drifted geometric brownian motion under new measure

I have a very fundamental question regarding simulation of DRIFTED geometric brownian motion. We have the standard Blackos Scholes model: $dS(t)=r S(t)dt+\sigma S(t) dW^{\mathbb{P}}(t)$, where $W^{\...
3
votes
1answer
569 views

Calibration of 1F Hull White short-rate model to market data

I want to calibrate the Hull White 1 factor short rate model to market data. The main purpose is to simulate interest rate paths, which I will use to calculate the net pv of banking liabilities. Some ...