Scenario: A constructor function of the class Scenario

Description Usage Arguments Examples

View source: R/ScenarioConstructor.R

Description

This is a standard generic function used to construct the class Scenario. The Scenario class is applied to the either a Rates object or a TermStructure object

Usage

1
2
3
4
5
6
7
Scenario(
  Name = "character",
  Type = "character",
  ShiftType = "character",
  Shiftbps = "character",
  Formula = "function"
)

Arguments

Name

A character string indicating the unique name which identifies the scenario

Type

A character string indicating the type of scenario "aggressive", "moderate"

ShiftType

A character string indicating the type interest rate shift "Parallel", "Twist", "etc"

Shiftbps

A numeric vector indicating the shift applied to each point on the curve

Formula

A function to apply the shift to each pont on the curve

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
MakeScenario(Name = "Flat50",
Type = "Immediate",
ShiftType = "Twist",
Shiftbps = -75,
Formula = function(rates.data, Shiftbps){
as.character(as.numeric(rates.data[1,2:length(rates.data)]) + 
Shiftbps/yield.basis)})
## End(Not run)  

glennmschultz/BondLab documentation built on May 11, 2021, 5:29 p.m.