Learn R Programming

valuer (version 1.1.2)

constant_parameters: Constant parameter class

Description

Class providing a constant parameter object with methods to calculate the integral of the parameter and the squared parameter over a time span.

Usage

constant_parameters

Arguments

Value

Object of R6Class

Format

R6Class object.

Methods

integral

Calculates the integral given the initial and final times. The arguments are two timeDate object with the initial and final times. It returns a numeric scalar with the integral

integral_square (public)

Calculates the integral of the squared constant parameter given the initial and final times. The arguments are two timeDate object with the initial and final times. It returns a numeric scalar with the integral

get (public)

get the constant

Examples

Run this code
# NOT RUN {
r <- constant_parameters$new(0.01)
#Over the full year (365 days) the integral should evaluate to 0.01
r$integral(timeDate::timeDate("2016-07-09"), timeDate::timeDate("2017-07-09"))
#Over the full year the integral square should evaluate to 0.001
r$integral_square(timeDate::timeDate("2016-07-09"), timeDate::timeDate("2017-07-09"))
# }

Run the code above in your browser using DataLab