Statistics
Distance Metrics
Contains utilities for calculating distance values.
This module defines utility functions for distance metrics that can be used to compare simulated and observational data.
- class deeprootgen.statistics.distance_metrics.DistanceMetricBase(**_)[source]
The distance metric abstract class.
- abstract calculate(observed: ndarray, simulated: ndarray) float | ndarray [source]
Calculate the distance between observed and simulated data.
- Args:
- observed (np.ndarray):
The observed data.
- simulated (np.ndarray):
The simulated data.
- Raises:
- NotImplementedError:
Error raised for the unimplemented abstract method.
- class deeprootgen.statistics.distance_metrics.MeanAbsoluteError(**_)[source]
The mean absolute error distance.
- class deeprootgen.statistics.distance_metrics.MeanAbsolutePercentageError(**_)[source]
The mean absolute percentage error distance.
- class deeprootgen.statistics.distance_metrics.MeanPinballLoss(**_)[source]
The mean pinball loss distance.
- class deeprootgen.statistics.distance_metrics.MeanSquaredError(**_)[source]
The mean squared error distance.
- class deeprootgen.statistics.distance_metrics.MedianAbsoluteError(**_)[source]
The median absolute error distance.
- class deeprootgen.statistics.distance_metrics.RootMeanSquaredError(**_)[source]
The root mean squared error distance.
Summary Statistics
Contains utilities for producing summary statistics.
This module defines utility functions for producing summary statistics that can be used to compare simulated and observational data.
- class deeprootgen.statistics.summary_statistics.AverageDiameter(**_)[source]
The AverageDiameter summary statistic.
- class deeprootgen.statistics.summary_statistics.AverageLength(**_)[source]
The AverageLength summary statistic.
- class deeprootgen.statistics.summary_statistics.AverageSpecificRootLength(root_tissue_density: float, **_)[source]
The AverageSpecificRootLength statistic.
- class deeprootgen.statistics.summary_statistics.AverageVolume(**_)[source]
The AverageVolume summary statistic.
- class deeprootgen.statistics.summary_statistics.AverageWeight(root_tissue_density: float, **_)[source]
The AverageWeight statistic.
- class deeprootgen.statistics.summary_statistics.ConvexHullArea(**_)[source]
The ConvexHullArea statistic.
- class deeprootgen.statistics.summary_statistics.ConvexHullVolume(**_)[source]
The ConvexHullVolume statistic.
- class deeprootgen.statistics.summary_statistics.DepthDistribution(**_)[source]
The DepthDistribution summary statistic.
- calculate(df: DataFrame, bins: int = 10) tuple [source]
Get the cumulative root distribution by soil depth.
- Args:
- df (pd.DataFrame):
The dataframe of root data.
- bins (int, optional):
The number of bins for a histogram. Defaults to 10.
- Returns:
- tuple:
The cumulative root distribution summary statistic.
- get_xy_comparison_data(df: DataFrame, n_elements: int = 10) ndarray [source]
Get summary statistic data for comparing against another summary statistic.
- Args:
- df (pd.DataFrame):
The dataframe of root data.
- n_elements (int, optional):
The number of elements for the comparison. Defaults to 10.
- Returns:
- np.ndarray:
The comparison data.
- visualise(df: DataFrame, bins: int = 10) Figure [source]
Visualise the cumulative root distribution by soil depth.
- Args:
- df (pd.DataFrame):
The dataframe of root data.
- bins (int, optional):
The number of bins for a histogram. Defaults to 10.
- Returns:
- go.Figure:
The visualisation of the cumulative root distribution summary statistic.
- class deeprootgen.statistics.summary_statistics.RadialDistribution(**_)[source]
The RadialDistribution summary statistic.
- calculate(df: DataFrame, bins: int = 10) tuple [source]
Get the cumulative root distribution by horizontal distance.
- Args:
- df (pd.DataFrame):
The dataframe of root data.
- bins (int, optional):
The number of bins for a histogram. Defaults to 10.
- Returns:
- tuple:
The cumulative root distribution summary statistic.
- get_xy_comparison_data(df: DataFrame, n_elements: int = 10) ndarray [source]
Get summary statistic data for comparing against another summary statistic.
- Args:
- df (pd.DataFrame):
The dataframe of root data.
- n_elements (int, optional):
The number of elements for the comparison. Defaults to 10.
- Returns:
- np.ndarray:
The comparison data.
- visualise(df: DataFrame, bins: int = 10) Figure [source]
Visualise the cumulative root distribution by horizontal distance.
- Args:
- df (pd.DataFrame):
The dataframe of root data.
- bins (int, optional):
The number of bins for a histogram. Defaults to 10.
- Returns:
- go.Figure:
The visualisation of the cumulative root distribution summary statistic.
- class deeprootgen.statistics.summary_statistics.SummaryStatisticBase(**_)[source]
The summary statistic abstract class.
- abstract calculate(df: DataFrame) float | ndarray [source]
Calculate the summary statistic.
- Args:
- df (pd.DataFrame):
The root dataframe.
- Raises:
- NotImplementedError:
Error raised for the unimplemented abstract method.
- calculate_statistic_per_layer(df: DataFrame, layer_decrement: int = 10) tuple [source]
Calculate a summary statistic per soil layer.
- Args:
- df (pd.DataFrame):
The root dataframe.
- layer_decrement (int, optional):
The depth to decrement each soil layer. Defaults to 10.
- Returns:
- tuple:
The list of summary statistics and soil layers.
- get_number_of_roots(df: DataFrame) int [source]
Get the number of roots in the root system.
- Args:
- df (pd.DataFrame):
The root dataframe.
- Returns:
- int:
The number of roots.
- get_xy_comparison_data(df: DataFrame, n_elements: int = 10) ndarray [source]
Get summary statistic data for comparing against another summary statistic.
- Args:
- df (pd.DataFrame):
The dataframe of root data.
- n_elements (int, optional):
The number of elements for the comparison. Defaults to 10.
- Returns:
- np.ndarray:
The comparison data.
- visualise(df: DataFrame, layer_decrement: int = 10, **_) Figure [source]
Visualise the summary statistic by soil depth.
- Args:
- df (pd.DataFrame):
The root dataframe.
- layer_decrement (int, optional):
The depth to decrement each soil layer. Defaults to 10.
- Returns:
- go.Figure:
The visualisation of the total root volume.
- class deeprootgen.statistics.summary_statistics.TotalDiameter(**_)[source]
The TotalDiameter summary statistic.
- class deeprootgen.statistics.summary_statistics.TotalLength(**_)[source]
The TotalLength summary statistic.
- class deeprootgen.statistics.summary_statistics.TotalSpecificRootLength(root_tissue_density: float, **_)[source]
- class deeprootgen.statistics.summary_statistics.TotalVolume(**_)[source]
The TotalVolume summary statistic.
- class deeprootgen.statistics.summary_statistics.TotalWeight(root_tissue_density: float, **_)[source]
The TotalWeight statistic.