moments_truncnorm: Truncated normal mean and variance

View source: R/truncated_normal.R

moments_truncnormR Documentation

Truncated normal mean and variance

Description

Compute the mean and variance of one dimensional truncated normal random variable

Usage

moments_truncnorm(mu, std, a, b, tol = 1e-06, mean_only = FALSE)

Arguments

mu

Mean of the normal distribution

std

Standard deviation of the normal distribution

a

Left endpoint of the truncated interval

b

Right endpoint of the truncated interval

tol

Computation is only conducted if the truncated normal probability is larger than tol

mean_only

Only compute the truncated normal variance when 'mean_only=FALSE'

Value

A list containing

mean

The truncated normal mean

var

The truncated normal varaince or 'NULL'


udellgroup/mixedgcImp documentation built on Jan. 25, 2023, 7:55 p.m.