uvisbox.Modules.FunctionalBoxplot.functional_boxplot_stats ========================================================== .. py:module:: uvisbox.Modules.FunctionalBoxplot.functional_boxplot_stats Module Contents --------------- .. py:function:: functional_boxplot_band_depths(data, method='fbd') Compute band depths for a set of functional curves. :param curves: 2D array of shape (N, D) where N is the number of curves and D is the number of points per curve. :type curves: np.ndarray :param method: Band-depth method: ``"fbd"`` for functional band depth (default) or ``"mfbd"`` for modified functional band depth. :type method: str, optional .. py:function:: functional_boxplot_get_band(data, percentile, method='fbd') Compute the band envelope for a given percentile using functional band depth. :param data: 2D array of shape (N, D) where N is the number of curves and D is the number of points per curve. :type data: np.ndarray :param percentile: Percentile value (0-100) for the band envelope. :type percentile: float :param method: Band-depth method: ``"fbd"`` for functional band depth (default) or ``"mfbd"`` for modified functional band depth. :type method: str, optional :returns: * **bottom_curve** (*np.ndarray*) -- 1D array representing the bottom envelope of the band. * **top_curve** (*np.ndarray*) -- 1D array representing the top envelope of the band. .. rubric:: Examples >>> data = np.random.randn(100, 50) # 100 curves, 50 points each >>> bottom, top = functional_boxplot_get_band(data, 50, method='fbd') # 50th percentile band .. py:function:: functional_boxplot_summary_statistics(data, method='fbd', boxplot_style=None) Compute functional boxplot summary statistics without visualization. This function computes the same statistics as functional_boxplot but returns them as numpy arrays in a dictionary instead of creating a plot. :param data: 2D array of shape (N, D) where N is the number of curves and D is the number of points per curve. :type data: np.ndarray :param method: Band-depth method: ``"fbd"`` for functional band depth (default) or ``"mfbd"`` for modified functional band depth. :type method: str, optional :param boxplot_style: Configuration for the boxplot including percentiles and outlier settings. If None, uses default configuration. :type boxplot_style: BoxplotStyleConfig, optional :returns: **stats** -- Contains ``depths``, ``median``, ``percentile_bands``, ``outliers``, ``sorted_curves``, and ``sorted_indices``. Each percentile band is a ``(bottom_curve, top_curve)`` tuple; both curves have shape ``(D,)``. :rtype: dict :raises ValueError: If data is not 2D or if method is invalid. .. rubric:: Examples >>> import numpy as np >>> from uvisbox.Modules.FunctionalBoxplot.functional_boxplot_stats import functional_boxplot_summary_statistics >>> from uvisbox.Core.CommonInterface import BoxplotStyleConfig >>> >>> # Generate synthetic functional data >>> t = np.linspace(0, 1, 100) >>> data = np.array([np.sin(2*np.pi*t) + 0.2*np.random.randn(100) for _ in range(50)]) >>> >>> # Basic usage with default settings >>> stats = functional_boxplot_summary_statistics(data) >>> print(f"Median curve shape: {stats['median'].shape}") >>> print(f"Number of outliers: {stats['outliers'].shape[0]}") >>> print(f"Available percentile bands: {list(stats['percentile_bands'].keys())}") >>> >>> # Access specific percentile band >>> bottom_25, top_25 = stats['percentile_bands']['25_percentile_band'] >>> print(f"25th percentile band shapes: {bottom_25.shape}, {top_25.shape}") >>> >>> # Custom percentiles >>> style = BoxplotStyleConfig(percentiles=[10, 50, 90], show_outliers=True) >>> stats = functional_boxplot_summary_statistics(data, boxplot_style=style)