SwMatrixCalc | R Documentation |
A wrapper function which calls each of StMatrixCalc(v = t.in)
,
SpMatrixCalc(v = p.in, nPeriods = nPeriods.in)
,
and SxMatrixCalc(A = X.in, XdistMetric = XdistMetric.in)
to generate the three matrices of using the component measures of S_w
. Then
generates the final weighted similarity matrix as the sum of each component matrix multiplied by its corresponding weights
.
The first value in weights
will be multiplied by S_t
, the second S_p
, and the third S_x
.
SwMatrixCalc( t.in, p.in, nPeriods.in, X.in, XdistMetric.in = "euclidean", weights = c(1/3, 1/3, 1/3) )
t.in |
numeric vector of time orders for points in the response series. |
p.in |
numeric vector of period within a seasonal cycle (ex. 1 for January points in monthly data). |
nPeriods.in |
numeric scalar indicating the maximum value |
X.in |
numeric vector or matrix of exogenous predictors, where the rows correspond to points in the response series. |
XdistMetric.in |
character describing the method |
weights |
numeric vector where first value represents weight for |
numeric matrix of similarities which is calculated using S_w
.
Trupiano (2021) arXiv:2112.06266 for information on the formulation of S_w
.
StMatrixCalc()
for information on the calculation of S_t
.
SpMatrixCalc()
for information on the calculation of S_p
.
SxMatrixCalc()
for information on the calculation of S_x
.
t <- c(1, 2, 3) p <- c(1, 2, 1) X <- matrix(c(1, 1, 1, 2, 2, 2, 3, 3, 3), nrow = 3, ncol = 3, byrow = TRUE) SwMatrixCalc( t.in = t, p.in = p, nPeriods.in = 2, X.in = X, weights = c(1 / 4, 1 / 4, 1 / 2) )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.