-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | HQuantLib is a port of essencial parts of QuantLib to Haskell
--
-- HQuantLib is intended to be a functional style port of QuantLib
-- (http://quantlib.org)
@package hquantlib
@version 0.0.5.2
module QuantLib.Currencies
-- | Canadian dollar
cad :: Currency
-- | U.S. dollar
usd :: Currency
-- | European Euro
eur :: Currency
-- | Swiss france
chf :: Currency
-- | Czech koruna
czk :: Currency
-- | Danish krone
dkk :: Currency
-- | British pound sterling
gbp :: Currency
-- | Currency specification
data Currency
Currency :: String -> String -> Integer -> Integer -> Currency
-- | currency name, e.g. "U.S. dollar"
[cName] :: Currency -> String
-- | ISO 4217 three-letter code, e.g. USD
[cCode] :: Currency -> String
-- | ISO 4217 numeric code, e.g. 840
[cIsoCode] :: Currency -> Integer
-- | number of fractionary parts in a unit
[cFracsPerUnit] :: Currency -> Integer
module QuantLib.Math.Copulas
-- | Copula type class. -| Normally instance should implement only
-- copulaFunc. -| Method copula provides a precheck for [0..1] range for
-- x and y but real implementation is in copulaFunc
class Copula a
copula :: Copula a => a -> Double -> Double -> Maybe Double
copulaFunc :: Copula a => a -> Double -> Double -> Maybe Double
-- | Copula data types with parameters required by the concrete copula
-- definition
data Copulas
-- | Clayton copula
ClaytonCopula :: Double -> Copulas
-- | Min copula
MinCopula :: Copulas
-- | Max copula
MaxCopula :: Copulas
-- | Ali-Mikhail-Haq copula
AliMikhailHaqCopula :: Double -> Copulas
-- | Farlie-Gumbel-Morgenstern copula
FarlieGumbelMorgensternCopula :: Double -> Copulas
-- | Frank copula
FrankCopula :: Double -> Copulas
-- | Galambos copula
GalambosCopula :: Double -> Copulas
-- | Gaussian copula Not implemented yet!
GaussianCopula :: Double -> Copulas
-- | Gumbel copula
GumbelCopula :: Double -> Copulas
-- | Husler-Reiss copula Not implemented yet!
HuslerReissCopula :: Double -> Copulas
-- | Independent copula
IndependentCopula :: Copulas
-- | Marshall-Olkin copula
MarshallOlkinCopula :: Double -> Double -> Copulas
-- | Plackett copula
PlackettCopula :: Double -> Copulas
instance QuantLib.Math.Copulas.Copula QuantLib.Math.Copulas.Copulas
module QuantLib.Math
-- | Computes the inverse cumulative standard normal distribution N(0, 1)
inverseNormal :: Double -> Double
module QuantLib.Money
-- | Amount of cash. Please, note that currency conversion is not
-- implemented yet.
data Money
Money :: Double -> Currency -> Money
[mValue] :: Money -> Double
[mCurrency] :: Money -> Currency
instance GHC.Classes.Eq QuantLib.Money.Money
instance GHC.Show.Show QuantLib.Money.Money
instance GHC.Num.Num QuantLib.Money.Money
module QuantLib.Options
data OptionType
Call :: OptionType
Put :: OptionType
toInt :: OptionType -> Int
toDouble :: OptionType -> Double
instance GHC.Classes.Eq QuantLib.Options.OptionType
instance GHC.Show.Show QuantLib.Options.OptionType
module QuantLib.Position
-- | Position types
data Position
Long :: Position
Short :: Position
instance GHC.Classes.Eq QuantLib.Position.Position
instance GHC.Show.Show QuantLib.Position.Position
module QuantLib.Priceable
-- | All instruments and events have a net present value
class Priceable a
npv :: Priceable a => a -> Double
errorEstimate :: Priceable a => a -> Double
module QuantLib.Instruments
-- | Instrument type class
class Instrument a
iDate :: Instrument a => a -> LocalTime
iIsExpired :: Instrument a => a -> Bool
-- | Composite instrument is an aggregate of other instruments.
data CompositeInstrument
CompositeInstrument :: Map a Double -> CompositeInstrument
-- | Single stock instrument
data Stock
Stock :: Double -> LocalTime -> Stock
[sQuote] :: Stock -> Double
[sDate] :: Stock -> LocalTime
module QuantLib.Prices
-- | Price types
data PriceType
Bid :: PriceType
Ask :: PriceType
Last :: PriceType
Close :: PriceType
Mid :: PriceType
MidEq :: PriceType
MidSafe :: PriceType
-- | Call price
data CallPrice
DirtyPrice :: Double -> CallPrice
[cpPrice] :: CallPrice -> Double
CleanPrice :: Double -> CallPrice
[cpPrice] :: CallPrice -> Double
-- | Interval price
data IntervalPrice
IntervalPrice :: Double -> Double -> Double -> Double -> IntervalPrice
[ipOpen] :: IntervalPrice -> Double
[ipHigh] :: IntervalPrice -> Double
[ipLow] :: IntervalPrice -> Double
[ipClose] :: IntervalPrice -> Double
instance GHC.Classes.Eq QuantLib.Prices.PriceType
instance GHC.Show.Show QuantLib.Prices.PriceType
instance GHC.Classes.Ord QuantLib.Prices.CallPrice
instance GHC.Classes.Eq QuantLib.Prices.CallPrice
instance GHC.Show.Show QuantLib.Prices.CallPrice
instance GHC.Classes.Eq QuantLib.Prices.IntervalPrice
instance GHC.Show.Show QuantLib.Prices.IntervalPrice
module QuantLib.Event
class Event a
evDate :: Event a => a -> Date
evOccured :: Event a => a -> Date -> Bool
evOccuredInclude :: Event a => a -> Date -> Bool
evCompare :: Event a => a -> a -> Ordering
evEqual :: Event a => a -> a -> Bool
-- | Cash flows data type
data CashFlow
CashFlow :: Date -> Double -> CashFlow
[cfDate] :: CashFlow -> Date
[cfAmount] :: CashFlow -> Double
-- | Sequence of cash-flows
type Leg = [CashFlow]
data Callability
Call :: CallPrice -> Date -> Callability
[cPrice] :: Callability -> CallPrice
[cDate] :: Callability -> Date
Put :: CallPrice -> Date -> Callability
[cPrice] :: Callability -> CallPrice
[cDate] :: Callability -> Date
instance GHC.Show.Show QuantLib.Event.CashFlow
instance GHC.Show.Show QuantLib.Event.Callability
instance QuantLib.Event.Event QuantLib.Event.Callability
instance GHC.Classes.Eq QuantLib.Event.Callability
instance GHC.Classes.Ord QuantLib.Event.Callability
instance QuantLib.Event.Event QuantLib.Event.CashFlow
instance GHC.Classes.Eq QuantLib.Event.CashFlow
instance GHC.Classes.Ord QuantLib.Event.CashFlow
module QuantLib.PricingEngines
class Event e => PricingEngine a e
peCalculate :: PricingEngine a e => e -> a -> e
module QuantLib.PricingEngines.BlackFormula
blackFormulaImpliedStdDev :: OptionType -> Double -> Double -> Double -> Double -> Double -> Maybe Double -> Double -> Int -> Maybe Double
module QuantLib.Quotes
-- | Base type class for market observables
class Quote a
qValue :: Quote a => a -> Maybe Double
pureValue :: Quote a => a -> Double
-- | Market element returning a stored value
data SimpleQuote
SimpleQuote :: Maybe Double -> SimpleQuote
-- | Market element whose value depends on two other market elements
data CompositeQuote a
CompositeQuote :: a -> a -> (a -> a -> Maybe Double) -> CompositeQuote a
-- | First element
[cqQuote1] :: CompositeQuote a -> a
-- | Second element
[cqQuote2] :: CompositeQuote a -> a
-- | Composition function
[cqComposite] :: CompositeQuote a -> a -> a -> Maybe Double
-- | Market element whose value depends on another quote
data DerivedQuote a
DerivedQuote :: a -> (a -> Maybe Double) -> DerivedQuote a
[dqQuote] :: DerivedQuote a -> a
[dqDerivateFunc] :: DerivedQuote a -> a -> Maybe Double
-- | Quote for the implied standard deviation of an underlying
data ImpliedStdDevQuote a
ImpliedStdDevQuote :: OptionType -> a -> a -> Double -> Maybe Double -> ImpliedStdDevQuote a
[isdqOptionType] :: ImpliedStdDevQuote a -> OptionType
[isdqForward] :: ImpliedStdDevQuote a -> a
[isdqPrice] :: ImpliedStdDevQuote a -> a
[isdqStrike] :: ImpliedStdDevQuote a -> Double
[isdqGuess] :: ImpliedStdDevQuote a -> Maybe Double
-- | Quote for the Eurodollar-future implied standard deviation
data EurodollarFutureQuote a
EurodollarFutureQuote :: a -> a -> a -> Double -> Maybe Double -> EurodollarFutureQuote a
[efqForward] :: EurodollarFutureQuote a -> a
[efqCallPrice] :: EurodollarFutureQuote a -> a
[efqPutPrice] :: EurodollarFutureQuote a -> a
[efqStrike] :: EurodollarFutureQuote a -> Double
[efqGuess] :: EurodollarFutureQuote a -> Maybe Double
instance GHC.Classes.Eq QuantLib.Quotes.SimpleQuote
instance GHC.Show.Show QuantLib.Quotes.SimpleQuote
instance GHC.Show.Show a => GHC.Show.Show (QuantLib.Quotes.ImpliedStdDevQuote a)
instance GHC.Show.Show a => GHC.Show.Show (QuantLib.Quotes.EurodollarFutureQuote a)
instance QuantLib.Quotes.Quote a => QuantLib.Quotes.Quote (QuantLib.Quotes.EurodollarFutureQuote a)
instance QuantLib.Quotes.Quote a => QuantLib.Quotes.Quote (QuantLib.Quotes.ImpliedStdDevQuote a)
instance QuantLib.Quotes.Quote (QuantLib.Quotes.DerivedQuote a)
instance QuantLib.Quotes.Quote (QuantLib.Quotes.CompositeQuote a)
instance QuantLib.Quotes.Quote QuantLib.Quotes.SimpleQuote
module QuantLib.Stochastic
data PureMT
newPureMT :: IO PureMT
randomDouble :: PureMT -> (Double, PureMT)
splitMT :: PureMT -> (PureMT, PureMT)
splitMTwithSeed :: Integer -> PureMT -> (PureMT, PureMT)
-- | Box-Muller method
data BoxMuller a
mkNormalGen :: RandomGenerator a => IO (BoxMuller a)
-- | Normally distributed generator
class NormalGenerator a
ngGetNext :: NormalGenerator a => a -> (Double, a)
ngMkNew :: NormalGenerator a => a -> IO a
ngSplit :: NormalGenerator a => a -> (a, a)
ngSplitWithSeed :: NormalGenerator a => Integer -> a -> (a, a)
-- | Normal number generation using inverse cummulative normal distribution
data InverseNormal a
mkInverseNormal :: RandomGenerator a => IO (InverseNormal a)
-- | Euler discretization of stochastic processes
data Euler
Euler :: Double -> Euler
[eDt] :: Euler -> Double
-- | Euler end-point discretization of stochastic processes
data EndEuler
EndEuler :: Double -> EndEuler
[eeDt] :: EndEuler -> Double
-- | Discretization of stochastic process over given interval
class Discretize b
dDrift :: (Discretize b, StochasticProcess a) => a -> b -> Dot -> Double
dDiff :: (Discretize b, StochasticProcess a) => a -> b -> Dot -> Double
dDt :: (Discretize b, StochasticProcess a) => a -> b -> Dot -> Double
-- | Dot. t and x pair
data Dot
Dot :: {-# UNPACK #-} !Double -> {-# UNPACK #-} !Double -> Dot
[getT] :: Dot -> {-# UNPACK #-} !Double
[getX] :: Dot -> {-# UNPACK #-} !Double
-- | 1D Stochastic process
class StochasticProcess a
drift :: StochasticProcess a => a -> Dot -> Double
diff :: StochasticProcess a => a -> Dot -> Double
evolve :: (StochasticProcess a, Discretize b) => b -> a -> Dot -> Double -> Dot
-- | Path as list of Dots
type Path = [Dot]
-- | Geometric Brownian motion
data GeometricBrownian
GeometricBrownian :: Double -> Double -> GeometricBrownian
[gbDrift] :: GeometricBrownian -> Double
[gbDiff] :: GeometricBrownian -> Double
-- | Ito process
data ItoProcess
ItoProcess :: (Dot -> Double) -> (Dot -> Double) -> ItoProcess
[ipDrift] :: ItoProcess -> Dot -> Double
[ipDiff] :: ItoProcess -> Dot -> Double
-- | Square-root process
data SquareRootProcess
SquareRootProcess :: Double -> Double -> Double -> SquareRootProcess
[srpSpeed] :: SquareRootProcess -> Double
[srpMean] :: SquareRootProcess -> Double
[srpSigma] :: SquareRootProcess -> Double
-- | Ornstein-Uhlenbeck process
data OrnsteinUhlenbeckProcess
OrnsteinUhlenbeckProcess :: Double -> Double -> Double -> OrnsteinUhlenbeckProcess
[oupSpeed] :: OrnsteinUhlenbeckProcess -> Double
[oupLevel] :: OrnsteinUhlenbeckProcess -> Double
[oupSigma] :: OrnsteinUhlenbeckProcess -> Double
-- | Generalized Black-Scholes process
data BlackScholesProcess
BlackScholesProcess :: (Double -> Double) -> (Double -> Double) -> (Dot -> Double) -> BlackScholesProcess
[bspRiskFree] :: BlackScholesProcess -> Double -> Double
[bspDividend] :: BlackScholesProcess -> Double -> Double
[bspBlackVol] :: BlackScholesProcess -> Dot -> Double
-- | Generates sample path for given stochastic process under
-- discretization and normal generator for given amount of steps,
-- starting from x0
generatePath :: (StochasticProcess a, NormalGenerator b, Discretize c) => b -> c -> a -> Int -> Dot -> Path
module QuantLib.Methods.MonteCarlo
-- | Path pricer provides a price for given path
class PathPricer m
ppPrice :: PathPricer m => m -> Path -> m
-- | Summary type class aggregates all priced values of paths
class PathPricer p => Summary m p | m -> p
-- | Updates summary with given priced pathes
sSummarize :: Summary m p => m -> [p] -> m
-- | Defines a metric, i.e. calculate distance between 2 summaries
sNorm :: Summary m p => m -> m -> Double
-- | Path generator is a stochastic path generator
class PathGenerator m
pgMkNew :: PathGenerator m => m -> IO m
pgGenerate :: PathGenerator m => Integer -> m -> Path
-- | Path-dependant Monte Carlo engine
data PathMonteCarlo s p g
PathMonteCarlo :: s -> p -> g -> PathMonteCarlo s p g
[pmcSummary] :: PathMonteCarlo s p g -> s
[pmcPricer] :: PathMonteCarlo s p g -> p
[pmcGenerator] :: PathMonteCarlo s p g -> g
-- | Stochastic process generator
data ProcessGenerator sp b d
ProcessGenerator :: Dot -> Int -> sp -> b -> d -> ProcessGenerator sp b d
[pgStart] :: ProcessGenerator sp b d -> Dot
[pgLength] :: ProcessGenerator sp b d -> Int
[pgProcess] :: ProcessGenerator sp b d -> sp
[pgGenerator] :: ProcessGenerator sp b d -> b
[pgDiscretize] :: ProcessGenerator sp b d -> d
-- | Monte Carlo engine function
monteCarlo :: (Summary s p, PathGenerator g) => PathMonteCarlo s p g -> Int -> s
-- | Monte Carlo engine function. Parallelized version
monteCarloParallel :: (Summary s p, PathGenerator g) => PathMonteCarlo s p g -> Int -> s
instance (QuantLib.Stochastic.Process.StochasticProcess sp, QuantLib.Stochastic.Random.NormalGenerator b, QuantLib.Stochastic.Process.Discretize d) => QuantLib.Methods.MonteCarlo.PathGenerator (QuantLib.Methods.MonteCarlo.ProcessGenerator sp b d)
module QuantLib.Methods.Pricer
data MaxMinClosePricer
MMCP :: Double -> Double -> Double -> MaxMinClosePricer
[mmcpHigh] :: MaxMinClosePricer -> Double
[mmcpLow] :: MaxMinClosePricer -> Double
[mmcpClose] :: MaxMinClosePricer -> Double
-- | This pricer gets the last point of path
newtype LastPointPricer
LastPointPricer :: Double -> LastPointPricer
-- | This pricer estimates the log of difference between start and end of
-- process
newtype LogLastPointPricer
LogLastPointPricer :: Double -> LogLastPointPricer
instance GHC.Show.Show QuantLib.Methods.Pricer.MaxMinClosePricer
instance QuantLib.Methods.MonteCarlo.PathPricer QuantLib.Methods.Pricer.LogLastPointPricer
instance QuantLib.Methods.MonteCarlo.PathPricer QuantLib.Methods.Pricer.LastPointPricer
instance QuantLib.Methods.MonteCarlo.PathPricer QuantLib.Methods.Pricer.MaxMinClosePricer
module QuantLib.TimeSeries
-- | Time series
type TimeSeries m = Map LocalTime m
-- | Interval price time series
type IntervalPriceSeries = TimeSeries IntervalPrice
module QuantLib.Models.Volatility
-- | Volatility type
type Volatility = Double
-- | Estimation type with strictness as it is usually required only one
-- Double to process
data Estimation
Estimation :: {-# UNPACK #-} !Volatility -> Estimation
-- | Type class of volatility estimators
class VolatilityEstimator algorithm
-- | The estimation procedure that takes a series of IntervalPrice
estimate :: VolatilityEstimator algorithm => algorithm -> IntervalPriceSeries -> Estimation
data VolatilityEstimatorAlgorithm
-- | Simple estimator with drift
SimpleEstimator :: VolatilityEstimatorAlgorithm
-- | Simple estimator without drift
SimpleDriftLessEstimator :: VolatilityEstimatorAlgorithm
-- | Parkinson number
ParkinsonEstimator :: VolatilityEstimatorAlgorithm
-- | Garman-Klass estimator
GarmanKlass5Estimator :: VolatilityEstimatorAlgorithm
-- | Rogers-Stachel estimator
RogersSatchelEstimator :: VolatilityEstimatorAlgorithm
-- | Yang-Zhang estimator
YangZhangEstimator :: VolatilityEstimatorAlgorithm
instance GHC.Classes.Eq QuantLib.Models.Volatility.Estimation
instance GHC.Show.Show QuantLib.Models.Volatility.Estimation
instance GHC.Enum.Enum QuantLib.Models.Volatility.VolatilityEstimatorAlgorithm
instance GHC.Classes.Eq QuantLib.Models.Volatility.VolatilityEstimatorAlgorithm
instance GHC.Show.Show QuantLib.Models.Volatility.VolatilityEstimatorAlgorithm
instance QuantLib.Models.Volatility.VolatilityEstimator QuantLib.Models.Volatility.VolatilityEstimatorAlgorithm
module QuantLib.Models
module QuantLib