probability distribution formula?

Quote from gbos:

No, the formulas are working fine both in excel and in any basic compiler. In the zip file I have the implementation exe compiled with FreeBasic compiler together with source code. What error messages did you get?
The question is though: to what markets does the Brownian Motion Model apply? If you don't know, its simply garbage in, garbage out.
 
Quote from nononsense:

The question is though: to what markets does the Brownian Motion Model apply? If you don't know, its simply garbage in, garbage out.

Not exactly. When you try to figure a 20% barrier the tails of the distribution doesn’t come into play. Even with big skewness and kurtosis the barrier remains practically the same. So it comes down to what you are looking for. Of course if you want to figure out the 1/1000 event barrier then no one knows.

In other words for someone not looking for a barrier deep into the tails of the distribution the model applies reasonably well in all liquid markets and all timeframes bigger than a few minutes.
 
gbos

As an example, I’m trying to determine the probability that a stock will touch a given price at any time during a specified period;

Stock Price 500
Up Barrier 550
Time 6 months
Volatility 20%
Drift 4.75%

The calculation works fine in your compiler (53.3% prob), but in Excel I’m getting a #Value error. The formula in the cell using the above example reads;

=ProbPTUB(0.0475,0.2,0.5,550,500)

I’m sure it’s me doing something wrong. Appreciate any help.

PT.
 
nonprophet

I refer you to page 2 of this thread, from which I copied and pasted into VBA. Your <b>prob_hitub</b> does not feature there.

I can see that I should have been using ProbMaxPTUB rather than ProbPTUB for the example I gave above. But neither formula will work anyway.
 
PT, I hadn't noticed the details on page 2, I was referring to probability.xls on page 7. But this spreadsheet alone does pretty much what you're looking for, within excel.
 
Quote from lar:

Just exactly what you are looking for... about $90 US. It uses a Monte Carlo generator. It will run simulations (I use one million sample paths) and tell you the likelyhood of exceeding lower or upper boundary given a certain volatility over a certain period of time. I hope you find it as valuable as I have.

http://www.optionstrategist.com/products/analysis/software/index.html

Peace and gtty,

Lar
:confused:

Looks like an ordinary Black-Scholes calculator. What's so special about this one?
 
I’m sure it’s me doing something wrong. Appreciate any help.

No, it looks like there is a bug. The snorm function is getting an overflow on this line:

snorm = 0.5 + w * (0.5 - 1 / Sqr(2 * pi) * Exp(-z ^ 2 / 2) * (a1 * k + a2 * k ^ 2 + a3 * k ^ 3 + a4 * k ^ 4 + a5 * k ^ 5))

Specifically the overflow happens when it adds 0.5 to the other big term. I don't know enough about visual basic to know why this doesn't work. It seems like maybe the line is just too long.

I fixed it by doing the calculation in 2 steps like this:

Dim test1 As Double

test1 = (0.5 - 1 / Sqr(2 * pi) * Exp(-z ^ 2 / 2) * (a1 * k + a2 * k ^ 2 + a3 * k ^ 3 + a4 * k ^ 4 + a5 * k ^ 5))

snorm = 0.5 + w * test1

After changing that code I get 0.2820...
 
Quote from MTE:/crevelle

I second that, Hoadley's package is well worth those $50 or so.

By the way, Delta is the probability that the option will expire ITM, not that it will be
ITM at any time prior to expiry.

==================================

Believe you are right MTE and that s an important distinction;
and yet the way Creville wrote it has some
important practical trading/invest hints.:cool:
 
Back
Top