genAlg: genAlg

Description Usage Arguments Details Value See Also Examples

View source: R/RcppExports.R

Description

Genetic algorithm for gemmR.

Usage

1
  genAlg(metricbeta, nbeta, nsuperelites, p, gens, bestmodels, seedmetric)

Arguments

metricbeta

Weights derived using multiple regression. Overwritten if seedmetric is FALSE.

nbeta

Number of candidate weight vectors in each generation.

nsuperelites

Number of candidate weight vectors to involve in permutation for reps > 1.

p

Number of potential predictors.

gens

Generation number. For gens == 1, entirely new weights are generated. When gens > 1, bestmodels are used to generate permutations.

bestmodels

Matrix of best candidate weight vectors from previous generation.

seedmetric

If TRUE, multiple regression weights are used to seed the genetic algorithm. Otherwise, random weights are used.

Details

Currently has fixed scaling factors so predictors should be normalized. Heavily seeded with zero values to interact properly with AIC/BIC calculation.

Value

allbetas

returns a matrix of candidate weights with rows for each predictor and columns for each unique vector of betas.

See Also

gemm for full model-fitting function, tauTest for quick Kendall's tau.

Examples

1
2
  p <- 4
  gen.alg <- genAlg(matrix(rnorm(p), nrow = p), 5, 2, p, 1, matrix(1), TRUE)

jchrszcz/gemmR documentation built on May 18, 2019, 10:24 p.m.