DistrStats: Estimation of the theoretical Mean, Variance, Skewness and...

Description Usage Arguments Value Examples

View source: R/DistrStats.R

Description

Estimate the theoretical Mean, Variance, Skewness and Kurtosis coefficients of a distribution function, based on the distribution function.

Usage

1
2
3
4
5
6
7
8
9
DistrStats(
  dDistr,
  lb = -Inf,
  ub = Inf,
  subdiv = 90000,
  rel.tol = 10^-8,
  abs.tol = 10^-8,
  ...
)

Arguments

dDistr

The density function (as a function) of the distribution.

lb

A scalar indicating the lower bound of distribution.

ub

A scalar indicating the upper bound of distribution.

subdiv

A scalar indicating the maximum number of subintervals.

rel.tol

A scalar indicating the relative accuracy requested.

abs.tol

A scalar indicating the absolute accuracy requested.

...

Additional named arguments containing the distribution parameters.

Value

A 4-dimensional vector containing the theoretical Mean, Variance, Skewness and Kurtosis coefficients of the distribution.

Examples

1
2
3
4
5
6
7
## Gamma distribution with shape=0.5 and scale=2
DistrStats(dDistr = dgamma, shape=0.5,scale=2,lb = 0)

## Zero-inflated (i.e., mixed) distribution with p0=0.7 and
## continuous part given by Gamma distribution with shape=0.5 and scale=2

DistrStats(dDistr = function(x) dmixed(x,Distr = dgamma, p0=0.7, shape=0.5, scale=2),lb = 0)

itsoukal/anySim documentation built on May 7, 2020, 11:57 p.m.