simulate_cdf: Inverse Tranform Sampling

View source: R/stats.R

simulate_cdfR Documentation

Inverse Tranform Sampling

Description

Generates sample numbers at random from any probability distribution given its cumulative distribution function. Pre-defined distribution functions such as pnorm are supported.

See here for the algorithm.

Usage

simulate_cdf(n, cdf, range = c(-1e+200, 1e+200), ...)

Arguments

n

number of observations.

cdf

cumulative distribution function to be sampled from.

range

support of the given cdf.

...

other arguments/parameters to be passed onto cdf.

Examples

simulate_cdf(10, pnorm)
simulate_cdf(10, pbeta, shape1 = 2, shape2 = 2)

SynthETIC documentation built on Sept. 3, 2023, 5:06 p.m.