geometric_weight {mltools}R Documentation

Geometric Weight

Description

Generate geometric weights

Usage

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

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


[Package mltools version 0.3.5 Index]