Portfolio form of cash flow amounts
[CFBondDate, AllDates, AllTF, IndByBond] = cfport(CFlowAmounts,
CFlowDates, TFactors)
 Number of bonds ( 


 (Optional) 
[CFBondDate, AllDates, AllTF, IndByBond] = cfport(CFlowAmounts,
CFlowDates, TFactors)
computes a vector of all cash flow
dates of a bond portfolio, and a matrix mapping the cash flows of
each bond to those dates. Use the matrix for pricing the bonds against
a curve of discount factors.
CFBondDate
is a NUMBONDS
by
number of dates (NUMDATES
) matrix of cash flows
indexed by bond and by date in AllDates
. Each row
contains a bond's cash flow values at the indices corresponding to
entries in AllDates
. Other indices in the row contain
zeros.
AllDates
is a NUMDATES
by1
list of all dates that have any cash flow from the bond portfolio.
AllTF
is a NUMDATES
by1
list of time factors corresponding to the dates in AllDates
.
If TFactors
is not entered, AllTF
contains
the number of days from the first date in AllDates
.
IndByBond
is a NUMBONDS
byNUMCFS
matrix
of indices. The ith row contains a list of indices
into AllDates
where the ith
bond has cash flows. Since some bonds have more cash flows than others,
the matrix is padded with NaN
s.