Recurrence Quantification Analysis
The recurrence microstate analysis allows us to estimate values of typical RQA measures, such as determinism and laminarity, with a good precision, and defines some novel quantifiers. We will demonstate in this page how compute these quantifiers using a uniform distribution as input.
julia> using RecurrenceMicrostatesAnalysis, Distributions # Generate our data =D
julia> data = rand(Uniform(0, 1), 3000);
julia> th, s = find_parameters(data, 3)
(0.26548606562152566, 5.7347212477245915)
julia> dist = distribution(data, th, 3);
Recurrence Entropy
To compute the recurrence entropy, it is possible to use the rentropy
function that receives a recurrence motif probability distribution.
julia> entr = rentropy(dist)
5.732045359515687
The rentropy
function has also a keyword argument that can be used to ignore some motifs.
julia> entr = rentropy(dist; ignore_motifs = [1, 512])
5.604854207396007
Note that the kword ignore_motifs
uses as index the notation of Julia, beginning in 1, instead 0. So, the motif 0 is identified by the number 1.
Recurrence Rate
The recurrence rate (RR) can be computed using a similar method to the recurrence entropy.
julia> rr = rrate(dist)
0.46446348217376304
Since the recurrence rate is an estimated measure, it has a small error, how you can check in the following graphic, that displays the relative error between the RR computed by RecurrenceMicrostatesAnalysis.jl
and the standard approach.
Determinism
The determinism (DET) can be computed using a recurrence motifs probability distribution and the recurrence rate. It is important to note that it can be done using two motif constrained shapes: :square
or :diagonal
.
julia> det = determinism(rr, dist)
0.7139987937626995
julia> det = determinism(rr, distribution(data, th, 3; shape = :diagonal))
0.7133328613428629
Similar to RR, the determinism is a quantifier estimated using recurrence microstates analysis, so it has a small error that is demonstrated in the following figure.
(i) is the uniform distribution, (ii) is the Lorenz system, (iii) is the Logistic map, (iv) is the Rössler system, and (v) is the Bernoulli shifted generalized.
We implement an way to do it without the need to compute the recurrence distributions.
julia> det = determinism(data, th)
(0.7145595430345839, 0.4643546951490876)
When we estimate DET directly using this function overload, the library will automatically use a diagonal motif constrained shape.
Laminarity
The laminarity (LAM) can be computed with a method similar to determinism (DET). It is important to note that it can be done using two motif constrained shapes: :square
or :line
.
julia> lam = laminarity(rr, dist)
0.7358116736728864
julia> lam = laminarity(rr, distribution(data, th, 3; shape = :line))
0.7360128906630529
In the same way, laminarity has a small error associated to it estimation. You can check it in the next figure.
(i) is the uniform distribution, (ii) is the Lorenz system, (iii) is the Logistic map, (iv) is the Rössler system, and (v) is the Bernoulli shifted generalized.
We implement an way to do it without the need to compute the recurrence distributions.
julia> lam = laminarity(data, th)
(0.7357347468572963, 0.46400830737279336)