With rather simple techniques, J can handle this problem with relative ease, at least in one type of simulation. There is ample literature on this subject, so I am only evoking the subject, with i hope a little J twist. The calculations produce results similar to that obtained from the followings source, so I assume they are correct. I am submitting this because it is fun(to me at least) and to find out if my technique can be improved upon.
Referring again to Pierre l'Ecuyer's examples, who in turn refers us to a book by P. Glasserman: Monte Carlo Methods in Financial Engineering. Springer-Verlag, 2004, we find interesting assumption for the future pricing of an asset. This asset value simulation is the heart of the problem. First let's define succinctly the price of an asian option. In pricing an asian option you are discounting at a risk-free rate the value of an asset in excess of a certain amount(stk , the strike value). With an asian option, the value at a prescribed date is the average of the market value of the security over an agreed period. Then , the interesting part, comes the simulation of the change in asset value. In this simulation, the projected asset value moves in accordance with a geometric Brownian motion. Basically the log of the increase in value is a linear function of time plus a normally distributed variation. In this case the technique is quite transparently be applied to a 100,000 sample. This being only a demonstration the time periods considered appear rather limited. asian=: 3 : 0 'r sig stk s0 s n'=.0.05 0.5 100 100 12 100000 NB. r: risk free appreciation NB. sig: volatility parameter NB. stk: strike value NB. s0: initial value NB. s: time interval NB. n: the sample size dstat b=:(^-r)*stk-~stk>.(%s)*+/^}.+/\(^.s0),(s%~r--:*:sig)+(sig*%:%s)*normalrand s,n ) where +/\(^.s0),(s%~r--:*:sig)+(sig*%:%s)*normalrand : the asset increases exponentially, so its log is a linear function of time plus a normaly distributed variation. (%s)*+/^ is the average for calculation, the exponent changes from log to value. stk-~stk>. is the excess of this mean over the strike price(the agreed future value) (^-r)* is the discount factor The timing of this routine is ok for one asset at 0.82 secs, but it adds up and another technique is required where the number of cases is substantial. ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
