MrMarc

3163 Reputation

18 Badges

17 years, 133 days

MaplePrimes Activity


These are answers submitted by MrMarc

Ok for example in this application file http://www.maplesoft.com/applications/view.aspx?SID=1464&view=html

the author (which is maplesoft)  are using RandomVariable( LogNormal( (r-sigma^2/2)*T, sigma*sqrt(T) ))

which means that the mean of the LogNormal distribution is assumed to be ( r - sigma^2 / 2 ) which I

again dont understand the reason for since the mean of the LogNormal distribution is exp(u+sigma^2 / 2) .....???

also r I have no idea what that is ....

yes there was certainly a lot of information in those links the problem is however to extract any useful information :-)

It is all mathematical noise to me. It seems that the agend of these authors is "look at me I can present a lot of

fancy equation that I dont have to derive correctly" . It just reminds me of the years at Uni where most professors were to

lazy to prepare anything useful so they took some fancy equations and tried to subjugate the students with complexity ha ha 

Again I do however appreciate your input  but I still dont understand why  the mean is T*(r-0.5*sigma^2 ) and

how it can be derived in Maple

humm still very much unclear.....It is better than some solutions that I have seen but is still not good enough

because it does not answer the question why the mean is assumed to be T*(r-0.5*sigma^2 )

thanx for your input though :-)

Axel,

you seem knowledgeable about this. Could you please just have a quick look at my worksheet that I have attached.

I have tried to derive the option price plus some greeks delta,gamma verga but I have never seen this done before so I am

affraid that I have cut to many corners. Hopefully it will be partially correct at least, ha ha. It would be nice to get some expert opions

 

View 8342_BlackScholesModel-My Interpretation.mw on MapleNet or Download 8342_BlackScholesModel-My Interpretation.mw
View file details

 

Yes, please show as much as possible ( then I can close some option knowledge gaps that is most likely lurking around )

Density functions etc sounds intresting....

I know the that the option price will be given by the discounted expected payoff of the option

PO := exp(-r*T) * ExpectedValue(Payoff) where the Payoff  is 1 if K< ST  and 0 if ST>K 

and where the stock price at time T is given by ST=S0*X where X is a random varaible 

with mean (r-sig^2/2)*T and standard deviation sig*sqrt(T)

then we should get this formula PO := exp(-r*T)*(-(1/2)*erf(sqrt(2)*(2*ln(K)-2*ln(S[0])-2*r*T+sigma^2*T)/(4*sigma*sqrt(T)))+1/2)

I think this is correct but I am not sure.

 

One thing I was wondering why do we take the arithmetric mean approximation (r-sig^2/2)*T  ?

why cant we work with the geometric mean directly ?
 

Axel thanx for your input. I must admit that option pricing is not my strong side due to the mathematical complexity

but I will have a look at it.  Yes, the assumption of constant and serial independent volatility that BS is based

upon is quite unrealistic. Empirical volatility is serial correlated (GARCH) with quite a lot of stochastic jumps (non normal)

I might have programmed the geometric brownian motion wrong hummm

thanx for your effort and sharing that with us Joe. That reduces the time significantly :-)

Thanx for your input Robert.

I ran the code and it took:  Time=260.880  which I assume is in seconds so approx 4-5 minutes.

Which is quicker than my code but not super super fast

I guess it might not be able to do the simulation quicker or ?!  

 

I think the theoretical probability should be P(A,A,A,A)=(4 / 52) * (3 / 51) * (2 / 50) * (1 / 49)  = 1 / 270 725

The probability of 4 aces after one million simulation was given by 1 / 250 000

Which is close but not exactly the theoretical probability  which means that I might have

to increase the sample size. One million might not be enough which increases my demand for speed

yes that is even better :-)

thanx Alec

 

I compared my suggested procedure with Joe's suggested procedures for a large purmutation example.

It should have been 4 series of 13 numbers each (like a deck of cards 13 of each color and 4 colors) but I accidentally

put 14 instead but it does not matter.  It turned out that mine was extremely slow and Joes was extremely fast

 

restart:
with(combinat):

st := time():

C := [ ];
X := cartprod([[seq(i, i = 1 .. 14)], [seq(i, i = 1 .. 14)], [seq(i, i = 1 .. 14)], [seq(i, i = 1 .. 14)]]);
while not X[finished] do C := [op(C), X[nextvalue]()] end do;
nops(C);

time()-st;

                                    38416
                                   425.602



restart:

st := time():

CartProdSeq := proc (L::(seq(list)))
option `Copyright (C) 2007, Joseph Riel. All rights reserved.` :
eval([subs(Seq = seq, foldl(Seq, [cat(i, 1 .. nargs)], seq(cat(i, j) = L[j], j = nargs .. 1, -1)))]) end proc :
A := CartProdSeq([seq(i, i = 1 .. 14)], [seq(i, i = 1 .. 14)], [seq(i, i = 1 .. 14)], [seq(i, i = 1 .. 14)]) :
nops(A);

time()-st;

                                    38416
                                    0.187
 

this is the code I had to use to get what I wanted

restart:
with(combinat):
C := [ ]:
X := cartprod([[seq(i, i = 1 .. 6)], [seq(i, i = 1 .. 6)]]) :
while not X[finished] do C := [op(C), X[nextvalue]()] end do :

C;
nops(C);

 [[1, 1], [1, 2], [1, 3], [1, 4], [1, 5], [1, 6], [2, 1], [2, 2], [2, 3],

   [2, 4], [2, 5], [2, 6], [3, 1], [3, 2], [3, 3], [3, 4], [3, 5], [3, 6],

   [4, 1], [4, 2], [4, 3], [4, 4], [4, 5], [4, 6], [5, 1], [5, 2], [5, 3],

   [5, 4], [5, 5], [5, 6], [6, 1], [6, 2], [6, 3], [6, 4], [6, 5], [6, 6]]
                                     36

 

It is far from pretty..... I nice default maple procedure would indeed be needed here :-)

 

thanx for your input :-)

yes maybe I am looking for the Cartesian product. I was not aware of its existence of significance.

I am want to calculate the probability of finding two 1:s after I roll two dice.

The total number of combinations are 36 so the probability is 1 / 36  (1/6*1/6)  not 1 / 30 as permute suggest. hummm......

"Already I think more people use mathematica than maple"

Yes I think so too but I dont know the reason for it ? I find the Maple syntax (loops, procedures,sliders) to be easier than

Mathematica but I guess in the end it is what you are used to and maybe Mathematica is used more frequently at entery

level at university so people get used to it...I dont know...  :-)

- One thing that I do not like with Mathematica is the split window thing.

I find it annoying and I wonder if there is a solution to that and why they have it that way?

 

- One thing I dont like with MATLAB is that you have to right click on an old command and select evaluate in order to run it.

In Maple you can simple press enter on any command irregadles of its position (which is very nice) which you cant do in MATLAB.

 

- One thing I like in MATLAB is the way you can bookmark and save section of code in the meny on top.

and then simply click on such a shortcut to run it . very nice :-)

 

- One thing I like with Maple is the output from statistical tests ie (Normality test). Not only does Maple specify the

hypothesis but Maple also gives you the interpretation of the test. For example H0 rejected which means that bla bla bla

very nice :-)

First 12 13 14 15 16 17 18 Last Page 14 of 24