SummariseEmpiricalPDF: Summarise an Empirical Probability Distribution Function.

Description Usage Arguments Details Value Examples

View source: R/statistical-functions.R

Description

Summarise an Empirical Probability Distribution Function.

Usage

1

Arguments

x

A vector of values of empirical PDF

p

A vector of probabilities

Details

Calculation of the mode is naive. For a multimodal distribution only the highest is returned, in the case of 2 or more modes with exactly the same probability, the first is returned.

Value

Returns a named vector with the mean, median, mode, and standard deviation of the empirical PDF

Examples

1
2
3
df <- data.frame(x = 1:10)
df$p <- dnorm(df$x, 5, 2)
SummariseEmpiricalPDF(df$x, df$p)

EarthSystemDiagnostics/ecustools documentation built on Jan. 15, 2022, 5:22 p.m.