optimist_wt: Halflife-weighted mean

Usage Arguments Details Value

View source: R/stats.R

Usage

1
optimist_wt(size, halflife)

Arguments

size

The length of the array

halflife

The parameter for geometric time-weighting

Details

Uses geometric decay weighting where the last observations has weight 1/halflife, with geometric decay. The last halflife observations have weight (1/halflife)^(size - 1).

Value

A vector of length size with weights with total sum 1, decaying geometrically with a factor of 1/halflife and equal weight at the tail.


optimist/inhouse documentation built on May 24, 2019, 3:56 p.m.