plot_pdf - cchandre/HamLorenz GitHub Wiki

plot_pdf (function)

Purpose

Plots the probability density function (PDF) of the system state X and its transformed version Y = φ(X), comparing them with a Gaussian fit.

Parameters

  • sol: A OdeSolution solution object (such as returned by solve_ivp or solve_ivp_symp) containing the time evolution of the system.

Description

This function performs the following steps:

  1. Flattens and standardizes the state X(t) and its transformed counterpart Y(t) = φ(X) using z-scores.
  2. Estimates their PDFs using Gaussian kernel density estimation (KDE).
  3. Computes a Gaussian fit (mean and standard deviation) for X(t).
  4. Plots the PDFs of X, Y, and the Gaussian fit on a logarithmic y-axis for better visibility of tails.

Plot Details

  • KDE estimates for X and Y.
  • Dashed red line for the Gaussian fit of X.
  • Log-scaled y-axis ranging from 1e-4 to 1.

Notes

  • Useful for checking non-Gaussian features or symmetry properties of the system's state distribution.