dtnorm {pumBayes}R Documentation

Density Function for Truncated Normal Distribution

Description

This function calculates the density of a truncated normal distribution at specified points.

Usage

dtnorm(x, mean = 0, sd = 1, lower = -Inf, upper = Inf)

Arguments

x

A numeric vector of quantiles at which to evaluate the density.

mean

A numeric value specifying the mean of the normal distribution (default is 0).

sd

A numeric value specifying the standard deviation of the normal distribution (default is 1, must be positive).

lower

A numeric value specifying the lower bound of truncation (default is -Inf).

upper

A numeric value specifying the upper bound of truncation (default is Inf).

Value

A numeric vector of density values corresponding to the input 'x'. The values are normalized to ensure the total probability within the truncation bounds equals 1. Values outside the truncation bounds are set to 0.

Examples

dtnorm(c(-1, 0, 1), mean = 0, sd = 1, lower = -1, upper = 1)

[Package pumBayes version 1.0.0 Index]