Questions tagged [simulations]
The simulations tag has no usage guidance.
30
questions
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}-...
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 ...
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 + \...
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 ...
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 ...
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 ...
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 ...
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 ...
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. ...
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?
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 ...
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 ...
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....
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 ...
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-...
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 ...
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 ...
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. ...
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 ...
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 ...
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'...
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 ...
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 ...
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 + \...
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,...
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 ...
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 ...
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 ...
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 ...
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:
...