s_map_rgl: Perform regularized S-map

View source: R/extended_SSR.R

s_map_rglR Documentation

Perform regularized S-map

Description

s_map_rgl is a wrapper function of extended_lnlp() for regularized S-map. For multivariate S-map, please use extended_lnlp().

Usage

s_map_rgl(
  ts_data,
  E,
  lib = c(1, length(ts_data)),
  pred = lib,
  tp = 1,
  num_neighbors = length(ts_data) + 1,
  theta = 0,
  dist_w = NULL,
  regularized = FALSE,
  lambda = NULL,
  alpha = 0,
  glmnet_parallel = FALSE,
  random_seed = NULL,
  save_smap_coefficients = FALSE
)

Arguments

ts_data

Data.frame, matrix, or vector. One-column univariate time series.

E

Integer. Embedding dimension.

lib

Library indices.

pred

Prediction indices.

tp

Forecasting time ahead.

num_neighbors

Numeric. The number of nearest neighbors.

theta

Numeric. Weighing function for S-map.

dist_w

Matrix. Distance matrix used to calculate weights for S-map. Implemented for MDR S-map (Chang et al. 2021) Ecology Letters. If NULL, then weights are calculated based on Euclidean distance.

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).

random_seed

Numeric. Random seed.

save_smap_coefficients

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

Value

A list containing:

model_output Model predictions
stats Statistics.
smap_coefficients S-map coefficients

Examples

# s_map_rgl()

ong8181/macam documentation built on Oct. 15, 2024, 7:04 a.m.