CeBePa: Parameter creation for Beta distribution.

Description Usage Arguments Value Author(s) Examples

View source: R/CeBePa.R

Description

This function transforms the mean value and the standart deviation of a univariate normal distribution into two values alpha and beta, which can be used for a similar shaped distribution function, that is defined on a bounded domain like the Beta distribution.

Usage

1
CeBePa(mean, sigmaRel)

Arguments

mean

Double - A value in the interval [0,1].

sigmaRel

Double - A value describing the width of the resulting maximum value.

Value

A vector with two components of type double - The parameters alpha and beta.

Author(s)

J.C. Lemm, P.v.W. Crommelin

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
mean = 0.5
sigmaRel = 0.1

x = seq(from = -10,
        to = 10,
        by = 0.01)
plot(x = x,
     y = dnorm(x = x,
               mean = mean,
               sd = sigmaRel),
     xlim = c(-0.1,1.1),
     ylim = c(0,10),
     type = "l")
x2 = seq(from = 0,
         to = 1,
         by = 0.001)
params = CeBePa(mean = mean,
                sigmaRel = sigmaRel)
lines(x = x2,
      y = dbeta(x = x2,
                shape1 = params[1],
                shape2 = params[2]),
      col = "red",
      lwd = 3)
legend("topright",
       leg = c("Normal distribution","Beta distribution"),
       col = c("black","red"),
       lwd = c(1,3))

PhilippVWC/myBayes documentation built on Oct. 2, 2020, 8:25 a.m.