| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
QuantLib.Index
Synopsis
- data GenIndex idx
- type Index = GenIndex CIndex
- data HistoricalIndexAnalysis
- asIndex :: GenIndex idx -> IO Index
- historicalIndexAnalysis :: Day -> Day -> (Int, TimeUnit) -> [Index] -> IO HistoricalIndexAnalysis
- addFixing :: GenIndex idx -> Day -> Double -> Bool -> IO ()
- addFixings :: GenIndex idx -> [(Day, Double)] -> Bool -> IO ()
- clearFixings :: GenIndex idx -> IO ()
- clearAllFixingHistories :: IO ()
- name :: GenIndex idx -> IO String
- fixingCalendar :: GenIndex idx -> IO Calendar
- fixing :: GenIndex idx -> Day -> Bool -> IO Double
- hasHistoricalFixing :: GenIndex idx -> Day -> IO Bool
- isValidFixingDate :: GenIndex idx -> Day -> IO Bool
- fixingHistory :: GenIndex idx -> IO [(Day, Double)]
- fixingHistoryNames :: IO [String]
- skipped :: HistoricalIndexAnalysis -> IO [(Day, String)]
- mean :: HistoricalIndexAnalysis -> IO [Double]
- standardDeviation :: HistoricalIndexAnalysis -> IO [Double]
- skewness :: HistoricalIndexAnalysis -> IO [Double]
- kurtosis :: HistoricalIndexAnalysis -> IO [Double]
- minimumReturn :: HistoricalIndexAnalysis -> IO [Double]
- maximumReturn :: HistoricalIndexAnalysis -> IO [Double]
- semiVariance :: HistoricalIndexAnalysis -> IO [Double]
- semiDeviation :: HistoricalIndexAnalysis -> IO [Double]
- downsideVariance :: HistoricalIndexAnalysis -> IO [Double]
- downsideDeviation :: HistoricalIndexAnalysis -> IO [Double]
- percentile :: HistoricalIndexAnalysis -> Double -> IO [Double]
- gaussianPercentile :: HistoricalIndexAnalysis -> Double -> IO [Double]
- valueAtRisk :: HistoricalIndexAnalysis -> Double -> IO [Double]
- potentialUpside :: HistoricalIndexAnalysis -> Double -> IO [Double]
- gaussianPotentialUpside :: HistoricalIndexAnalysis -> Double -> IO [Double]
- regret :: HistoricalIndexAnalysis -> Double -> IO [Double]
- shortfall :: HistoricalIndexAnalysis -> Double -> IO [Double]
- gaussianShortfall :: HistoricalIndexAnalysis -> Double -> IO [Double]
- averageShortfall :: HistoricalIndexAnalysis -> Double -> IO [Double]
- gaussianAverageShortfall :: HistoricalIndexAnalysis -> Double -> IO [Double]
- gaussianValueAtRisk :: HistoricalIndexAnalysis -> Double -> IO [Double]
- expectedShortfall :: HistoricalIndexAnalysis -> Double -> IO [Double]
- gaussianExpectedShortfall :: HistoricalIndexAnalysis -> Double -> IO [Double]
- covariance :: HistoricalIndexAnalysis -> IO (Matrix Double)
- correlation :: HistoricalIndexAnalysis -> IO (Matrix Double)
Types
Index
InterestRateIndex
BMAIndex
IborIndex
OvernightIborIndex (COvernightIndex')
SwapIndex
OvernightIndexedSwapIndex
SwapSpreadIndex
InflationIndex
YoYInflationIndex
ZeroInflationIndex
EquityIndex
CommodityIndexConstructors
historicalIndexAnalysis Source #
Computes SequenceStatistics (mean/standard deviation/skewness/kurtosis/min/max/semi-
and downside-variance and -deviation/percentiles/value-at-risk/expected shortfall,
empirical and gaussian-assumption/covariance/correlation) over historical fixings of the
given indexes, sampled every step between startDate and endDate. A date/index pair whose
fixing is unavailable is recorded in skipped rather than failing the whole analysis.
SequenceStatistics is only the accumulator filled internally by this constructor, so its
risk-statistics surface is exposed directly through these accessors.
Mutators
stores the historical fixing at the given date; the date must be the actual calendar date of the fixing, not a settlement date
addFixings :: GenIndex idx -> [(Day, Double)] -> Bool -> IO () Source #
Stores historical fixings as (date, value) pairs; the date is the actual fixing date.
clearFixings :: GenIndex idx -> IO () Source #
clears all stored historical fixings for this index
clearAllFixingHistories :: IO () Source #
Clears every native fixing history in QuantLib's process-global store, for all index names. This affects other index instances and is intended for explicit session or test cleanup.
Inspectors
Index fixings
name :: GenIndex idx -> IO String Source #
The index's own name, as QuantLib builds it -- for an interest-rate index the family name,
tenor and day counter, e.g. "Euribor6M Actual/360". This is the key QuantLib's
process-global fixing store uses, so it is the name a stored fixing is filed under.
fixingCalendar :: GenIndex idx -> IO Calendar Source #
returns the calendar defining valid fixing dates
returns the fixing at the given date, forecasting it if not available and forecastTodaysFixing is true
hasHistoricalFixing :: GenIndex idx -> Day -> IO Bool Source #
whether a historical fixing has been stored for the given date
isValidFixingDate :: GenIndex idx -> Day -> IO Bool Source #
whether the given date is a valid fixing date for this index
fixingHistory :: GenIndex idx -> IO [(Day, Double)] Source #
Returns every stored native fixing for this index, in ascending date order. This is a snapshot copied out of QuantLib's process-global fixing store; it has no forecasting behavior.
fixingHistoryNames :: IO [String] Source #
Returns the names with an entry in QuantLib's process-global fixing store. Names are case-insensitive in that store and can be shared by separate index instances.
Historical return analysis
skipped :: HistoricalIndexAnalysis -> IO [(Day, String)] Source #
Skipped fixing dates paired with the reason no complete fixing vector was available.
mean :: HistoricalIndexAnalysis -> IO [Double] Source #
Per-index mean of the historical relative returns actually sampled.
standardDeviation :: HistoricalIndexAnalysis -> IO [Double] Source #
Per-index standard deviation of the historical relative returns actually sampled.
skewness :: HistoricalIndexAnalysis -> IO [Double] Source #
Per-index skewness of the historical relative returns actually sampled.
kurtosis :: HistoricalIndexAnalysis -> IO [Double] Source #
Per-index (excess) kurtosis of the historical relative returns actually sampled.
minimumReturn :: HistoricalIndexAnalysis -> IO [Double] Source #
Per-index minimum of the historical relative returns actually sampled.
maximumReturn :: HistoricalIndexAnalysis -> IO [Double] Source #
Per-index maximum of the historical relative returns actually sampled.
semiVariance :: HistoricalIndexAnalysis -> IO [Double] Source #
Per-index variance of the historical relative returns falling below the mean.
semiDeviation :: HistoricalIndexAnalysis -> IO [Double] Source #
Per-index square root of semiVariance.
downsideVariance :: HistoricalIndexAnalysis -> IO [Double] Source #
Per-index variance of the historical relative returns falling below zero.
downsideDeviation :: HistoricalIndexAnalysis -> IO [Double] Source #
Per-index square root of downsideVariance.
Arguments
| :: HistoricalIndexAnalysis | |
| -> Double | y |
| -> IO [Double] |
Per-index empirical y-th percentile of the historical relative returns actually sampled;
y must lie in [0.9, 1.0).
Arguments
| :: HistoricalIndexAnalysis | |
| -> Double | y |
| -> IO [Double] |
Per-index y-th percentile assuming the historical relative returns are gaussian; y must lie in [0.9, 1.0).
Arguments
| :: HistoricalIndexAnalysis | |
| -> Double | centile |
| -> IO [Double] |
Per-index empirical value-at-risk at the given centile, which must lie in [0.9, 1.0).
Arguments
| :: HistoricalIndexAnalysis | |
| -> Double | centile |
| -> IO [Double] |
Per-index empirical potential upside at the given centile, which must lie in [0.9, 1.0) --
the upside counterpart of valueAtRisk.
gaussianPotentialUpside Source #
Arguments
| :: HistoricalIndexAnalysis | |
| -> Double | centile |
| -> IO [Double] |
Per-index potential upside at the given centile assuming the historical relative returns
are gaussian; centile must lie in [0.9, 1.0).
Arguments
| :: HistoricalIndexAnalysis | |
| -> Double | target |
| -> IO [Double] |
Per-index regret at the given target: expected loss below target, conditional on being below it.
Arguments
| :: HistoricalIndexAnalysis | |
| -> Double | target |
| -> IO [Double] |
Per-index empirical probability of falling below target.
Arguments
| :: HistoricalIndexAnalysis | |
| -> Double | target |
| -> IO [Double] |
Per-index probability of falling below target assuming the historical relative returns are gaussian.
Arguments
| :: HistoricalIndexAnalysis | |
| -> Double | target |
| -> IO [Double] |
Per-index empirical average shortfall (expected loss below target, unconditional) at the given target.
gaussianAverageShortfall Source #
Arguments
| :: HistoricalIndexAnalysis | |
| -> Double | target |
| -> IO [Double] |
Per-index average shortfall at the given target assuming the historical relative returns are gaussian.
Arguments
| :: HistoricalIndexAnalysis | |
| -> Double | centile |
| -> IO [Double] |
Per-index value-at-risk at the given centile assuming the historical relative returns are gaussian; centile must lie in [0.9, 1.0).
Arguments
| :: HistoricalIndexAnalysis | |
| -> Double | centile |
| -> IO [Double] |
Per-index empirical expected shortfall at the given centile, which must lie in [0.9, 1.0).
Throws if no sampled return falls below the value-at-risk threshold.
gaussianExpectedShortfall Source #
Arguments
| :: HistoricalIndexAnalysis | |
| -> Double | centile |
| -> IO [Double] |
Per-index expected shortfall at the given centile assuming the historical relative returns
are gaussian; centile must lie in [0.9, 1.0).
covariance :: HistoricalIndexAnalysis -> IO (Matrix Double) Source #
Covariance matrix of the historical relative returns across indexes.
correlation :: HistoricalIndexAnalysis -> IO (Matrix Double) Source #
Correlation matrix of the historical relative returns across indexes.