s_map_mdr: A function for MDR S-map

View source: R/mdr_smap.R

s_map_mdrR Documentation

A function for MDR S-map

Description

s_map_mdr performs MDR S-map introduced in Chang et al. (2021) Ecology Letters.

Usage

s_map_mdr(
  block_mvd,
  dist_w,
  lib = c(1, nrow(block_mvd)),
  pred = lib,
  tp = 1,
  theta = 8,
  weight_method = "sqrt",
  regularized = FALSE,
  lambda = 0,
  alpha = 0,
  glmnet_parallel = FALSE,
  save_smap_coefficients = FALSE,
  random_seed = 1234
)

Arguments

block_mvd

Data.frame contains time series data. The first column should be the target column.

dist_w

Matrix. Multiview disntance matrix. Usually this is the output of compute_mvd().

lib

Numeric vector. Library indices.

pred

Numeric vector. Prediction indices.

tp

Numeric. Forecasting time ahead.

theta

Numeric. Weighing function for S-map.

weight_method

Specify weighing method for dist_w. Default is sqrt, which is the same for Chang et al. (2021).

regularized

Logical If TRUE, regularized S-map will be performed. If FALSE, the normal S-map will be performed. Please use rEDM::s_map function.

lambda

Numeric. Specify the strength of penalty in the regularization.

alpha

Numeric. alpha = 0 is the ridge regression, alpha = 1 is the lasso regression, and ⁠0 < alpha < 1⁠ is an elastic net.

glmnet_parallel

Logical. If TRUE, the computation will be parallel (currently, experimental).

save_smap_coefficients

Logical. If TRUE, S-map coefficients will be saved.

random_seed

Numeric. Random seed.

Details

  • Chang, C.-W., Miki, T., Ushio, M., Ke, P.-J., Lu, H.-P., Shiah, F.-K. & et al. (2021) Reconstructing large interaction networks from empirical time series data. Ecology Letters, 24, 2763– 2774. https://doi.org/10.1111/ele.13897

Value

A list that contains predictions, statistics, and S-map coefficients (if save_smap_coefficients = TRUE)


ong8181/macam documentation built on April 11, 2024, 12:58 p.m.