psiNew.Rd
Computes the sum of distances between consecutive samples in a multivariate time-series. Required to compute the measure of dissimilarity psi
(Birks and Gordon 1985). Distances can be computed through the methods "manhattan", "euclidean", "chi", and "hellinger", and are implemented in the function distance
.
psi( least.cost = NULL, autosum = NULL, parallel.execution = TRUE)
least.cost | character string, name of the column with time/depth/rank data. The data in this column is not modified. |
---|---|
autosum | dataframe with one or several multivariate time-series identified by a grouping column. |
parallel.execution | boolean, if |
A list with named slots, each one with a psi value.
The measure of dissimilarity psi
is computed as: least.cost - (autosum of sequences)) / autosum of sequences
. It has a lower limit at 0, while there is no upper limit.
#loading data data(sequenceA) data(sequenceB) #preparing datasets AB.sequences <- prepareSequences( sequence.A = sequenceA, sequence.A.name = "A", sequence.B = sequenceB, sequence.B.name = "B", merge.mode = "complete", if.empty.cases = "zero", transformation = "hellinger" ) #computing distance matrix AB.distance.matrix <- distanceMatrix( sequences = AB.sequences, grouping.column = "id", method = "manhattan", parallel.execution = FALSE ) #computing least cost matrix AB.least.cost.matrix <- leastCostMatrix( distance.matrix = AB.distance.matrix, diagonal = FALSE, parallel.execution = FALSE ) #extracting least cost AB.least.cost <- leastCost( least.cost.matrix = AB.least.cost.matrix, parallel.execution = FALSE )#> Error in leastCost(least.cost.matrix = AB.least.cost.matrix, parallel.execution = FALSE): unused argument (least.cost.matrix = AB.least.cost.matrix)#autosum AB.autosum <- autoSum( sequences = AB.sequences, grouping.column = "id", parallel.execution = FALSE )#> Error in eval(a, envir = extra, enclos = obj$evalenv): object 'n.iterations' not foundAB.autosum#> Error in eval(expr, envir, enclos): object 'AB.autosum' not found#> Error in inherits(least.cost, "list"): object 'AB.least.cost' not foundAB.psi#> Error in eval(expr, envir, enclos): object 'AB.psi' not found