G.1 RQA of the Lorenz system

| Jump to assignment |

  • Perform an RQA on the reconstructed state space of the Lorenz system.
    • You’ll need a radius (also called: threshold) in order to decide which points are close together (recurrent).
      • crqa provides a function which will automatically select the best parametersettings: optimizeParam()
      • Best way to ensure you are using the same parameters in each function is to create some lists with parametersettings (check the crqa manual to figure out what these parameters mean):
# General settings for `crqa()`
par0 <- list(rescale = 1,
             normalize = 0,
             mindiagline = 2,
             minvertline = 2,
             tw = 0,
             whiteline = FALSE,
             recpt = FALSE,
             side = "lower",
             checkl = list(do = FALSE, thrshd = 3, datatype = "categorical",pad = TRUE)
             )

# Settings for `optimizeParam()`
par <- list(lgM =  20, steps = seq(1, 6, 1),
           radiusspan = 100, radiussample = 40,
           normalize = par0$normalize, 
           rescale = par0$rescale, 
           mindiagline = par0$mindiagline, minvertline = par0$minvertline,
           tw = par0$tw, 
           whiteline = par0$whiteline, 
           recpt = par0$recpt, 
           fnnpercent = 10, typeami = "mindip")
  • Get the optimal parameters using a radius which will give us 2%-5% recurrent points.
(ans <- optimizeParam(ts1 = lxyz$X, ts2 = lxyz$X, par = par, min.rec = 2, max.rec = 5))
$radius
[1] 17.2439

$emddim
[1] 2

$delay
[1] 18
  • Run the RQA analysis using the same settings with which the parameters were found.
crqaOutput <- crqa(ts1 = lxyz$X, ts2 = lxyz$X,  
                  delay = ans$delay, 
                  embed = ans$emddim, 
                  radius = ans$radius, 
                  normalize = par0$normalize,
                  rescale = par0$rescale, 
                  mindiagline = par0$mindiagline, minvertline = par0$minvertline,
                  tw = par0$tw, 
                  whiteline = par0$whiteline, 
                  recpt = par0$recpt, 
                  side = par0$side, checkl = par0$checkl
                  )
  • The output of crqa is a list with recurrence measures, the last entry is the recurrence plot. It is represented as a so-called sparse-matrix.
    • This representation severely decreases the amount of memory occupied by the recurrence matrix. It is basically a list of indices of cells that contain a \(1\). The \(0\) do not need to be stored.
    • In order to plot this matrix you could use image(), but this does not produce the recurrence plot as they are usually displayed, the y-axis needs to be flipped.
    • We created a function which will take as input the list output of crqa, together with lattice::levelplot the recurrence matrix can be created. If you have loaded (or sourced) the nlRtsa package you can call plotRP.crqa(crqaOutput).
plotRP.crqa(crqaOutput)