# Tag Info

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

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

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

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 don't need to use the Sobol sequence to generate quasi-random numbers in MATLAB. We know the Heston model is represented by the bi-variate system of stochastic differential equations (SDE): \begin{align} & d{{S}_{t}}=rS_tdt+{\sqrt\upsilon_t} d{{W}_{1}}(t) \\ & d{{\upsilon}_{t}}=\kappa(\theta-\upsilon_t) ...

4

the LIBOR market model the Heston model -- Euler and Milstein are actually bad for this and much more sophisticated methods are necessary local volatility models

4

I wouldn't repeat the same algorithm on Excel, because if you make a mistake in your Python code, it's likely that you'll also make the same mistake in your Excel code. Quants usually test an implementation with an analytical formula (not always possible). You should start off with something easy by pricing an European option with your MC algorithm. 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 ...

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

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

Yes, your solution is correct, given the implementation of McSimulation and the interface of SequenceStatistics. We should probably have defined SequenceStatistics as returning instances of Array... As you might have seen, trying to return std::vector<Real> from the path pricer wouldn't work; the result type needs to define arithmetic operations such ...

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

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

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

We set out a general scheme for doing this sort of thing in our paper http://ssrn.com/abstract=1401094 and its sequel http://ssrn.com/abstract=1437847 Whilst the case studied is different, the techniques are the same. I also discuss in detail the whole process in a chapter of More Mathematical Finance. The adjoint method when it applies is generally ...

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 ... 2 You don't say anything about the model or discretization so it is a little hard to judge. However, if you are using an exact discretization, the time step-size should be irrelevant. If you are using an approximate one, the more steps you use, the more accurate it should get. Possible sources of error: 1) random number generator is not good enough and ... 2 You have the right idea, but it seems you don't know \mu, so using it in your error check doesn't seem correct. Also, checking the result every 10,000 iterations may not be optimal for deciding when to stop. To be clear, let E(X) = \mu and Var(X) = \sigma. We're invoking the CLT when we write$$ P\left( \left|\frac{\bar{X}_n - ...

1

First I provide a brief description of Halton sequences. A Halton sequence is a deterministic sequence of numbers that provides well-spaced 'draws' from an interval and provides negative correlation between simulated probability for individuals. Generation is based on a prime number Sequence is constructed based on finer and finer prime-based divisions of ...

1

Given two representations: $$C = E_f[\varphi(X)] = \int \varphi(x) f(x)dx = \int \varphi(x) \frac{f(x)}{g(x)}g(x)dx = E_g[\varphi(X)\frac{f(X)}{g(X)}]$$ The difference of the variances of the MC estimators associated with the two expression is Var[\widehat{C}^f_N] - Var[\widehat{C}^g_N] = \frac{1}{N}\int \varphi(x)^2 \left(1 - ... 1 We assume that the short interest rate r_t follows the Hull-White model, that is, the short rate r and the stock price S satisfies a system of SDEs of the form \begin{align*} dr_t &= \lambda(\theta_t -r_t)dt + \sigma_0 dW_t,\\ dS_t &= S_t\Big[r_t dt + \sigma \Big(\rho dW_t + \sqrt{1-\rho^2} dB_t\Big)\Big], \end{align*} where \lambda, ... 1 It's a combination of too few sample paths and/or too small an increment. Your estimation error on the price is magnified by the dS^2. Try using a larger sample or a larger increment. Alternatively, you can use a multiplier instead of a fixed increment; in my experience, it usually yields better results. 1 Consider an instrument value f(S_0^1, \ldots, S_0^n) that depends on n spot levels. Let\overrightarrow{S}_0=[S_0^1, \ldots, S_0^n]^T be an $n$-dimensional vector representing the spot levels. We can approximate the cross gamma \begin{align*} \frac{\partial^2 f\big(\overrightarrow{S}_0\big)}{\partial S_0^i \partial S_0^j} \end{align*} by a finite ...

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

For LMM I thing the Rebonato's book 2002 is a good reference. He has explained the condition of vol quotation that allow existence of calibration solution. LMM parameters and inputs are quite complexe, calibrator not work maybe caused by your implementation's bugs but not only data input. I think it is better if you calibrate virtually before true market ...

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