trunc2norm: Convert truncated normal to normal

Description Usage Arguments Value Examples

View source: R/distribution_convertors.R

Description

Convert a truncated normal distribution to a normal (gaussian) distribution

Usage

1
trunc2norm(x, min = NULL, max = NULL, mu = mean(x), sd = stats::sd(x))

Arguments

x

the truncated normally distributed vector

min

the minimum of the truncated distribution (calculated from x if not given)

max

the maximum of the truncated distribution (calculated from x if not given)

mu

the mean of the distribution to return (calculated from x if not given)

sd

the SD of the distribution to return (calculated from x if not given)

Value

a vector with a uniform distribution

Examples

1
2
3
4
x <- truncnorm::rtruncnorm(10000, 1, 7, 3.5, 2)
y <- trunc2norm(x, 1, 7)
g <- ggplot2::ggplot() + ggplot2::geom_point(ggplot2::aes(x, y))
ggExtra::ggMarginal(g, type = "histogram")

faux documentation built on Sept. 14, 2021, 1:08 a.m.