# Tag Info

20

Monte Carlo is most useful when you lack analytic tractability or when you have a highly multidimensional problem. For example, even using simple lognormal and poisson models, there exist path-dependent payoffs or multi-asset computations such that no analytic solution exists and such that any PDE finite difference solution would require 3 or more ...

19

The way you do it in the first place is a discretization of the Geometric Brownian Motion (GBM) process. This method is most useful when you want to compute the path between $S_0$ and $S_t$, i.e. you want to know all the intermediary points $S_i$ for $0 \leq i \leq t$. The second equation is a closed form solution for the GBM given $S_0$. A simple ...

8

Two ways: Model the returns using an Ornstein-Uhlenbeck process You can control the variance of the residual noise in the process to your desired level of correlation. Conceptually you inject gaussian noise into the synthetic OU process to satisfy your requirement. For example, let's say you have time-series A which is what you are modelling. Time-series ...

8

"Treshold Garch" or T-Garch models are designed to capture this asymmetry. See this exposition by U. Chicago's Ruey Tsay who has a terrific text on time-series models in "Analysis of Financial Time Series". You can use the structure of the T-Garch models to simulate data with this property. There is a package called fGarch that creates APARCH models. A T-...

8

We cannot give you a relative bid-ask spread that would make sense. The reason for that is that it really depends on several parameters: The type of financial asset you invest in (futures, funds, index, options, ...) The period during which you're trading (I think the liquidity in markets hasn't been the same over time). If you trade intraday, it depends ...

8

Your formula looks like cointegration (between the price time series) rather than correlation (between the returns). To simulate "correlated random walks", i.e., random walks built from correlated innovations, you can just build the desired covariance matrix (for instance, put ones on the diagonal and $\rho$ everywhere else), take multivariate gaussian ...

7

These patterns are of course well-known enough to have been "priced in" to the financial markets. Jump diffusions are a classic way to capture the phenomenon, and often have closed-form option pricing formulas associated with them. The implied option skew, for example, gets a lot flatter when you use a JD model. Jump diffusions are often combined with ...

7

