
12 Jan
2009
12 Jan
'09
9:55 p.m.
On Mon, Jan 12, 2009 at 6:34 PM, Phil
-- Monad Implementation
evolveUnderlying :: (Double, Word64) -> ( (), (Double, Word64) ) evolveUnderlying (stock, state) = ( (), ( newStock, newState ) ) where newState = ranq1Increment state newStock = stock * exp ( ( ir - (0.5*(vol*vol)) )*timeStep + ( vol*sqrt(timeStep)*normalFromRngState(state) ) )
How about: evolveUnderlying :: (Double, Word64) -> (Double, Word64) evolveUnderlying (stock, state) = (newStock, newState) where ... getEvolution = modify evolveUnderlying Luke