Learn R Programming

VBsparsePCA (version 0.1.0)

foldednorm.mean: The function for obtaining the mean of a folded normal distribution

Description

This function calculates the mean of the folded normal distribution given its location and scale parameters.

Usage

foldednorm.mean(mean, var)

Arguments

mean

Location parameter of the folded normal distribution.

var

Scale parameter of the folded normal distribution.

Value

foldednorm.mean

The mean of the folded normal distribution of iterations to reach convergence.

Details

The mean of the folded normal distribution with location \(\mu\) and scale \(\sigma^2\) is $$\sigma \sqrt{2/\pi} \exp(-\mu^2/(2\sigma^2)) + \mu (1-2\Phi(-\mu/\sigma))$$.

Examples

Run this code
# NOT RUN {
#Calculates the mean of the folded normal distribution with mean 0 and var 1
mean <- foldednorm.mean(0, 1)
print(mean)
# }

Run the code above in your browser using DataLab