plot_sop_prefphase¶
- plot_sop_prefphase(b, stats, ModelSpec)¶
PLOT_SOP_PREFPHASE Plot preferred SO phase as a function of continuous SO power
- Usage:
[phi0, sop0, sop_pp_mat] = plot_sop_prefphase(b, stats, ModelSpec)
- Inputs:
b : 1xM double - fitted model parameters from glmfit – required stats : struct - glmfit stats (covb, …) – required ModelSpec : struct - model specification, must contain SOpower:SOphase interaction – required
- Outputs:
phi0 : 500x1 double - phase samples, 500 evenly spaced points in [-pi, pi] sop0 : 510x1 double - SOP samples, 510 evenly spaced points sop_pp_mat : 510x500 double - spindle rate heatmap as a function of (SOP, phase)
Notes
Requires SOpower:SOphase to be in ModelSpec.InteractSelect. The 95 percent confidence band for the preferred phase is estimated by Monte Carlo sampling (M = 5000) from the coefficient covariance. Accompanies Chen et al., PNAS 2025.
See also: plot_stage_prefphase, specify_mdl, ismember_interaction
∿∿∿ Prerau Laboratory MATLAB Codebase · sleepEEG.org ∿∿∿