HQu-0.0.0.3: quantitative finance library
Safe HaskellNone
LanguageHaskell2010

Q.MonteCarlo

Synopsis

Documentation

type Path b = [(Time, b)] Source #

class PathPricer p => Summary m p | m -> p where Source #

Summary type class aggregates all priced values of paths

Methods

sSummarize :: m -> [p] -> m Source #

Updates summary with given priced pathes

sNorm :: m -> m -> Double Source #

Defines a metric, i.e. calculate distance between 2 summaries

class PathGenerator m where Source #

Path generator is a stochastic path generator

Methods

pgMkNew :: m -> IO m Source #

pgGenerate :: Integer -> m -> Path b Source #

class PathPricer m where Source #

Path pricer provides a price for given path

Methods

ppPrice :: m -> Path b -> m Source #

type MonteCarlo s a = StateT [(Time, s)] RVar a Source #

trajectory Source #

Arguments

:: forall a b d. (StochasticProcess a b, Discretize d b) 
=> d

Discretization scheme

-> a

The stochastic process

-> b

\(S(0)\)

-> [Time]

Stopping points \(\{t_i\}_i^n \) where \(t_i > 0\)

-> [RVar b]

\(dW\)s. One for each stopping point.

-> RVar [b]

\(S(0) \cup \{S(t_i)\}_i^n \)

Generate a single trajectory stopping at each provided time.

trajectories Source #

Arguments

:: forall a b d. (StochasticProcess a b, Discretize d b) 
=> Int

Num of trajectories

-> d

Discretization scheme

-> a

The stochastic process

-> b

\(S(0)\)

-> [Time]

Stopping points \(\{t_i\}_i^n \) where \(t_i > 0\)

-> [RVar b]

\(dW\)s. One for each stopping point.

-> RVar [[b]]

\(S(0) \cup \{S(t_i)\}_i^n \)

Generate multiple trajectories. See trajectory