hasquant
Safe HaskellNone
LanguageHaskell2010

QuantLib.Index

Synopsis

Types

data GenIndex idx Source #

Index
 InterestRateIndex
   BMAIndex
   IborIndex
     OvernightIborIndex (COvernightIndex')
   SwapIndex
     OvernightIndexedSwapIndex
   SwapSpreadIndex
 InflationIndex
   YoYInflationIndex
   ZeroInflationIndex
 EquityIndex
 CommodityIndex

Instances

Instances details
Show (GenIndex idx) Source # 
Instance details

Defined in QuantLib.Internal.Type

Methods

showsPrec :: Int -> GenIndex idx -> ShowS #

show :: GenIndex idx -> String #

showList :: [GenIndex idx] -> ShowS #

type Index = GenIndex CIndex Source #

The root of the hierarchy shown under GenIndex.

Constructors

historicalIndexAnalysis Source #

Arguments

:: Day

startDate

-> Day

endDate

-> (Int, TimeUnit)

step

-> [Index] 
-> IO HistoricalIndexAnalysis 

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

addFixing Source #

Arguments

:: GenIndex idx 
-> Day 
-> Double

fixing

-> Bool

forceOverwrite

-> IO () 

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

fixing Source #

Arguments

:: GenIndex idx 
-> Day 
-> Bool

forecastTodaysFixing

-> IO Double 

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.

downsideVariance :: HistoricalIndexAnalysis -> IO [Double] Source #

Per-index variance of the historical relative returns falling below zero.

percentile Source #

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).

gaussianPercentile Source #

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).

valueAtRisk Source #

Arguments

:: HistoricalIndexAnalysis 
-> Double

centile

-> IO [Double] 

Per-index empirical value-at-risk at the given centile, which must lie in [0.9, 1.0).

potentialUpside Source #

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).

regret Source #

Arguments

:: HistoricalIndexAnalysis 
-> Double

target

-> IO [Double] 

Per-index regret at the given target: expected loss below target, conditional on being below it.

shortfall Source #

Arguments

:: HistoricalIndexAnalysis 
-> Double

target

-> IO [Double] 

Per-index empirical probability of falling below target.

gaussianShortfall Source #

Arguments

:: HistoricalIndexAnalysis 
-> Double

target

-> IO [Double] 

Per-index probability of falling below target assuming the historical relative returns are gaussian.

averageShortfall Source #

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.

gaussianValueAtRisk Source #

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).

expectedShortfall Source #

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.