Hastructure
Safe HaskellNone
LanguageHaskell2010

Asset

Synopsis

Documentation

class (Show a, UseRate a) => Asset a where Source #

Methods

calcCashflow :: a -> Date -> Maybe [RateAssumption] -> Either String CashFlowFrame Source #

project contractual cashflow of an asset with interest assumptions

getCurrentBal :: a -> Balance Source #

Get current balance of an asset

getOriginBal :: a -> Balance Source #

Get original balance of an asset

getOriginRate :: a -> IRate Source #

Get original rate of an asset

getCurrentRate :: a -> IRate Source #

Get current rate of an asset

getOriginDate :: a -> Date Source #

Get origination date of an asset

getOriginInfo :: a -> OriginalInfo Source #

Get origin info of an asset

isDefaulted :: a -> Bool Source #

if the asset is defaulted

getPaymentDates :: a -> Int -> [Date] Source #

project projected dates of an asset

getRemainTerms :: a -> Int Source #

get number of remaining payments

getRemainDates :: a -> [Date] Source #

get remain payment dates

getTotalTerms :: a -> Int Source #

project asset cashflow under credit stress and interest assumptions

getPastTerms :: a -> Int Source #

projCashflow :: a -> Date -> AssetPerf -> Maybe [RateAssumption] -> Either String (CashFlowFrame, Map CutoffFields Balance) Source #

getBorrowerNum :: a -> Int Source #

Get possible number of borrower

splitWith :: a -> [Rate] -> [a] Source #

Split asset per rates passed in

updateOriginDate :: a -> Date -> a Source #

! Change the origination date of an asset

resetToOrig :: a -> a Source #

! Change the current asset state to the date of origination

getLastInterestPaymentDate :: a -> Maybe Date Source #

Get Last Interest Payment date

calcAccruedInterest :: a -> Date -> Balance Source #

Calculate Accrued Interest

calcAlignDate :: a -> Date -> Date Source #

! Internal use

getObligor :: a -> Maybe Obligor Source #

getObligorTags :: a -> Set String Source #

getObligorId :: a -> Maybe String Source #

getObligorFields :: a -> Maybe (Map String (Either String Double)) Source #

Instances

Instances details
Asset AssetUnion Source # 
Instance details

Defined in AssetClass.MixedAsset

Asset FixedAsset Source # 
Instance details

Defined in AssetClass.FixedAsset

Asset Installment Source # 
Instance details

Defined in AssetClass.Installment

Asset Lease Source # 
Instance details

Defined in AssetClass.Lease

Asset Loan Source # 
Instance details

Defined in AssetClass.Loan

Asset Mortgage Source # 
Instance details

Defined in AssetClass.Mortgage

Asset ProjectedCashflow Source # 
Instance details

Defined in AssetClass.ProjectedCashFlow

Methods

calcCashflow :: ProjectedCashflow -> Date -> Maybe [RateAssumption] -> Either String CashFlowFrame Source #

getCurrentBal :: ProjectedCashflow -> Balance Source #

getOriginBal :: ProjectedCashflow -> Balance Source #

getOriginRate :: ProjectedCashflow -> IRate Source #

getCurrentRate :: ProjectedCashflow -> IRate Source #

getOriginDate :: ProjectedCashflow -> Date Source #

getOriginInfo :: ProjectedCashflow -> OriginalInfo Source #

isDefaulted :: ProjectedCashflow -> Bool Source #

getPaymentDates :: ProjectedCashflow -> Int -> [Date] Source #

getRemainTerms :: ProjectedCashflow -> Int Source #

getRemainDates :: ProjectedCashflow -> [Date] Source #

getTotalTerms :: ProjectedCashflow -> Int Source #

getPastTerms :: ProjectedCashflow -> Int Source #

projCashflow :: ProjectedCashflow -> Date -> AssetPerf -> Maybe [RateAssumption] -> Either String (CashFlowFrame, Map CutoffFields Balance) Source #

getBorrowerNum :: ProjectedCashflow -> Int Source #

splitWith :: ProjectedCashflow -> [Rate] -> [ProjectedCashflow] Source #

updateOriginDate :: ProjectedCashflow -> Date -> ProjectedCashflow Source #

resetToOrig :: ProjectedCashflow -> ProjectedCashflow Source #

getLastInterestPaymentDate :: ProjectedCashflow -> Maybe Date Source #

calcAccruedInterest :: ProjectedCashflow -> Date -> Balance Source #

calcAlignDate :: ProjectedCashflow -> Date -> Date Source #

getObligor :: ProjectedCashflow -> Maybe Obligor Source #

getObligorTags :: ProjectedCashflow -> Set String Source #

getObligorId :: ProjectedCashflow -> Maybe String Source #

getObligorFields :: ProjectedCashflow -> Maybe (Map String (Either String Double)) Source #

Asset Receivable Source # 
Instance details

Defined in AssetClass.Receivable

buildAssumptionPpyDefRecRate :: Asset a => a -> [Date] -> AssetPerfAssumption -> Either String ([Rate], [Rate], Rate, Int) Source #

build pool assumption rate (prepayment, defaults, recovery rate , recovery lag)

buildAssumptionPpyDelinqDefRecRate :: Asset a => a -> [Date] -> AssetPerfAssumption -> Either String ([Rate], [Rate], (Rate, Lag), Rate, Int) Source #

build prepayment rates/ delinq rates and (%,lag) convert to default, recovery rate, recovery lag

getOriginInfo :: Asset a => a -> OriginalInfo Source #

Get origin info of an asset