Generate a sample of size n with a near-perfect distribution.

rnorm_perfect(n, mean = 0, sd = 1)

rcauchy_perfect(n, location = 0, scale = 1)

rpois_perfect(n, lambda)

rt_perfect(n, df, ncp)

Arguments

n

number of observations. If length(n) > 1, the length is taken to be the number required.

mean

vector of means.

sd

vector of standard deviations.

location

location and scale parameters.

scale

location and scale parameters.

lambda

vector of (non-negative) means.

df

degrees of freedom (\(> 0\), maybe non-integer). df = Inf is allowed.

ncp

non-centrality parameter \(\delta\); currently except for rt(), only for abs(ncp) <= 37.62. If omitted, use the central t distribution.

Examples

library(bayestestR) x <- rnorm_perfect(n = 10) plot(density(x))