SpMatrixCalc {knnwtsim}R Documentation

Calculate Seasonal Similarity Matrix

Description

Generates and returns an n x n matrix by calculating the seasonal dissimilarity for each possible pair of points in a vector of seasonal periods, then converts dissimilarity matrix to a similarity matrix using 1 / (D_p + 1).

Usage

SpMatrixCalc(v, nPeriods)

Arguments

v

positive numeric vector with the seasonal periods corresponding to each point in the response series.

nPeriods

positive numeric value representing the maximum value v can take on.

Value

numeric matrix of seasonal similarities for the vector v.

See Also

Examples

SpMatrixCalc(c(1, 2, 4), 4)

[Package knnwtsim version 1.0.0 Index]