Learn R Programming

CharFun (version 0.1.0)

cfX_Rectangular: Characteristic function of Rectangular distribution

Description

cfX_Rectangular(t, a, b) evaluates the characteristic function cf(t) of the Rectangular distribution on the interval (a, b) (Rectangular distribution with mean = (a + b)/2 and variance = 1/12(b - a)^2) cfX_Rectangular(t, a, b) = (exp(ibt) - exp(iat))/(i(b - a)t)

Usage

cfX_Rectangular(t, a = -1, b = 1)

Arguments

t
numerical values (number, vector...)
a
number, default value a = -1
b
number, default value b = 1

Value

characteristic function cf(t) of the Rectangular distribution on the interval (a, b)

See Also

For more details see WIKIPEDIA: https://en.wikipedia.org/wiki/Normal_distribution

Other Continuous Probability distribution: cfS_Arcsine, cfS_Beta, cfS_Gaussian, cfS_Rectangular, cfS_StudentT, cfS_Trapezoidal, cfS_Triangular, cfX_Beta, cfX_ChiSquared, cfX_Exponential, cfX_Gamma, cfX_InverseGamma, cfX_LogNormal, cfX_Normal, cfX_PearsonV, cfX_Triangular

Examples

Run this code
## EXAMPLE1 (CF of the Rectangular distribution on (-2,1))
t <- seq(-50, 50, length.out = 501)
plotGraf(function(t)
  cfX_Rectangular(t, a = -2, b = 1), t, title = "CF of the Rectangular distribution on (-2,1)")

## EXAMPLE2 (PDF/CDF of the Rectangular distribution on (-2,1))
cf <- function(t)
  cfX_Rectangular(t, a = -2, b = 1)
x <- seq(-2, 1, length.out = 101)
prob <- c(0.9, 0.95, 0.99)
xRange <- 3
option <- list()
option$N <- 2 ^ 10
option$dx <- 2 / pi / xRange
result <- cf2DistGP(cf, x, prob, option)

## EXAMPLE3 (PDF/CDF of the Rectangular distribution on (-2,1))
cf <- function(t)
  cfX_Rectangular(t, a = -2, b = 1)
x <- seq(-2, 1, length.out = 101)
prob <- c(0.9, 0.95, 0.99)
result <- cf2DistGP(cf,
                    x,
                    prob,
                    xMin = -2,
                    xMax = 1,
                    N = 2)

Run the code above in your browser using DataLab