Learn R Programming

CoSMoS (version 2.2.0)

PopulationStat: Population statistics

Description

Computes theoretical descriptive statistics of a distribution.

Usage

populationstat(stat = "mean", dist, distarg, p0 = 0, distbounds = c(-Inf, Inf))

popmean(dist, distarg, p0 = 0, distbounds = c(-Inf, Inf))

popsd(dist, distarg, p0 = 0, distbounds = c(-Inf, Inf))

popvar(dist, distarg, p0 = 0, distbounds = c(-Inf, Inf))

popcvar(dist, distarg, p0 = 0, distbounds = c(-Inf, Inf))

popskew(dist, distarg, p0 = 0, distbounds = c(-Inf, Inf))

popkurt(dist, distarg, p0 = 0, distbounds = c(-Inf, Inf))

Value

scalar numeric

Arguments

stat

character; statistic to compute — one of "mean", "sd", "var", "cvar", "skew", "kurt"

dist

character; distribution name (e.g. "norm", "paretoII")

distarg

list of distribution arguments

p0

numeric; probability zero (default 0)

distbounds

numeric vector of length 2; distribution bounds (default c(-Inf, Inf))

See Also

moments, checkTS

Examples

Run this code

library(CoSMoS)

populationstat("mean", "norm", list(mean = 2, sd = 1))
populationstat("sd",   "norm", list(mean = 2, sd = 1))
populationstat("var",  "norm", list(mean = 2, sd = 1))
populationstat("cvar", "norm", list(mean = 2, sd = 1))
populationstat("skew", "norm", list(mean = 2, sd = 1))
populationstat("kurt", "norm", list(mean = 2, sd = 1))

Run the code above in your browser using DataLab