tsdist_cor | R Documentation |
Considering r the person correlation coefficient, this function returns either 1 - abs(r) if cor_type=="abs", 1 - pmax(0, r) if cor_type == "+", or 1 - pmax(0, r * -1) if cor_type == "-". Another possibility is to run a significance test to verify if the r is significant.
tsdist_cor(ts1, ts2, cor_type = "abs", sig_test = FALSE, sig_level = 0.01, ...)
ts1 |
Array. Time series 1 |
ts2 |
Array. Time series 2 |
cor_type |
String. "abs" (default), "+", or "-". "abs" considers the correlation absolute value. "+" only positive correlations and "-" only negative correlations. |
sig_test |
Run a statistical test. Return 0 if significant or 1 otherwise. |
sig_level |
The significance level to test if correlation is significant. |
... |
Additional parameters to cor.test() function. |
Real value [0,1] where 0 means perfect positive (or negative if positive_cor==FALSE) correlation and 1 no positive (or negative if positive_cor==FALSE) correlation.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.