R/finiteProbs.r

Defines functions finiteProbs

##
## INPUT:
## x: numeric vector of values in [0, 1]
##
## RETURN:
## numeric vector, ensuring all values of x are numerically inside (0, 1)
##
finiteProbs <- function(x)
{
    x <- replace(x, x < .Machine$double.eps, .Machine$double.eps)
    x <- replace(x, x > 1 - .Machine$double.neg.eps,
                 1 - .Machine$double.neg.eps)
    return(x)
}

Try the games package in your browser

Any scripts or data that you put into this service are public.

games documentation built on May 2, 2019, 3:26 p.m.