cdf_convert: Convert Random Variables to Cumulative Distribution Function

Description Usage Arguments Details Value Note Author(s) Examples

View source: R/cdf_convert.R

Description

This function returns the F(x) with given x and F.

Usage

1
cdf_convert(x, dist_null, ...)

Arguments

x

a numeric vector of data values.

dist_null

a character string giving the underline distribution in null hypothesis. Distribution options are shown in details.

...

further arguments for distribution parameters.

Details

The dist_null indicates the underlying distribution class. The options follow the distributions regular abbreviation in R, Like norm is normal distribution, unif is uniform distribution, gpd is generalized pareto distribution. Distributions for more distribution options.

Value

A numeric vector with corresponding CDF value is returned

Note

To use gpd, package POT https://cran.r-project.org/package=POT needs to be installed first.

Author(s)

Zhicong Zhao

Examples

1
2
3
4
5
y <- cdf_convert(sort(rnorm(100)), "norm")
plot(seq(0,1,length.out = length(y)), y,
     xlab = "Theoretical Quantiles", ylab = "Sample Quantiles",
     main = "Uniform Q-Q Plot") ## CDF uniform distributed
abline(0,1,col = "red")

zhicongz/AnomDetct documentation built on Dec. 12, 2019, 9:16 a.m.