../../_images/logo.png

NetworkFitter#

class fracability.Statistics.NetworkFitter(obj=None, use_survival=True, complete_only=False, use_AIC=True)#

Class used to fit a Fracture or Fracture network object

Parameters:
  • obj – fracture/fracture network object

  • use_survival – Boolean flag to use survival (True) or treat the data as if there were no censoring (False). Default is True.

  • complete_only – Boolean flag to use only complete measurements (True) or all the dataset (False). This flag is used only when use_survival is False. Default is False.

  • use_AIC – Boolean flag to use AIC (True) or AICc (False) for model selection. Default is True. The

column name in the dataframe will remain the same (Akaike).

Add bool to:
  • Consider censored lengths as non-censored

  • Do not consider censored lengths at all

best_fit(sort_by='Akaike') Series#

Return the best fit in the fit records dataframe sorted by sort_by :return:

fit(distribution_name: str)#

Fit the data of the entity_df using scipy available distributions :param distribution_name: Name of the distribution to fit :return:

fit_records(sort_by='Akaike') DataFrame#

Return the sorted fit dataframe

fit_result_to_clipboard(sort_by='Akaike')#

Copy to clipboard the df to be easily pasted in an excel file :param sort_by: Column name to sort the values :return:

fit_result_to_csv(path, sort_by='Akaike')#

Save the csv to a specified path :param path: Path of where to save the csv :param sort_by: Column name to sort the values :return:

fit_result_to_excel(path, sort_by='Akaike')#

Save the excel to a specified path :param path: Path of where to save the excel :param sort_by: Column name to sort the values :return:

get_fitted_distribution(distribution_name: str, sort_by='Akaike') NetworkDistribution#

get the fitted NetworkDistribution object :param distribution_name: name of the distribution :param sort_by: Column name to sort the output order :return:

get_fitted_distribution_list(distribution_names: list = None, sort_by='Akaike') list#

Get a list of NetworkDistribution objects for the given distribution name :param distribution_names: :param sort_by: Column name to sort the output order :return:

get_fitted_distribution_names(sort_by='Akaike') list#

get the names of the fitted NetworkDistribution object :param sort_by: Column name to sort the output order :return:

get_fitted_parameters(distribution_name: str, sort_by='Akaike') tuple#

Get the fitted distributions parameters in the fit records df :param distribution_name: Name of the distribution :param sort_by: Column name to sort the output order

get_fitted_parameters_list(distribution_names: list = None, sort_by='Akaike') list#

Get the parameters of the computed fit(s) :return: Pandas DataFrame

property network_data: NetworkData#

Property that returns or sets a NetworkData object :return:

plot_PIT(show_plot: bool = True, position: list = None, sort_by: str = 'Akaike', bw: bool = False, second_axis: bool = True, n_ticks: int = 5)#

Method to plot the uniform comparison plot for the fitted models.

Parameters:
  • show_plot – Bool. If True, show the plot if False do not show. Default is True.

  • position – List. Plot the models at the given position in the ordered fit_records dataframe. If None (default) plot all models.

  • sort_by – String. Column name to sort the fit_records dataframe. Default is Akaike

  • bw – Bool. If true turn the plot color-blind friendly (black lines with different patterns). Max 7 lines (i.e. models). Default is False

  • second_axis – Add the secondary x-axis to the PIT plot

  • n_ticks – Number of ticks for the secondary x-axis

Returns:

plot_summary(show_plot: bool = True, position: list = None, sort_by: str = 'Akaike')#

Method to plot the summary plot for the given fitted model(s). :param show_plot: Bool. If True, show the plot if False do not show. Default is True. :param position: List. Plot the models at the given position in the ordered fit_records dataframe. If None (default) plot all models. :param sort_by: String. Column name to sort the fit_records dataframe. Default is Akaike :return:

tick_plot(show_plot: bool = True, position: list = None, n_ticks: int = 5, sort_by: str = 'Akaike')#

Method used to plot the tick plot of the given fitted model(s) :param show_plot: Bool. If True, show the plot if False do not show. Default is True. :param position: List. Plot the models at the given position in the ordered fit_records dataframe. If None (default) plot all models. :param n_ticks: Number of ticks per bar :param sort_by: String. Column name to sort the fit_records dataframe. Default is Akaike :return: