Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

spence.21

Spencer's 21 point graduation rule.


Description

Spencer's 21 point rule is a weighted moving average operation for a sequence of observations equally spaced in time. The average at time t depends on the observations at times t-11,...,t+11.

Except for boundary effects, the function will reproduce polynomials up to degree 3.

Usage

spence.21(y)

Arguments

y

Data vector of observations at equally spaced points.

Value

A vector with the same length as the input vector, representing the graduated (smoothed) values.

References

Spencer, J. (1904). On the graduation of rates of sickness and mortality. Journal of the Institute of Actuaries 38, 334-343.

See Also

Examples

data(spencer)
yy <- spence.21(spencer$mortality)
plot(spencer$age, spencer$mortality)
lines(spencer$age, yy)

locfit

Local Regression, Likelihood and Density Estimation

v1.5-9.4
GPL (>= 2)
Authors
Catherine Loader [aut], Jiayang Sun [ctb], Lucent Technologies [cph], Andy Liaw [cre]
Initial release
2020-03-24

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.