Quant Interview


Go Back   Quantitative Finance Forums - quantitative methods, technical analysis, automated trading systems > Quantitative Finance Technical Forums > Numerical Methods
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
Old 02-06-2008, 06:12 PM   #1
Destiny2000
 
Join Date: Feb 2008
Posts: 2
Help! Monte Carlo simulation_ Importance sampling

I try to price a call option very out of money using the importance sampling method in Monte Carlo. My results are not what I was expecting but I can't find out the problem_ It'd be grateful to have your help.
Here is the code in VBA:

Function MCOptionValue5(S0, K, r, T, sigma, c, nsim)

Dim rnmut, sum, sum1, S, F, W, W1, payoff1, payoffsqr, Z
Dim var1
Dim i As Long
Dim nRows As Integer
nRows = Application.WorksheetFunction.CountA(Range("B:B"))

Randomize

rnmut = (r + c - 0.5 * sigma ^ 2) * T
sum1 = 0
sum = 0
For i = 1 To nsim

W = Application.NormSInv(Rnd) * Sqr(T)
W1 = W - (c / sigma) * T
S = S0 * Exp(rnmut + W1 * sigma)
Z = Exp(0.5 * (c / sigma) ^ 2 * T + (c / sigma) * W1)

F = Exp(-r * T) * Application.Max((S - K), 0)

payoff1 = F / Z
payoffsqr = (F / Z) ^ 2

sum = sum + payoff1
sum1 = sum1 + payoffsqr
Next i
MCOptionValue5 = sum / nsim

var1 = sum1 / nsim - (sum / nsim) ^ 2

Cells(nRows + 14, 6) = var1

End Function
Destiny2000 is offline   Reply With Quote
Old 12-31-2009, 01:01 AM   #2
bestdev
 
bestdev's Avatar
 
Join Date: May 2007
Posts: 2,299
A Monte Carlo method is a technique that involves using random numbers and probability to solve problems. The term Monte Carlo Method was coined by S. Ulam and Nicholas Metropolis in reference to games of chance, a popular attraction in Monte Carlo, Monaco.

Computer simulation has to do with using computer models to imitate real life or make predictions. When you create a model with a spreadsheet like Excel, you have a certain number of input parameters and a few equations that use those inputs to give you a set of outputs (or response variables). This type of model is usually deterministic, meaning that you get the same results no matter how many times you re-calculate.
__________________

Impossible is temporary

bestdev is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help! Monte Carlo simulation_ Importance sampling Destiny2000 Numerical Methods 0 02-06-2008 06:08 PM
looking for chevy monte carlo signature series Jeff... jg24 nascar fan The Underground 2 09-15-2007 02:48 AM
Monte Carlo vs Black-Scholes pros and cons bestdev Numerical Methods 3 09-09-2007 01:46 AM
can you help me find a certain monte carlo? cyclotex@sbcglobal.net The Underground 2 09-09-2007 01:14 AM
Monte Carlo option model bestdev Terms Definitions 0 05-13-2007 10:52 PM


All times are GMT. The time now is 07:30 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.