moments_truncnorm_vec: Truncated normal mean and variance

View source: R/truncated_normal.R

moments_truncnorm_vecR Documentation

Truncated normal mean and variance

Description

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

Usage

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

Arguments

mu

Mean vector of the normal distribution

std

Standard deviation vector of the normal distribution

a

Left endpoint vector of the truncated interval

b

Right endpoint vector 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 with the same length of 'mu'

var

The truncated normal varaince with the same length of 'mu' or 'NULL'


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