Questions tagged [simulations]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
33 votes
5 answers
63k 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}-...
user1690846's user avatar
18 votes
6 answers
3k views

How to generate a random price series with a specified range and correlation with an actual price?

I want to generate a mock price series. I want it to be within a certain range and have a defined correlation with the original price series. If I choose, say, oil, I want as many time series which ...
Suminda Sirinath S. Dharmasena's user avatar
9 votes
2 answers
5k 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 + \...
gu7z's user avatar
  • 275
2 votes
3 answers
1k views

Do basket options have a closed form valuation formula?

Suppose I'm simulating a European call option on a basket consisting of N stocks with slightly varying volatilities but all other parameters remain the same. From the perspective of an estimate, it ...
John1942's user avatar
7 votes
1 answer
962 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 ...
jso's user avatar
  • 101
4 votes
1 answer
6k 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 ...
SaurabhD's user avatar
  • 191
3 votes
1 answer
2k 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 ...
Daneel Olivaw's user avatar
3 votes
1 answer
1k views

Get distribution for aggregate loss using Monte Carlo

I am given two data sets containing dates and losses (in some currency). Given a distribution for the amount of losses and an (a,b,0) distribution for frequency of losses, how can I use Monte Carlo ...
BCLC's user avatar
  • 911
2 votes
2 answers
1k views

Modeling Slippage without Order Book data

I am building a portfolio simulator and finding ways to make it more 'realistic'. For example, giving the option to reinvest dividends, include capital gain taxes, commission/fees (fixed for now) etc. ...
user49573's user avatar
1 vote
3 answers
533 views

Simulating covariance matrices with nonzero correlation

How would you simulate a covariance matrix of 1,000 stocks where each pair has nonzero correlation? I have literally no idea how to start with this. Any suggestions?
Trajan's user avatar
  • 2,352
37 votes
5 answers
8k views

Strictly local martingales: what is the intuition behind them?

A process $X_t$ is a local martingale if there exists an increasing sequence of stopping times $\{\tau_k,k=1,2,...\}$, with $\tau_k \to \infty$ almost surely, such that each stopped process is a ...
Kiwiakos's user avatar
  • 4,287
17 votes
3 answers
2k views

Simulating Returns

I'll start this off with a rather broad question: I am trying to simulate returns of a large number of assets within a portfolio of different classes - equity and fixed income in a first step, say 100 ...
Owe Jessen's user avatar
  • 1,134
16 votes
3 answers
2k views

How to account for transaction costs in a simulated market environment?

I am simulating a market for my trading system. I have no ask-bid prices in my dataset and use adjusted close for both buy and sell price. To account for this I plan to use a relative transaction cost....
Stian's user avatar
  • 265
10 votes
3 answers
755 views

How to test for and how to simulate price rise/fall asymmetry in the stock market

One of the stylized facts of financial time series seems to be a fundamental asymmetry between smooth upward movements over longer periods of time followed by abrupt declines over relatively shorter ...
vonjd's user avatar
  • 27.2k
8 votes
3 answers
5k views

Simulate correlated Geometric Brownian Motion in the R programming language

In response to this question: How to simulate correlated Geometric brownian motion for n assets? One of the responses provides an implementation in MATLAB: http://www.goddardconsulting.ca/matlab-...
Ryan J. Shrott's user avatar
8 votes
2 answers
825 views

Does GARCH derived variance explain the autocorrelation in a time series?

Given a time series $u_i$ of returns (where $i=1,\dotsc,t$), $\sigma_i$ is calculated from GARCH(1,1) as $$ \sigma_i^2=\omega+\alpha u_{i-1}^2 +\beta \sigma_{i-1}^2. $$ What is the mathematical ...
user12348's user avatar
  • 1,688
7 votes
2 answers
665 views

How to reduce variance in a Cox-Ingersoll-Ross Monte Carlo simulation?

I am working out a numerical integral for option pricing in which I'm simulating an interest rate process using a Cox-Ingersoll-Ross process. Each step in my Monte Carlo generated path is a ...
Tal Fishman's user avatar
  • 13.3k
7 votes
1 answer
3k views

How to simulate correlated assets for illustrating portfolio diversification?

I have seen multiple instances where people try to explain the diversification effects of having assets with a certain level of correlation, especially in the "most diversified portfolio" literature. ...
Belmont's user avatar
  • 401
6 votes
1 answer
4k views

Michaud's Resampled Efficient Frontier - Out of Sample Simulation Testing

I will be putting ALL my account points on bounty to whoever answers this question [if your answer is crap but it's the only answer, you're getting the 165 points]. You will have to wait 2 days or so ...
user avatar
6 votes
4 answers
7k views

Monte Carlo simulating Cox-Ingersoll-Ross process

The CIR process is given by the SDE $$ \mathrm dr_t = \theta(\mu-r_t)\mathrm dt + \sigma\sqrt{r_t}\mathrm dW_t $$ where $W_t$ is a Brownian motion. I am interested in finite-difference schemes of ...
SBF's user avatar
  • 2,701
4 votes
1 answer
1k 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'...
flxh's user avatar
  • 197
4 votes
2 answers
2k views

Geometric Brownian Motion - increasing simulations or smaller step size

I am running Monte Carlo simulations to estimate future share prices of some stocks. For stock A, I need 1 share price exactly one year from now. For stock B, I need daily prices for each trading ...
Barry's user avatar
  • 41
3 votes
2 answers
269 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 ...
Andr's user avatar
  • 51
3 votes
1 answer
557 views

Use NIG distribution to model stock path

I would like to use Monte Carlo simulation to price some options. First I use standard approach where stock price is discribed by the following process: $$S_T = S_0\exp \left[(r - 0.5\sigma^2)T + \...
tosik's user avatar
  • 456
3 votes
1 answer
207 views

Problems with exact Heston simulations

I am just wondering if there is any problem with the so-called "exact" Heston simulations? So far what I have seen are the good things about it, what are the disadvantages? Because if it is so perfect,...
AZhu's user avatar
  • 793
2 votes
1 answer
947 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 ...
Pierre's user avatar
  • 143
2 votes
1 answer
397 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 ...
GloBag578's user avatar
1 vote
1 answer
393 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 ...
rhaskett's user avatar
  • 1,601
1 vote
1 answer
88 views

Compute moments of aggregate loss using Monte Carlo

Spin-off from here. Richard referred to me an article that tells me how to get parameters of a translated gamma distribution to which I should consider fitting simulated aggregated loss values. The ...
BCLC's user avatar
  • 911
0 votes
1 answer
1k views

Getting the next price of a GBM (Geometric Brownian Motion)

I am writing a program that creates realizations of a GBM. Starting from an initial price, I get the following price with this formula: ...
Pam's user avatar
  • 119