Learn R Programming

ecd (version 0.9.2.4)

ecd.erfq: Quartic scaled error function

Description

The scaled error function in quartic pricing model that encaptulates both scaled erfi and erfc functions into a single representation. This is used to provide an elegant expression for the MGF and local option prices, \(L_{c,p}\). When sgn=-1, it is \(\sqrt{\pi}e^{-x^2} erfi(x)\), which twice of Dawson function. When sgn=1, it is \(\sqrt{\pi}e^{x^2} erfc(x)\). ecd.erfq_sum is the summation implementation with truncation rule set forth in the quartic pricing model. It achieves high precision when x > 4.5.

Usage

ecd.erfq(x, sgn)

ecd.erfq_sum(x, sgn)

Arguments

x

numeric

sgn

an integer of 1 or -1

Value

The mpfr object

Examples

Run this code
# NOT RUN {
x <- ecd.erfq(c(5,10,15), 1)
y <- ecd.erfq(c(5,10,15), -1)
# }

Run the code above in your browser using DataLab