geometric_weight: Geometric Weight

Description Usage Arguments Details Examples

Description

Generate geometric weights

Usage

1
geometric_weight(k, n, r = 1)

Arguments

k

r^k/sum(r^(1, 2, ... n))

n

r^k/sum(r^(1, 2, ... n))

r

r^k/sum(r^(1, 2, ... n))

Details

Returns a weight based on the formula r^k/sum(r^seq_len(n)). The sequence of weights for k=1, 2, ..., n sum to 1

Examples

1
2
3
geometric_weight(1:3, n=3, r=1)
geometric_weight(1:3, n=3, r=.5)
geometric_weight(1:3, n=3, r=2)

mltools documentation built on May 2, 2019, 5:22 a.m.