Package 'bahc'

Title: Filter Covariance and Correlation Matrices with Bootstrapped-Averaged Hierarchical Ansatz
Description: A method to filter correlation and covariance matrices by averaging bootstrapped filtered hierarchical clustering and boosting. See Ch. Bongiorno and D. Challet, Covariance matrix filtering with bootstrapped hierarchies (2020) <arXiv:2003.05807> and Ch. Bongiorno and D. Challet, Reactive Global Minimum Variance Portfolios with k-BAHC covariance cleaning (2020) <arXiv:2005.08703>.
Authors: Christian Bongiorno and Damien Challet
Maintainer: Damien Challet <[email protected]>
License: GPL
Version: 0.3.0
Built: 2025-03-10 03:33:11 UTC
Source: https://github.com/cran/bahc

Help Index


Compute the BAHC correlation matrix.

Description

Compute the BAHC correlation matrix.

Usage

filterCorrelation(x, k = 1, Nboot = 100)

Arguments

x

A matrix: xi,fx_{i,f} is feature ff of object ii

k

The order of filtering. k=1k=1 corresponds to BAHC.

Nboot

The number of bootstrap copies

Value

The BAHC-filtered correlation matrix of x.

Examples

r=matrix(rnorm(1000),nrow=20)   # 20 objects, 50 features each
Cor_bahc=filterCorrelation(r)

Compute the BAHC covariance matrix.

Description

Compute the BAHC covariance matrix.

Usage

filterCovariance(x, k = 1, Nboot = 100)

Arguments

x

A matrix: xi,fx_{i,f} is feature ff of object ii

k

The order of filtering. k=1k=1 corresponds to BAHC.

Nboot

The number of bootstrap copies

Value

The BAHC-filtered correlation matrix of x.

Examples

r=matrix(rnorm(1000),nrow=20)   # 20 objects, 50 features each
sigma=exp(runif(20))
rs=t(sigma %*% r) %*% sigma
Cov_bahc=filterCovariance(rs)