% Generated by roxygen2: do not edit by hand % Please edit documentation in R/distrib.R \name{recovdist} \alias{recovdist} \title{Recovery distribution of a portfolio} \usage{ recovdist(dp, pp, w, S, N) } \arguments{ \item{dp}{Numeric, vector of default probabilities} \item{pp}{Numeric, vector of prepay probabilities} \item{w}{Numeric, vector of weights} \item{S}{Numeric, vector of severities} \item{N}{Integer, number of ticks in the grid} } \value{ a Numeric vector of size \code{N} computing the recovery distribution } \description{ \code{recovdist} computes the recovery distribution of portfolio described by a vector of default probabilities, and prepay probabilities. \eqn{R=\sum_{i=1}^n w_i X_i} where \eqn{X_i=0} w.p. \eqn{1-dp_i-pp_i}, \eqn{X_i=1-S_i} with probability \eqn{dp_i}, and \eqn{X_i=1} w.p. \eqn{pp_i} } \details{ It is a recursive algorithm with first-order correction. For a unit of loss \eqn{lu}, each non-zero value \eqn{v} is interpolated on the grid as the pair of values \eqn{\left\lfloor\frac{v}{lu}\right\rfloor} and \eqn{\left\lceil\frac{v}{lu}\right\rceil} so that \eqn{X_i} has four non zero values. }