Statistical analysis¶
To analyse the fit results when the data set is rather large, there exists an interface to OpenTurns. It can generate histograms or find the best distribution to describe a certain fit parameter of the data set.
API Reference¶
-
class
impedancefitter.postprocess.
PostProcess
(fitresult=None, yamlfile=False)[source]¶ This class provides the possibility to statistically analyse the fitted data.
- Parameters
fitresult (dict) – Result of the fit.
yamlfile (bool) – Provide the link to a file from which you want to read the results.
Notes
Provide either fitresult or yamlfile.
-
best_model_bic
(parameter, distributions, showQQ=False)[source]¶ Test, which distribution models your data best based on the Bayesian information criterion.
- Parameters
parameter (string) – Parameter, whose distribution is to be found.
distributions (list) – List with strings describing valid OpenTURNS distributions such as [‘Normal’, ‘Uniform’]
- Returns
float
-
best_model_chisquared
(parameter, distributions, showQQ=False)[source]¶ Test, which distribution models your data best based on the chisquared test.
- Parameters
parameter (string) – Parameter, whose distribution is to be found.
distributions (list) – List with strings describing valid OpenTURNS distributions such as [‘Normal’, ‘Uniform’]
- Returns
-
best_model_kolmogorov
(parameter, distributions, showQQ=False)[source]¶ Test, which distribution models your data best based on the kolmogorov test.
- Parameters
parameter (string) – Parameter, whose distribution is to be found.
distributions (list) – List with strings describing valid OpenTURNS distributions such as [‘Normal’, ‘Uniform’]
- Returns
-
fit_to_histogram_distribution
(parameter, showQQ=False)[source]¶ Generate histogram from results.
- Parameters
parameter (string) – Parameter, whose distribution is to be found.
- Returns
- Return type
-
fit_to_normal_distribution
(parameter, showQQ=False)[source]¶ Fit results for to normal distribution.
- Parameters
parameter (string) – Parameter, whose distribution is to be found.
showQQ (bool, optional) – Decide if you want to check the fit visually
- Returns
- Return type
-
plot_histograms
(savefig=False, show=True)[source]¶ Plot histograms for all determined parameters.
- Parameters
savefig (bool, optional) – Set to True if you want to save the figure histograms.pdf.
show (bool, optional) – Switch on or off if figures is shown.
Notes
Fails if values are too close to each other, i.e. the variance is very small.