# Tag Info

### Is there Multilevel Monte Carlo in QuantLib?

There's no multilevel MC in the library. I guess it could be implemented as a class similar to McSimulation (see this link) which puts together a number of ...
• 7,693
Accepted

### Why do we use a simple average for pricing options in MonteCarlo?

I assume you are talking about taking a probability-weighted average instead of equal-weighted? There is no need for that because naturally a simulated stochastic process will end up more in the ...
• 1,419

### Monte Carlo based mean variance optimization

It seems the MC method is only used to namedrop theory in this case. Yes, you can simulate 10,000 sets of weights to form a cloud of ER to risk plots, but since you're going to solve it with ...

### Why do we adjust the drift in the geometric brownian motion

I assume you are talking about this: $dS_t = \mu S_t dt + \sigma S_t dW_t$ with the solution to the SDE above given as: $S_t = S_0 exp((\mu - \sigma^2/2)t + \sigma W_t)$ The drift is the $\mu$ term ...
• 1,419

### Pricing European Call Closed Form Spread Options in Python

Firstly, you can really use Margrabe's formula (as @Rylan said). It's exact solution, so there is good first test. You can use numerical integration (scipy methods for example) for test your Monte-...
• 46

### Generating normally distributed random numbers using Sobol generator in QuantLib

As Dimitri said, the initialization of the RNG should be outside the loop. The dimension parameter is, roughly speaking, how many random numbers you need for one sample. If one of your trials consists ...
• 7,693

### My Montecarlo Simulation is not working?

Even with 2000 simulations, you may not get the expected return and volatility as your estimated parameters. Try running your monte carlo with more simulation paths and this should close the ...
• 6,632

### My Montecarlo Simulation is not working?

Your sigma seems to be incorrect, the sigma used should be annualized. Therefore, if you use your mean of standard deviation, you need to multiply it with $\sqrt{252}$. I do not think there is ...
• 1,419
1 vote

### What day count convention for pricing

Every market and product has its own pricing conventions that participants are just expected to know. Would guess most vol markets are actual/365 for black-scholes day-count while most swap markets ...
• 1,080
1 vote
Accepted

### How to fix my Monte Carlo simulation?

The problem is that the Heston process describes variance as a mean-reverting process (towards theta). Therefore, if you specify variance as higher than 0.0398 (the theta level it reverts to), the ...
• 1,419
1 vote

### Simulating the Term Structure of Interest Rates in the CIR model

A theoretically sound IR process always reflects today's yield curve. Compounding short rates does not sound reasonable, say today's short rate is 1% and the 1 month spot is 2%, you are way off ...
• 2,451
1 vote

### Sample Wiener process constrained to open (initial), high (max), low (min), close (final)

You can do this (within some small $\epsilon$) using the reflection principle. Let's take the simpler case, where you only want to constrain the maximum. Adding the minimum is a fairly simple ...
• 14.9k
1 vote
Accepted

### Present value of an FX Forward contract at each simulation and time point node of a Monte Carlo simulation

An answer has already been provided in this discussion: How to price the FX forward contract under stochastic interest rates? Here is a summary of the (backward) derivation of equation (1):  V_{t} = ...
• 131
1 vote
Accepted

### Average time it takes to test a strike?

The question is still quite unclear. Assuming you want to solve it mathematically you need to provide at least some assumptions regarding the underlying process/distribution. Assuming you want to ...
• 175
1 vote

### Clustering of Maximum Drawdown Values in Monte Carlo Simulations (Jaekle & Tomasini example)

I do not know the book or that dataset (which, I think, is from package quantstrat?). But it seems that your pnl is daily profit/...
• 3,501
1 vote

### Why do we adjust the drift in the geometric brownian motion

To (hopefully) provide some additional info to the existing answer: Following the notation of Lars Tyge Nielsen, stock prices $S_t$ at time t follow a lognormal distribution in the ...
• 9,014
1 vote

### Use LocalVolTermStructureHandle in Python QuantLib

As of QuantLib 1.30, you can sample your local volatility over a grid and pass the results to the FixedLocalVolSurface class.
• 7,693
1 vote
Accepted

### Method for using Historical Simulation method on an Instrument priced using Monte Carlo

I have been able to get a hold of the man again and he clarified for me. Suppose you are running the Monte Carlo Simulation 10,000 times. You are not going to feasibly be able to re-price the asset ...
• 133
1 vote

### Method for using Historical Simulation method on an Instrument priced using Monte Carlo

I am not sure what you mean by your second point, but to my knowledge, computing historical Value at Risk on a derivative is a full valuation exercise where you use historical data to simulate changes ...
• 11
1 vote
Accepted

### Forward Black Implied Volatility For Within Risk Neutral European Option Pricing

The 'model free forward implied volatility' is pretty useless for your purposes. First of all, it doesn't say anything about the price of future IVs, which you need, and worse it's pretty much ...
• 1,906

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