A method of estimating a measure of randomness of a function of at least one representative value of at least one random variable is constructed to have the steps of obtaining the at least one random variable; determining the at least one representative value of the obtained at least one random variable; determining a first statistic of the obtained at least one random variable; determining a gradient of the function with respect to the determined at least one representative value; and transforming the obtained first statistic into a second statistic of the function, using the determined gradient. The step of transforming may be adapted to transform the first statistic into the second statistic, such that the second statistic responds to the first statistic more sensitively in the case of the gradient being steep than in the case of the gradient being gentle.