Skip to contents

This function trains an RSA (representational similarity analysis) model using the specified method and distance calculation.

Usage

# S3 method for rsa_model
train_model(
  obj,
  train_dat,
  indices,
  wts = NULL,
  method = c("lm", "rfit", "pearson", "spearman"),
  distmethod = c("pearson", "spearman"),
  ...
)

Arguments

obj

An object of class rsa_model.

train_dat

The training data.

indices

The indices of the training data.

wts

Optional, the weights for the model training.

method

The method used for model training. One of "lm" (linear regression), "rfit" (robust regression), "pearson" (Pearson correlation), or "spearman" (Spearman correlation). Default is "lm".

distmethod

The method used for distance calculation. One of "pearson" (Pearson correlation) or "spearman" (Spearman correlation). Default is "pearson".

...

Additional arguments passed to the training method.

Value

The trained model.