Skip to contents

Calculates the APV of a loan under competing risks (default vs. prepayment) and left-truncated survival data.

Usage

calculate_apv(
  x,
  cur_age,
  orig_term,
  orig_loan_amt,
  mon_pmt,
  ref_rate,
  recov_curve,
  orig_apy = 0.15,
  type = "constant"
)

Arguments

x

An object of class alife_multi. Typically the output of the estimate_hazard function with two event types.

cur_age

Current age of the loan in months.

orig_term

Original loan term in months.

orig_loan_amt

Original loan amount.

mon_pmt

Monthly payment amount.

ref_rate

Annualized reference discount rate.

recov_curve

Recovery curve data.frame with columns month and recovery (the recovery rate as a proportion of orig_loan_amt). It must contain every month from cur_age to orig_term - 1.

orig_apy

Internal loan APY for amortization. Defaults to 0.15.

type

A character string specifying the extrapolation type passed to extend_hazard(): either "constant" (default), "geometric" or "linear".

Value

A list containing the APV (APV), its second moment (APV2), and its standard deviation (SD).

Details

x must contain exactly two event types, and the default event must be labeled either "Default" or "1"; the other event type is treated as prepayment. If the observed lifetime support does not reach orig_term, the hazards are extrapolated up to orig_term with extend_hazard() (with a warning). After that, hazard estimates must be available for every lifetime from cur_age + 1 to orig_term; otherwise, an error is thrown.