hellwig: Hellwig's method for choosing an optimal subset of predictors

Description Usage Arguments Details Value Examples

View source: R/hellwig.R

Description

Hellwig's method selects a subset of predictors in a linear model such that they are correlated with the response but relatively uncorrelated among each other.

Usage

1
hellwig(y, x, method = "pearson")

Arguments

y

numeric, response variable

x

numeric matrix of predictors

method

character, type of correlation measures used, passed to cor()

Details

Given m predictors Hellwig's method consists of evaluating all 2^m - 1 combinations using the following steps:

  1. Individual capacity of a predictor variable in a subset is given by:

    h_kj = r_0j^2 / sum_{i \in I} r_ij

    where r_0j is correlation of j-th predictor with the response variable, r_ij is a correlation i-th and j-th predictors, and I is the set of predictors under consideration.

  2. Integral capacity of information for every combination k is equal to:

    H_k = sum_j h_kj

The subset with the highest value of H_k should be selected.

Value

Data frame with two columns:

Examples

1
2
3
4
set.seed(1234)
x <- matrix(rnorm(1000), 250, 4)
y <- rnorm(250)
hellwig(y, x)

mbojan/mbstats documentation built on Dec. 21, 2021, 3:56 p.m.