find.moments: Compute Statistical Moments

Description Usage Arguments Details Value See Also Examples

View source: R/find_moments.R

Description

Compute raw and central statistical moments of a distribution of deaths.

Usage

1
find.moments(data, x, y = NULL, n, na.rm = TRUE)

Arguments

data

A data.frame or matrix containing 3 columns: Year, Age, Dx.

x

Vector of ages.

y

Numerical vector indicating the years in input data. Optional. Default: NULL.

n

The maximum order of the moments to be computed. The order should be at least 2.

na.rm

Logical value. If TRUE, remove NA values. Otherwise, keep NA values.

Details

If f(x) is a probability density function, then μ(n) is called the n-th moment of the probability distribution, where:

μ(n) = \int (x-c)^n f(x)dx.

Value

An object containing:

See Also

convert.moments all.moments raw2central

Examples

1
2
3
4
x  <- 0:110
y  <- 1960:2016
dx <- HMD_male$dx$GBRTENW[paste(x), paste(y)]
find.moments(data = dx, x = x, y = y, n = 4)

mpascariu/MortalityForecast documentation built on Sept. 28, 2020, 2:40 p.m.