[Maxima] Maxima and Stochastic Calculus
biomates at telefonica.net
Sat Feb 4 16:54:18 CST 2006
As far as I know, the only package dealing with probabilistic models is
the 'distrib' one:
which includes basic stuff for discrete and continuous distributions.
You can calculate densities, cumulative probabilities, first and second
moments and random simulation.
In particular, the lognormal distribution is also implemented; here is
/************ begin Maxima ***************/
(%i5) /* density function */
(log(x) - m)
sqrt(2) sqrt(%pi) s x
(%i7) /* distribution function */
log(x) - m
sqrt(2) s 1
(%o7) --------------- + -
(%i8) /* kurtosis coefficient */
2 2 2
4 s 3 s 2 s
(%o8) %e + 2 %e + 3 %e - 3
(%i9) /* random sample of size 7 for m=2 and s=1*/
(%o9) [6.7102640819652, 15.81413232484992,
2.648651971238268, 28.90109420904617, 44.80131546192278,
/************ end Maxima ***************/
Densities are defined explicitly, not as derivatives of the distribution
Please, try it and give me your opinion; the package is still under
development and I accept suggestions (in particular those which are not
difficult to implement :-)
El sÃ¡b, 04-02-2006 a las 15:03 +0000, L.Isella escribiÃ³:
> Dear All,
> I have not been active on the Maxima mailing list for a long time.
> I am interested in stochastic calculus for financial applications and I recall some discussion about an implementation of the Ito stochastic calculus for Maxima.
> I wonder if Maxima can do anything like deriving the distribution of a random variable following a certain stochastic process, at least in some cases.
> For example, consider a stock S whose evolution is described by the geometric Brownian motion (BM) leading to Black and Scholes (BS) equation.
> A European option is defined by a certain payoff function depending on the underlying S and can be exercised only at a specific time, called maturity.
> As a consequence of the BM, stock returns are lognormally distributed.
> In the case of a complicated payoff, for which no analytical formula is available, one can still price the option e.g. by Monte Carlo simulating many lognormally distributed returns and take the option's expectation value.
> Depending on the process the stocks are expected to follow, their distribution will be different, but knowing it amounts to being able to price at least certain kinds of options.
> Many thanks
> Best regards
> Maxima mailing list
> Maxima at math.utexas.edu
Mario Rodriguez Riotorto
More information about the Maxima