truncate_dist: Truncation function for normal distributions (truncates both...

View source: R/truncate.R

truncate_distR Documentation

Truncation function for normal distributions (truncates both mean and variance)

Description

This function computes the mean and variance of a normal distributions that has been truncated at one or both ends.

Usage

truncate_dist(a = -Inf, b = Inf, mean = 0, sd = 1)

Arguments

a

Quantile (i.e., cut score) below which scores should be censored from the distribution.

b

Quantile (i.e., cut score) above which scores should be censored from the distribution.

mean

Scalar mean or vector of means.

sd

Scalar standard deviation or vector of standard deviations.

Value

A matrix of truncated means (column 1) and truncated variances (column 2).

Examples

truncate_dist(a = -1, b = 3, mean = 0, sd = 1)
truncate_dist(a = 1, b = Inf, mean = 0, sd = 1)
truncate_dist(a = c(-1, 1), b = c(3, Inf), mean = 0, sd = 1)

jadahlke/psychmeta documentation built on Feb. 11, 2024, 9:15 p.m.