The term "Walk Forward Analysis" typically comes from technical analysis schemes. If that's the case here, I would be careful with whatever you're considering (or reading). Even if you tune your model parameters (and I'm not talking about any TA scheme) with 80% of the data and then "check" your model with the remaining 20%, you're still using that last ...

7

If your variable of integration is truly one-dimensional, as you seem to be saying, then you should be using quadrature to evaluate the expectation integral. The computational efficiency of quadrature is much higher than Monte Carlo in one dimension (even accounting for modified sampling). If your problem is actually multidimensional, your best bet is to ...

6

Yes, there is in fact a whole literature on this subject coming from the field of non-linear dynamics-- it is known as the method of surrogates. The idea is essentially to come up with a "scrambled" version of your original data set that preserves many of the basic statistical properties, though perhaps not the serial dependence structure which might be ...

6

To complement @SRKX comment ,i'll try to explain the "simple mathematical proof" beetween both formula : I assume you know the geometric or arithmetic brownian motion : Geometric: \begin{equation*} dS = \mu S dt + \sigma Sdz \end{equation*} Arithmetic : \begin{equation*} dS = \mu dt + \sigma dz \end{equation*} Then another important stochastic tool you ...

6

By definition, the payoff of a log-contract of maturity $T$ writes $$\phi(S_T) = \ln\left(\frac{S_T}{S_0}\right)$$ Let $\Pi_t$ denote the $t$-value of such a contingent claim. We are interested in the price at $t=0$, best known as the option premium. Theory tells us that the latter premium can be computed as $$\Pi_0 = e^{-rT} E^{\mathbb{Q}} \left[ \phi(... 5 Consider a T \times N matrix of potentially cointegrating prices P. Define Y_{t}\equiv ln\left(P_{t}\right). In the multivariate framework, there are two basic methods to estimate the cointegrating relationships. The first is an error correction framework of the form$$\Delta Y_{t} = \beta_{0}+\beta_{1}\Delta Y_{t-1}+\beta_{2}Y_{t-1}+\varepsilon_{t}$$... 5 One way to construct cointegrated timeseries it to use the error-correction representation (see Engle, Granger 1987 for details of the equivalence). To generate two timeseries that are cointegrated, start with your cointegrating vector (\alpha_1, \alpha_2) so that you want \alpha_1x_t + \alpha_2y_t to be stationary; choose initial values x_0, y_0 and ... 5 Since both ER and S are gaussian random, why not just assume their dependence is captured by their covariance, and make your draws from the bivariate normal distribution? It is hard to construct any other way of making two marginal gaussians cointegrated. Even if the variables were not gaussian, you would probably find yourself relating them using a ... 5 The very easiest change you can make is to switch to quasirandom sampling. I favor the Niederreiter sequence, for which you can find implementations in most languages around the web. You can also get a (sometimes tremendous) speed boost by running using a control variate. Even a swap would probably reduce your variance somewhat. I don't recall the CIR ... 5 Normally, one uses MC methods when: Analytical solutions do not exist PDE style solutions also don't work (they are usually still faster than MC) You need to price some exotic, but computation time does not matter (MC methods are easy(-ier) and fast to code-up) Note: Using MC is not free of assumptions: you always assume a distribution for the driving ... 5 For completeness, let's restate that the discrete case goes like this:$$\Delta S_t = S_{t+\Delta t}- S_t = \mu S_t \Delta t + \sigma \sqrt{\Delta t} Z_t $$with Z_t \sim \mathcal{N}(0,1). What you are doing in your case (although there is a typo in your formula) is to use the exact solution of the SDE to model the move between two points of S. ... 5 It depends on the purpose of your simulation. If you want to model the asset price path for pricing some derivative then you need the risk-neutral measure (thus you take the risk-less rate as drift). Why? Because the risk-neutral measure makes your pricing compatible with the pricing of other contracts in the market. It makes the prices consistent. If ... 5 When I run this simulation I see the same results, and it makes sense. For the straight 50%/50%, I found that my win ration was about 38% and my loss ratio 61%. The reason it wasn't 50/50 was that if I had consecutive up flips my value could keep going up, but if I had consecutive down flips I would 0 out and the sequence would have to end as I had lost ... 4 Wilmott Forums - "How can I simulate correlated random numbers?" Generating correlated normal variates Random Correlated Series Generator (using R) All found with a Google search for "how to generate random correlated series". 4 I found a very good process for running a walk forward analysis in The Encyclopedia of Technical Market Indicators, Second Edition: http://www.amazon.com/Encyclopedia-Technical-Market-Indicators-Second/dp/0070120579 . The approach in the book helps mitigate the problem described above of assemble/test/retest. When you finally implement a trading system, it ... 4 The common practices are: if you trade less than 8% of the Average Daily Volume, you can use a VWAP or Implementation Shortfall algo. you need to "add" a slippage of 1/3 of the bid ask spread of the stock. Your only issue is that you want to use the close price instead of the VWAP one. Best option is to use the daily VWAP as a proxy. Otherwise measure ... 4 When I simulate, I can usually narrow my trades down to the minute. So I set my Open price at the HIGHEST price for the minute, and my close price to the LOWEST price for the minute. The goals is to be as conservative as possible. You don't want to go live and find that you were too optimistic in your fills. If you cannot narrow it down to smaller than a ... 4 I take it you want to do a Monte-Carlo simulation. You just need to decide of an unit of time dt and then start simulating the path. dW_t is simulated using a random normal value. In Excel N\left(\mu, \sigma\right) would be simulated by NORMINV(rand(), mu , sigma). For your Poisson process you just have to simulate random numbers between 0 and 1 and ... 4 Note: There is a typo in your third equations. Instead of S(u) it should be S(t_{i}) and in place of S(t) there should be S(t_{i+1}). In fact, given S(t_{i}) we have that$$S(t_{i+1}) = S(t_{i}) \exp\left( (\mu - \frac{1}{2} \sigma^2) (t_{i+1} - t_{i}) + \sigma (W(t_{i+1}) - W(t_{i})) \right)$$is the exact solution of the SDE. Hence, the ... 4 In general these are the two basic approaches to QuantFinance: Sell side (market maker, risk neutral): You use risk-neutral probabilities ("\mathbb{Q}") e.g. in option pricing (to e.g. calculate your greeks and hedge your portfolio), so that you live on the spread. Buy side (market/risk taker): You use real-world probabilites ("\mathbb{P}") for e.g. ... 4 The formula is given in your link. For the real world probability without jump:$$x_t = x_{t-1} e^{-\eta \Delta t} + \hat{x}(1-e^{-\eta \Delta t}) +\sigma \sqrt{\frac{1-e^{- 2 \eta \Delta t}}{2 \eta}} N(0,1)  where: $x_t$: price $x_{t-1}$: PreviousPrice $\hat{x}$: long term mean (a parameter) $\Delta t$: Time step (one fraction) $\eta$: ...

4

Milstein Scheme This scheme is described in Glasserman (2003) and in Kloeden and Platen (1992) for general processes.Hence, for simplicity, we can assume that the Stochastic Process is driven by the SDE \begin{align} &dX_t=\Xi(t,X_t)dt+\Sigma(t,X_t)dW_t\\ \end{align} Milstein discretization is, \begin{align} dX_{t+\Delta t}=X_t+\Xi(t,X_t)dt+\Sigma(t,X_t)...

3

If you can simulate $N$ times independent realisations of $X_T|X_t$ then SLLN says that : $\tilde{g}^N_t=\sum_{i=1}^N\frac{1}{N}G(X_T)|X_t\to \mathbb{E}[G(X_T)|X_t]$ almost surely this is classical and often the only way to get $\mathbb{E}[G(X_T)|X_t]$ for high dimensional process $X$. You can even use CLT to get a confidence interval for $\tilde{g}_t$ ...

Only top voted, non community-wiki answers of a minimum length are eligible