Tag Info

Hot answers tagged

6

the problem is that the pay-off has discontinuous first derivative. Try a contract with pay-off that is twice differentiable and it will probably work. The problem is that all the value comes from the tiny number of paths within $\Delta S$ of the strike, and these paths have huge value. This is a well-known problem. As the bump size goes to zero, the ...


5

There is Monte Carlo Simulation and there is Monte Carlo Simulation. If you are referring to a simple question like simulating dice or calculation of $\pi$ or even vanilla option price calculation, it is one thing and "concisely" available. I recommend get a gist of small examples from CS books and then get on with finance. But if you are referring ...


5

Yes, this technique is called moment matching variance reduction and it may indeed lead to a form of variance reduction. The first and second order moments correspond to the mean and the variance of the distribution. You can extend to higher order moments, which is of course more difficult to implement and creates some extra overhead. The mean can be adjust ...


5

By definition the fair value of an option is given by an expectation value of the payoff, $\mathbf{E}\left[\textrm{payoff}(\textit{paths})\right]$. The probability distribution of the paths is the risk neutral measure. This is just an integral expression of the form you wrote. This applies to all option prices. Many options are, of course, special in the ...


5

importance sampling is well known to be tricky. See the extensive discussion in Glasserman's book. I presume that you are simply meanshifting and multiply by the ratio of normal densities. For this sort of problem, I'd use a more stratified algorithm instead and force every path to end in the money. To do this I'd compute the uniform that goes to the ...


4

You have typo "vol^2", but it should be "vol". Its $$\sqrt{\sigma^2T}=\sigma\sqrt{T}$$


3

The Black-Scholes price of this option is approximately $14.8$. When I run a Monte Carlo simulation with $10000$ paths and "exact" time stepping, I get results very close to this value. You are simulating the terminal asset price with the first-order Euler approximation over multiple time steps: $$S(t+\Delta t)= S(t) + rS(t)\Delta t + \sigma ...


3

You can calibrate the model by discretizing in time, and using a forward induction method as originally proposed by Jamishidian in 1991: F.Jamshidian, Forward Induction and Construction of Yield Curve Diffusion Models, J.Fixed Income 6, 62-74 (1991). Although he formulated this induction in the language of the binomial tree, the method is more general, and ...


3

Your question is too general because Monte Carlo methods differ quite a bit. It's driven more by the problem you are trying to solve, significant result sets, etc, etc. You would either have to provide more details to what you're trying to solve or; try programming some Monte Carlo simulations yourself. My first experience with them was trying to solve ...


3

The error is, you are not storing the random numbers for the same path at the end: xbefore = x + c*tau + sigma*sqrt(tau)*randn() A = muA + sigmaA*randn(); xafter = xbefore + A; But then at end you set a different path here by creating a new random number: xT = log(S0)+(c+muA*lambda)*T+sqrt((sigma^2+(muA^2+sigmaA^2)*lambda)*T)*randn(); randn() ...


3

Sigh. I'm not sure that there's a best way to do multi-threaded MC in QuantLib. I'm afraid that you're underestimating the amount of development you'd need for option 2. You're not going to get away with some OpenMP code as you suggest, because calculations on different paths are not trivially parallel: the RNGs we have are not parallel, and even if you ...


3

In inflation world, the deal payoff is always based on a certain lag convention. That is, the value $I(T)$ always refers to a published index level several months ago or is interpolated based on those published index levels. For example, for a payoff on July 15, 2015, the indexed level referred is the published index level for May, 2015, based on the 2m ...


2

Historical returns are not to be used 'untreated' for the calculation of option prices. The expectation that you will be using in Monte Carlo will take the form $$ C(K,T) = E^Q\{D(T)\ \max[0, S_T-K, 0]\} $$ where $T$ is the maturity, $K$ is the strike price, $S$ is the stock price and $D$ is the discount factor. But the expectation is taken under the 'risk ...


2

This depends on your method to generate the normal random numbers. The problem with normal cdf is that the direct inverse $\phi^{-1}(Z)$ is hard to solve for directly. There are some other methods to generate $N(\mu, \sigma^2)$ from $U(0,1)$. Two notable methods are: Box-Muller method Marsaglia polar method For most purposes you can use the above methods ...


2

I agree with @encor that it isn't an issue to include some logic to avoid errors. I imagine that most non-uniform random number generators already include that. I don't think I've used a pseudo-random number generator that's given a 0. I'm not an expert on the topic, but a common implementation (linear congruential generator) relies on modular arithmetic. ...


2

