cdf_trim: Cdf of a trimmed distribution

View source: R/dpqrMethods.R

cdf_trimR Documentation

Cdf of a trimmed distribution

Description

Evaluate the cdf of a trimmed distribution.

Usage

cdf_trim(d, x, trim = c(-Inf, Inf), doTrunc = FALSE)

Arguments

d

distributions3 object

x

Numeric vector, values at which the cdf is evaluated

trim

Numeric vector of size 2, trimming bounds.

doTrunc

Logical, do truncation? default FALSE, i.e. rectification is used.

Value

a numeric vector containing the cdf values.

Examples

# Define Normal distribution
norm <- Normal(mu=0.75,sigma=0.5)
# Define a grid of values x
x=seq(-1,2,,100)
# Compare cdf of basic / rectified / truncated Gaussian distributions
y0=cdf_trim(norm,x)
yr=cdf_trim(norm,x,trim=c(0,1))
yt=cdf_trim(norm,x,trim=c(0,1),doTrunc=TRUE)
plot(x,y0,type='l',ylim=c(0,1))
points(x,yr,col='red')
points(x,yt,col='blue',pch=3)

benRenard/disTRIMbution documentation built on July 1, 2023, 4:24 a.m.