A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://blasbenito.github.io/spatialRF/reference/pca_multithreshold.html below:

PCA of a distance matrix over distance thresholds — pca_multithreshold • spatialRF

Computes PCA factors of a distance matrix over different distance thresholds to generate spatial predictors for a model fitted with rf_spatial().

pca_multithreshold(
  distance.matrix = NULL,
  distance.thresholds = NULL,
  max.spatial.predictors = NULL
)
Arguments
distance.matrix

Distance matrix. Default: NULL

distance.thresholds

Numeric vector with distance thresholds defining neighborhood in the distance matrix, Default: 0

max.spatial.predictors

Integer, maximum number of spatial predictors to generate. Only useful when the distance matrix x is very large. Default: NULL

Value

A data frame with the PCA factors of the thresholded matrix. The data frame columns are named "spatial_predictor_DISTANCE_COLUMN", where DISTANCE is the given distance threshold, and COLUMN is the column index of the given predictor.

Details

The distance matrix is converted into weights with weights_from_distance_matrix() before computing the PCA. This produces more meaningful spatial predictors than using the distance matrix as is.

Examples
if(interactive()){

 #loading example distance matrix
 load(distance_matrix)

 #PCA factors of the distance matrix for two reference distances
 x <- pca_multithreshold(
   distance.matrix = distance_matrix,
   distance.thresholds = c(0, 1000)
   )
 head(x)

}

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4