weights_beta: Compute Beta weighting curves

Description Usage Arguments Details Value References See Also

View source: R/utils.R

Description

Computes Beta weighting curves as in Ghysels, Sinko and Valkanov (2007). Handy to self-select specific time aggregation weighting schemes for input in ctr_agg using the weights argument.

Usage

1
weights_beta(n, a = 1:4, b = 1:4, do.normalize = TRUE)

Arguments

n

a single numeric to indicate the lag length (cf., n).

a

a numeric as the first parameter (cf., a).

b

a numeric as the second parameter (cf., b).

do.normalize

a logical, if TRUE weights are normalized to unity.

Details

The Beta weighting abides by following formula: f(i/n; a, b) / ∑(i/n; a, b), where i is the lag index ordered from 1 to n, a and b are two decay parameters, and f(x; a, b) = (x^(a - 1) * (1 - x)^(b - 1) * T(a + b)) / (T(a) * T(b)), where T(.) is the gamma function.

Value

A data.frame of beta weighting curves per combination of a and b. If n = 1, all weights are set to 1.

References

Ghysels, Sinko and Valkanov (2007). MIDAS regressions: Further results and new directions. Econometric Reviews 26, 53-90, doi: 10.1080/07474930600972467.

See Also

ctr_agg


sentometrics documentation built on Aug. 18, 2021, 9:06 a.m.