nmad_test: Normalized Absolute Deviation

Description Usage Arguments Examples

View source: R/nmad.R

Description

Calculates the Normalized Absolute Deviation between the empirical moments and the moments of the provided distribution. Corresponds to the Kolmogorov-Smirnov test statistic for the zeroth moment.

Usage

1
2
3
4
5
6
7
8
9
nmad_test(
  x,
  r = 0,
  dist,
  prior = 1,
  coeff,
  stat = c("NULL", "max", "sum"),
  ...
)

Arguments

x

data vector

r

moment parameter

dist

character vector containing distribution

prior

named list of priors, defaults to 1

coeff

named list of coefficients

stat

character vector indicating which statistic should be calculated: none (NULL), the maximum deviation "max" or the sum of deviations "sum". Defaults to NULL.

...

Additional arguments can be passed to the parametric moment call.

Examples

1
2
3
4
x <- rlnorm(1e2, meanlog = -0.5, sdlog = 0.5)
nmad_test(x = x, r = 0, dist = "lnorm", coeff = c(meanlog = -0.5, sdlog = 0.5))
nmad_test(x = x, r = 0, dist = "lnorm", coeff = c(meanlog = -0.5, sdlog = 0.5), stat = "max")
nmad_test(x = x, r = 0, dist = "lnorm", coeff = c(meanlog = -0.5, sdlog = 0.5), stat = "sum")

distributionsrd documentation built on July 1, 2020, 10:21 p.m.