Indeed for computational purposes, best you can do is use a uniform distribution on another interval $[10^{-10},1-10^{-10}]$, or just discard all occurences of $Z=0,1$. Discarding $Z=0,1$ is justified, since for continuous distributions $P(Z=0)=P(Z=1)=0$.


2

LSM is very fiddly. The most important things in my view are 1) don't believe anyone who says that the choice of basis functions doesn't matter. 2) implement an upper bounder, eg Andersen--Broadie (2003) or Joshi-Tang (2014) so you can tell if your prices are good 3) do two passes, one to build the strategy, one to price, if they give very different ...


2

You should look at confidence interval. Normally, your confidence interval size is proportional to the standard deviation, looking something like: with probability $p$ your value will be in the interval: $$[\bar{S} - k*StdDev, \bar{S} + k*StdDev]$$ Then, getting back to your simulation, we can say that your time step is very big (1 year) and you simulate ...


2

First, please make sure that when you resimulate sample paths, you are keeping your underlying random samples constant, as in this answer. For your delta, vega and rho there is some ambiguity in the definition of the greeks. Consider the simple case of delta in the presence of a skew $\sigma(K/S)$, and say that the underlying price right now is $S_0$. We ...


2

Since there is a closed form in the BS case for continuous barrier options, you probably won't find a huge amount of work on this since it's not needed. In the discrete case, I did a paper with Tang: http://ssrn.com/abstract=1441142 Pricing and Deltas of Discretely-Monitored Barrier Options Using Stratified Sampling on the Hitting-Times to the Barrier


2

I'd recommend M. Joshi and T. Leung "Using Monte Carlo simulation and importance sampling to rapidly obtain jump-diffusion prices of continuous barrier options". Though it assumes jump-diffusion process for the returns it is straightforward to obtain the scheme for a diffusion process. Also Paul Glasserman's [book][2] [2]: ...


2

I am a professor too and I did work with Siemens Corporate Technology which provides the quantitative technology for their copper and electricity trading (Siemens being one of the biggest players in this area in Europe). They are mainly using sophisticated neural networks. We also published a paper together, see my answer here: What types of neural networks ...


2

the output of an MC simulation depends on the random numbers used and if the distribution used is not too weird, after 10,000 runs you will get an answer that is distributed $$ \mu + \frac{\sigma}{\sqrt{n}} Z, $$ with $Z$ a standard normal. Here $n=10,000.$ With $\mu$ the quantity you want and $\sigma$ the standard deviation. So you won't get precisely the ...


2

You should write some kernel functions in CUDA (Nvidia language) for your matlab code. Arrayfun is quite restrictive and not appropriate. Look at this link http://fr.mathworks.com/help/distcomp/run-cuda-or-ptx-code-on-gpu.html for more details about matlab and parallel computing.


2

For a swap, we have a sequence of re-setting and payment dates. The # of forward rates corresponding to the # of payment dates. For example, let us assume that we have $n$ payment dates $t_1, \ldots, t_n$, where $0< t_1 < \cdots < t_n$. Then there are $n$ forward rates. During the simulation, for time steps prior to $t_1$, there exist $n$ ...


2

To keep things simple let's assume you have a perfect random number generator (i.e. I will discuss only the statistics not the numerics of the problem). I will also focus on the practical matter and gloss over some mathematical details. From a practical perspective "convergence" means that you will never get an exact answer from Monte-Carlo but ...


2

This sounds correct, however step 2 is a little vague, so I will try to restate the steps here for you. The assets in your portfolio must be priced with respect to a set of risk factors (e.g. interest rate curve). Each scenario consists of a value for each of your risk factors. Given the value of your risk factors you can price your portfolio. You want ...


2

For non-normal asset price models you could look at the theory of Lévy-processes. If we assume that you work in the physical probability measure $P$ and that the random numbers that you have generated are daily log-returns, then you can do the following: Asset $i$ has starting price $S_0^i$ and for the future prices you can put $$ S_t^i = S_0^i ...


1

There are two things that might be confusing you. The time step in Time dimensions and time steps along the forward curve. The first is given a time t from today until a certain day in the future, this dt usually is the next reset date. The the other is tau representing a tenor for the forward curve maturing in tau days ahead. Dtau could vary ...


1

You are generating a price series, in time steps $p_{dt},p_{2dt},p_{3dt},...$. I assume? So if you do $\text{Median}\{p_{dt},p_{2dt},p_{3dt},..\}$ then you will get a value biased towards $0$ (for the parameters you gave, and the sample size you have). If you want to look at the distributional characteristics of the price, then you have to do so per each ...



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