API reference for the module.
.. currentmodule:: specparam
Objects that manage data and fit the model to parameterize neural power spectra.
The SpectralModel object is the base object for the model, and can be used to fit individual power spectra.
.. autosummary:: :toctree: generated/ SpectralModel
The SpectralGroupModel object allows for parameterizing groups of power spectra.
.. autosummary:: :toctree: generated/ SpectralGroupModel
The time & event objects allows for parameterizing power spectra organized across time and/or events.
.. autosummary:: :toctree: generated/ SpectralTimeModel SpectralTimeEventModel
Functions to manipulate, examine, and analyze model objects.
.. currentmodule:: specparam.models
.. autosummary:: :toctree: generated/ compare_model_objs combine_model_objs average_group average_reconstructions fit_models_3d
The model object combines multiple sub-objects that define and store different elements of the model definition, data, and results. Here, the main sub-objects are listed.
.. currentmodule:: specparam.algorithms.algorithm
.. autosummary:: :toctree: generated/ Algorithm
.. currentmodule:: specparam.modes.modes
.. autosummary:: :toctree: generated/ Modes
.. currentmodule:: specparam.data.data
.. autosummary:: :toctree: generated/ Data
.. currentmodule:: specparam.results.results
.. autosummary:: :toctree: generated/ Results
Spectral models are defined by the defining fit Modes. This section
The Mode object & related utilt CF43 ies, providing functionality for defining fit modes.
.. currentmodule:: specparam.modes
.. autosummary:: :toctree: generated/ Mode ParamDefinition check_modes
.. currentmodule:: specparam.modes.funcs
.. autosummary:: :toctree: generated/ powerlaw_function lorentzian_function double_expo_function
.. currentmodule:: specparam.modes.funcs
.. autosummary:: :toctree: generated/ gaussian_function skewed_gaussian_function cauchy_function gamma_function triangle_function
The Metric object & related utilties, providing functionality for definining metrics to evaluate model fitting performance.
.. currentmodule:: specparam.metrics
.. autosummary:: :toctree: generated/ Metric check_metrics
.. currentmodule:: specparam.metrics.gof
.. autosummary:: :toctree: generated/ compute_r_squared compute_adj_r_squared
.. currentmodule:: specparam.metrics.error
.. autosummary:: :toctree: generated/ compute_mean_abs_error compute_mean_squared_error compute_root_mean_squared_error compute_median_abs_error
Object Inputs
The following functions take in model objects directly.
.. currentmodule:: specparam.metrics.pointwise
.. autosummary::
:toctree: generated/
compute_pointwise_error
compute_pointwise_error_group
Array Inputs
The following functions operate on arrays of models and data, which may be useful for more custom work-flows.
.. currentmodule:: specparam.metrics.pointwise
.. autosummary::
:toctree: generated/
compute_pointwise_error_arr
Objects to manage model information, and simulation parameters.
Objects to store settings, metadata and results for power spectrum models.
.. currentmodule:: specparam.data
.. autosummary:: :toctree: generated/ :template: data_object.rst SpectrumMetaData ModelModes ModelSettings ModelChecks FitResults
Object to store information about simulated data.
.. autosummary:: :toctree: generated/ :template: data_object.rst SimParams
Functions for accessing the periodic components of model fits.
Object Inputs
The following functions take in model objects directly, which is the typical use case.
.. currentmodule:: specparam.data.periodic
.. autosummary::
:toctree: generated/
get_band_peak
get_band_peak_group
get_band_peak_event
Array Inputs
The following functions operate on arrays of peak parameters, which may be useful for more custom work-flows.
.. currentmodule:: specparam.data.periodic
.. autosummary::
:toctree: generated/
get_band_peak_arr
get_band_peak_group_arr
get_highest_peak
threshold_peaks
sort_peaks
An object for defining frequency band definitions.
.. currentmodule:: specparam
.. autosummary:: :toctree: generated/ Bands
Functionality for working with and converting parameters.
.. currentmodule:: specparam.params.converter
.. autosummary::
:toctree: generated/
AperiodicParamConverter
PeriodicParamConverter
.. currentmodule:: specparam.params.aperiodic
.. autosummary::
:toctree: generated/
compute_knee_frequency
compute_time_constant
.. currentmodule:: specparam.params.periodic
.. autosummary::
:toctree: generated/
compute_peak_height
Code & utilities for simulating power spectra.
Functions for simulating neural power spectra and spectrograms.
.. currentmodule:: specparam.sim
.. autosummary::
:toctree: generated/
sim_power_spectrum
sim_group_power_spectra
sim_spectrogram
Functions and objects for managing parameters for simulated power spectra.
.. currentmodule:: specparam.sim.params
.. autosummary::
:toctree: generated/
Stepper
param_iter
param_sampler
param_jitter
update_sim_ap_params
Functions for transforming power spectra.
.. currentmodule:: specparam.sim.transform
.. autosummary::
:toctree: generated/
translate_spectrum
translate_sim_spectrum
rotate_spectrum
rotate_sim_spectrum
compute_rotation_offset
compute_rotation_frequency
Visualizations.
Plots for visualizing power spectra and spectrograms.
.. currentmodule:: specparam.plts
.. autosummary::
:toctree: generated/
plot_spectra
plot_spectrogram
Plots for plotting power spectra with shaded regions.
.. currentmodule:: specparam.plts.spectra
.. autosummary::
:toctree: generated/
plot_spectra_shading
plot_spectra_yshade
Plots for visualizing periodic parameters and model components.
.. currentmodule:: specparam.plts.periodic
.. autosummary::
:toctree: generated/
plot_peak_fits
plot_peak_params
Plots for visualizing aperiodic parameters and model components.
.. currentmodule:: specparam.plts.aperiodic
.. autosummary::
:toctree: generated/
plot_aperiodic_fits
plot_aperiodic_params
Plots for visualizing model error.
.. currentmodule:: specparam.plts.error
.. autosummary::
:toctree: generated/
plot_spectral_error
Plots for visualizing from model objects. Note that these are the same plotting functions that can be called from the model objects directly.
.. currentmodule:: specparam.plts.model
.. autosummary::
:toctree: generated/
plot_model
.. currentmodule:: specparam.plts.group
.. autosummary::
:toctree: generated/
plot_group_model
.. currentmodule:: specparam.plts.time
.. autosummary::
:toctree: generated/
plot_time_model
.. currentmodule:: specparam.plts.event
.. autosummary::
:toctree: generated/
plot_event_model
Annotated plots that describe the model and fitting process.
.. currentmodule:: specparam.plts.annotate
.. autosummary::
:toctree: generated/
plot_annotated_model
plot_annotated_peak_search
Plot related utilies for styling and managing plots.
.. currentmodule:: specparam.plts.style
.. autosummary::
:toctree: generated/
check_style_options
.. currentmodule:: specparam.plts.utils
.. autosummary::
:toctree: generated/
check_ax
recursive_plot
save_figure
Save & load related functionality.
.. currentmodule:: specparam.io.models
.. autosummary::
:toctree: generated/
save_model
save_group
save_event
load_model
load_group
load_time
load_event
Utilities related to creating reports.
Utilities for creating draft methods sections.
.. currentmodule:: specparam.reports.methods
.. autosummary::
:toctree: generated/
methods_report_info
methods_report_text
Utility functions and objects.
Utilities for working with spectral data.
.. currentmodule:: specparam.utils.spectral
.. autosummary::
:toctree: generated/
trim_spectrum
interpolate_spectrum
interpolate_spectra
subsample_spectra
Utilities that can be applied to arrays.
.. currentmodule:: specparam.utils.array
.. autosummary::
:toctree: generated/
normalize
unlog
compute_arr_desc
Utilities for managing random processes.
.. currentmodule:: specparam.utils.random
.. autosummary::
:toctree: generated/
set_random_seed