CTM | R Documentation |
ContractModel
-class constructorCreate an instance of an implementation of class
ContractModel
(e.g.
PrincipalAtMaturityModel
,
StockModel
, etc).
CTM(model) ## S4 method for signature 'character' CTM(model)
object |
If an object of class |
This constructor is in fact a short cut to the constructors
of the implemented classes such as PamModel
for
PrincipalAtMaturityModel
or
StkModel
for StockModel
. Note
that it is not possible to instantiate class
ContractModel
itself but only the implementing
classes extending ContractModel
.
An object of a class extending ContractModel
ContractModel,PrincipalAtMaturityModel
# example 1: create a new 'PAM-Model' object # This example does not work # pam.model = CTM("PrincipalAtMaturity") # example 2: attach the reference to a Java 'PAM-Model' object # to a new R-'PAM' object. Note, the new object will # refer to the same Java contract. # This example does not work # pam.model = CTM("PrincipalAtMaturity") # set(pam.model, what=list( # ContractID = "001", # Currency = "CHF", # ContractRole = "RPA", # StatusDate = "2012-12-31T00", # ContractDealDate = "2012-12-31T00", # InitialExchangeDate = "2013-01-01T00", # MaturityDate = "2013-03-31T00", # NotionalPrincipal = 1000, # NominalInterestRate = 0.01, # DayCountConvention = "30E/360")) # same.pam.model = CTM(pam.model$jref) # example 3: create a new 'PAM-Model' object using the # CT-specific model constructor method pam.model = PamModel()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.