using NeuroAnalyzer
using Plots
= load("files/eeg.hdf");
eeg = epoch(eeg, ep_len=10); e10
[ Info: Loaded: EEG (24 × 282991 × 1; 1105.43 s)
Load data:
using NeuroAnalyzer
using Plots
= load("files/eeg.hdf");
eeg = epoch(eeg, ep_len=10); e10
[ Info: Loaded: EEG (24 × 282991 × 1; 1105.43 s)
There are several types of stationarity tests available in NeuroAnalyzer.
To test mean stationarity:
= stationarity(e10, ch="eeg", method=:mean, window=256)
s_m plot(s_m[1, :, 1], xlabel="time-window points", label="channel 1, epoch 1") Plots.
To test variance stationarity:
= stationarity(e10, ch="eeg", method=:var, window=256)
s_v plot(s_v[1, :, 1], xlabel="time-window points", label="channel 1, epoch 1") Plots.
To test phase stationarity using Hilbert transformation:
= stationarity(e10, ch="eeg", method=:hilbert, window=256)
s_p plot(eeg.epoch_time[1:end-1], s_p[1, :, 1], xlabel="epoch time [s]", label="channel 1, epoch 1", legend=:topright) Plots.
To test covariance stationarity based on Euclidean distance between covariance matrix of adjacent time windows:
= stationarity(e10, ch="eeg", method=:cov, window=256)
s_c plot(s_c[:, 15], label="epoch 15", ylabel="distance between covariance matrices", xlabel="time-window segment", legend=:topright) Plots.
To test phase stationarity using Augmented Dickey–Fuller test:
= stationarity(e10, ch="eeg", method=:adf, window=256)
s_adf 12, :, 1] s_adf[
2-element Vector{Float64}:
-3.13
0.0017
The output is ADF = -3.99 and p = 0.0015, meaning that channel 12, epoch 1 signal is stationary.