15.4 Networks based on Multidimensional RQA

We can use the ManyAnalysts dataset to create a recurrence matrix based on all the observed variables.

data("manyAnalystsESM")
df <- manyAnalystsESM[4:10]
RN <- rn(y1 = df, doEmbed = FALSE, weighted = TRUE, weightedBy = "si", emRad = NA)

15.4.1 Extracting Phases

Let’s extract a phases and plot them.

library(igraph)
# This returns 6 phases which have minimally 1 state
phaseOut <- rn_phases(RN, doPhaseProfilePlot = TRUE, excludeOther = TRUE)

markEpochsBy  <- na.exclude(phaseOut$phase_number)
g <- graph_from_adjacency_matrix(RN,  mode = "directed", weighted = TRUE, diag = FALSE)
E(g)$weight <- abs(E(g)$weight)
V(g)$size <- 1 + (igraph::strength(g, loops = FALSE)/(igraph::vcount(g)-1)) #strength(gr0) 1+
casnet::make_spiral_graph(g = g, type = "Euler",markEpochsBy = markEpochsBy, markTimeBy = FALSE, doPlot = TRUE, epochLabel = "Phase")