probntrun: Compute the probability mass after truncation.

View source: R/probntrun.R

probntrunR Documentation

Compute the probability mass after truncation.

Description

Compute the probability for the truncation interval (\mathbf{a}, \mathbf{b}).

Usage

probntrun(Obj)

Arguments

Obj

An mtrunmnt object created by the mtrunmnt.

Details

probntrun is a S3 generic function of the class mtrunmnt. Using the multivariate Gaussian quadrature, it computes the probability of truncation interval (\mathbf{a}, \mathbf{b}).

Value

a numeric value.

See Also

mtrunmnt, ptmvnorm.

Examples

###  A simple example ####
set.seed(123)
sigma2e <- 1
sigma2a <- 2
n <- 5
mu <- seq(-1,1, length.out = n)
y <- mu + rnorm(1, sd = sqrt(sigma2a)) + rnorm(n, sd = sqrt(sigma2e))
a  <- rep(-Inf, n)
b  <- rep(Inf, n)
a[y >= 0] <- 0
b[y <  0] <- 0
obj <- mtrunmnt(mu, lower = a, upper = b, Sigmae = sigma2e, D = sigma2a) 
probntrun(obj)

trunmnt documentation built on Dec. 1, 2025, 5:09 p.m.