as_ZeroHazardRate: Coerce to ZeroHazardRate

Description Usage Arguments Value Examples

View source: R/credit-methods.R

Description

You can coerce objects to the ZeroHazardRate class using this method.

Usage

1
2
3
4
5
6
7
8
9
as_ZeroHazardRate(x, ...)

## S3 method for class 'SurvivalProbabilities'
as_ZeroHazardRate(x, compounding,
  day_basis, ...)

## S3 method for class 'ZeroHazardRate'
as_ZeroHazardRate(x, compounding = NULL,
  day_basis = NULL, ...)

Arguments

x

object to coerce

...

other parameters passed to methods

compounding

a numeric vector representing the compounding frequency.

day_basis

a character vector representing the day basis associated with the interest rate and hazard rate(see fmdates::year_frac())

Value

an ZeroHazardRate object

Examples

1
2
3
library("lubridate")
as_ZeroHazardRate(SurvivalProbabilities(0.95, ymd(20130101), ymd(20140101), CDSSpec("Empty")),
  compounding = 2, day_basis = "act/365")

imanuelcostigan/fmbasics documentation built on Dec. 6, 2019, 9:48 a.m.