Fast Redundancy Analysis (RDA) with High-Performance 'C++' Backend

Provides a high-performance implementation of redundancy analysis (RDA) in 'C++' using 'Armadillo' and 'OpenMP'. The rank-revealing step uses an economical singular value decomposition that reports an explicit numerical rank and reciprocal condition number and supports Moore-Penrose minimum-norm coefficients for rank-deficient designs. Supports standard and partial RDA, centering, scaling, overall and axis-wise permutation tests (for partial RDA a scheme that permutes the predictors and re-residualizes them on the covariates, with a Freedman-Lane permutation as an option), biplot visualization, score extraction, and prediction. Designed for large ecological, genomic, and other multivariate data sets where computational speed and memory efficiency are required.


fastrda: Fast Redundancy Analysis (RDA) with HPC C++ Backend

fastrda is a high-performance implementation of Redundancy Analysis (RDA) for R, written in C++ using Armadillo and OpenMP. It is designed for ecological, genomic, and other large multivariate datasets where computational efficiency is critical. fastrda

Features

  • High-performance C++ backend using Armadillo
  • OpenMP parallel computation
  • Standard and partial redundancy analysis (RDA), based on a rank-revealing SVD
  • Parallel permutation tests (anova() and anova_fastrda())
  • Prediction for new observations
  • Multiple score scaling options
  • Score extraction via fastrda_scores() (without masking vegan::scores()) and biplot_scores()
  • Optional workspace retention (keep_workspace) for permutation tests and prediction
  • Biplots

Installation

CRAN

install.packages("fastrda")


Quick Example

library(fastrda)
library(vegan)

data(mite, mite.env)

# Hellinger transformation (community data: keep the variances, so scale = FALSE)
Y <- decostand(mite, "hellinger")

# Environmental variables
X <- model.matrix(~ SubsDens + WatrCont, mite.env)[, -1]

fit <- fastrda(
  response = Y,
  predictors = X,
  scale = FALSE,
  axes = 2,
  keep_workspace = TRUE
)

summary(fit)

# Extract sample/response scores and biplot scores
sc <- fastrda_scores(fit, display = "both", choices = 1:2)
bp <- biplot_scores(fit, type = "both", scaling = 2)

# Ordination plot
plot(fit)

Permutation test

anova(fit, permutations = 999)

For partial RDA (covariates = Z) the default (scheme = "permute-x") keeps the residualized response fixed, and in every permutation the rows of the predictors are permuted and re-residualized on the covariates. A Freedman-Lane permutation is available with scheme = "freedman-lane"; it is conservative (low power) when the number of responses is large (e.g. p >= 2000). Both are approximate tests.

Direct biplot

biplotrda(fit)


Workspace Modes

keep_workspace is a single on/off switch.

Value Effect
TRUE (default) Keeps Q, QtY, the residualized response Y_res and (partial RDA) the covariate basis Qz and the centered predictors Xc; required by anova(). predict(type = "response") needs it only without newdata, with store_fitted = FALSE and full rank
FALSE Keeps nothing: lowest memory use, no permutation tests

The legacy values "minimal", "compact" and "full" are accepted as synonyms of TRUE, and "none" of FALSE.


Documentation

The package vignette contains a complete workflow and additional examples.

vignette("fastrda")

Browse all available documentation:

help(package = "fastrda")

or

browseVignettes("fastrda")


Performance

Run time depends strongly on the dimensions of the data, the BLAS library and the number of threads. Speed gains are largest for many response variables. Reported timings should always state the comparison method, BLAS, n, p and the number of threads used.


License

GPL (>= 3)

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("fastrda")

0.3.0 by Zeynel Cebeci, 8 days ago


Browse source code at https://github.com/cran/fastrda


Authors: Zeynel Cebeci [aut, cre] , Engin Yildiztepe [aut]


Documentation:   PDF Manual  


GPL (>= 3) license


Imports Rcpp, parallel, ggplot2

Suggests RhpcBLASctl, ggrepel, RColorBrewer, knitr, rmarkdown, vegan, testthat

Linking to Rcpp, RcppArmadillo

System requirements: OpenMP


See at CRAN