trunc-mean-var.Rd
Mean and Variance of a truncated distribution
meanTruncated(f, param1, param2, a, b) varTruncated(f, param1, param2, a, b)
f | string name of a distribution (gamma, norm, beta, lnorm, weibull) |
---|---|
param1 | the first distribution parameter |
param2 | the second distribution parameter |
a | lower truncation limit |
b | upper truncation limit |
a list containing the mean or variance and absolute error
meanTruncated("gamma", 1, 2, 0.1, 5)#> $value #> [1] 1.637227 #> #> $abs.error #> [1] 1.817687e-14 #>varTruncated("gamma", 1, 2, 0.1, 5)#> $value #> [1] 1.518254 #> #> $abs.error #> [1] 1.06135e-13 #>