my_e2truncnorm: Expected Squared Value of Truncated Normal

View source: R/truncnorm.R

my_e2truncnormR Documentation

Expected Squared Value of Truncated Normal

Description

Computes the expected squared values of truncated normal distributions with parameters a, b, mean, and sd. Arguments can be scalars, vectors, or matrices. Arguments of shorter length will be recycled according to the usual recycling rules, but a and b must have the same length. Missing values are accepted for all arguments.

Usage

my_e2truncnorm(a, b, mean = 0, sd = 1)

Arguments

a

The lower limit for the support of the truncated normal. Can be -Inf.

b

The upper limit for the support. Can be Inf. a and b must have the same length, and each element of a should be less than or equal to the corresponding element of b.

mean

The mean of the untruncated normal.

sd

The standard deviation of the untruncated normal. Standard deviations of zero are interpreted as numerically (rather than exactly) zero, so that the square of the untruncated mean is returned if it lies within [a, b] and the square of the nearer of a and b is returned otherwise.

Value

The expected squared values of truncated normal distributions with parameters a, b, mean, and sd. If any of the arguments is a matrix, then a matrix will be returned.

See Also

my_etruncnorm, my_vtruncnorm


ashr documentation built on Aug. 22, 2023, 1:07 a.m.