BesselFunctions: Modified Bessel Functions

Description Usage Arguments Value Author(s) References Examples

Description

A collection and description of special mathematical functions which compute the modified Bessel functions of integer order of the first and second kind as well as their derivatives.

The functions are:

BesselI modified Bessel function of the 1st Kind,
BesselDI its derivative,
BesselK the modified Bessel function of the 3nd Kind,
BesselDK its derivative.

Usage

1
2
3
4
BesselI(x, nu, expon.scaled = FALSE) 
BesselK(x, nu, expon.scaled = FALSE)
BesselDI(x, nu) 
BesselDK(x, nu)

Arguments

expon.scaled

a logical; if TRUE, the results are exponentially scaled.

nu

an integer value greater or equal to zero, the integer order of the modified Bessel function.

x

a positive numeric value or a vector of positive numerical values.

Value

The functions return the values of the selected special mathematical function.

Author(s)

Diethelm Wuertz for the Rmetrics R-port.

References

Abramowitz M., Stegun I.A. (1972); Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables, 9th printing, New York, Dover Publishing.

Weisstein E.W. (2004); MathWorld – A Wolfram Web Resource, http://mathworld.wolfram.com

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
## Bessel I0 and K0 - 
   # Abramowitz-Stegun: Table 9.8, p. 416-422
   x = c(0.0, 0.01, 0.1, 0.2, 0.5, 1, 2, 5, 10, 20, 50)  
   data.frame(x, I = exp(-x)*BesselI(x, 0), K = exp(x)*BesselK(x, 0)) 
   # Compare with R's internal function:
   # data.frame(x, ratio = BesselI(x, 0) / besselI(x, 0))
   # data.frame(x, ratio = BesselK(x, 0) / besselK(x, 0))
   
## x = 0:
   c(BesselI(0, 0), BesselI(0, 1), BesselI(0, 2), BesselI(0, 5))
   # Compare with R's internal function:
   # c(besselI(0, 0), besselI(0, 1), besselI(0, 2), besselI(0, 5))
   c(BesselK(0, 0), BesselK(0, 1), BesselK(0, 2), BesselK(0, 5))
   # Compare with R's internal function:
   # c(besselK(0, 0), besselK(0, 1), besselK(0, 2), besselK(0, 5))
   
## Bessel I2 and K2 - 
   # Abramowitz-Stegun: Table 9.8, p. 416-422
   x = c(0.0, 0.01, 0.1, 0.2, 0.5, 1, 2, 5, 10, 20, 50)  
   data.frame(x, I = BesselI(x, 2)/x^2, K = BesselK(x, 2)*x^2) 
   # Compare with R's internal function:
   # data.frame(x, ratio = BesselI(x, 0) / besselI(x, 0))
   # data.frame(x, ratio = BesselK(x, 0) / besselK(x, 0))
   # data.frame(x, ratio = BesselI(x, 1) / besselI(x, 1))
   # data.frame(x, ratio = BesselK(x, 1) / besselK(x, 1))
   # data.frame(x, ratio = BesselI(x, 5) / besselI(x, 5))
   # data.frame(x, ratio = BesselK(x, 5) / besselK(x, 5))
   # data.frame(x, ratio = BesselI(x,50) / besselI(x,50))
   # data.frame(x, ratio = BesselK(x,50) / besselK(x,50))

Example output

Loading required package: timeDate
Loading required package: timeSeries
Loading required package: fBasics


Rmetrics Package fBasics
Analysing Markets and calculating Basic Statistics
Copyright (C) 2005-2014 Rmetrics Association Zurich
Educational Software for Financial Engineering and Computational Science
Rmetrics is free software and comes with ABSOLUTELY NO WARRANTY.
https://www.rmetrics.org --- Mail to: info@rmetrics.org
Loading required package: fOptions


Rmetrics Package fOptions
Pricing and Evaluating Basic Options
Copyright (C) 2005-2014 Rmetrics Association Zurich
Educational Software for Financial Engineering and Computational Science
Rmetrics is free software and comes with ABSOLUTELY NO WARRANTY.
https://www.rmetrics.org --- Mail to: info@rmetrics.org
       x          I         K
1   0.00 1.00000000       Inf
2   0.01 0.99007459 4.7686940
3   0.10 0.90710093 2.6823261
4   0.20 0.82693855 2.1407573
5   0.50 0.64503527 1.5241094
6   1.00 0.46575961 1.1444631
7   2.00 0.30850832 0.8415682
8   5.00 0.18354081 0.5478076
9  10.00 0.12783334 0.3916319
10 20.00 0.08978031 0.2785449
11 50.00 0.05656163 0.1768072
[1] 1 0 0 0
[1] Inf Inf Inf Inf
       x            I            K
1   0.00          NaN          NaN
2   0.01 1.250010e-01 1.999950e+00
3   0.10 1.251042e-01 1.995040e+00
4   0.20 1.254172e-01 1.980497e+00
5   0.50 1.276246e-01 1.887546e+00
6   1.00 1.357477e-01 1.624839e+00
7   2.00 1.722371e-01 1.015039e+00
8   5.00 7.002246e-01 1.327236e-01
9  10.00 2.281519e+01 2.150982e-03
10 20.00 9.828196e+04 2.531817e-07
11 50.00 1.126572e+17 8.869830e-20

fAsianOptions documentation built on May 2, 2019, 8:19 a.m.