blurrVector: blurrVector statistically disperses a deterministic vector

Description Usage Arguments Value Author(s) Examples

View source: R/blurrVector.R

Description

This function is a convex combination of the Kronecker Delta function and the Betabinomial distribution.

Usage

1
blurrVector(vec, lambda, sigmaRel = 0.1)

Arguments

vec

Vector of type integer - A deterministic vector containing only zeros, except for one exposed component containing a one.

lambda

A control parameter within [0,1].

sigmaRel

Double - This value controlls the width of the maximum and eventually the dispersion of the resulting vector.

Value

A vector of type double - A probability vector, that is statistically dispersed around the exposed index position and normed to one.

Author(s)

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
N = 150
deterministicVec = rep(0,N)
deterministicVec[N%/%4] = 1
probabilisticVec = blurrVector(vec = deterministicVec,
                               lambda = 0.1,
                               sigmaRel = 0.1)
plot(x = NULL,
     y = NULL,
     xlim = c(1,N),
     ylim = c(0,1),
     type = "p",
     cex = 3,
     col = "black",
     pch = 16)
M = 5
lambda = seq(from = 0,
             to = 1,
             length.out = M)
col = rainbow(M)
sapply(X = 1:M,
       FUN = function(i){
         points(x = 1:N,
               y = blurrVector(vec = deterministicVec,
                               lambda = lambda[i],
                               sigmaRel = 0.1),
               col = col[i])
       })
#' @export

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