Tools for fitting measurement traces (butools.fitting)

To load this package, either start the BuToolsInit script, or execute

addpath('butools/fitting') in Matlab,
<<BuTools`Fitting` in Mathematica,
from butools.fitting import * in Python/Numpy.

Overview

In the Fitting package BuTools provides functions both for fitting and for the evaluation of the success of the fitting.

For PH and MAP fitting, currently only EM algorithms are implemented, however, several matching procedures can also be found in the map and ph packages.

To evaluate the fitting results there are functions to compute the distance between continuous functions given by samples (like pdf, cdf, ccdf, etc.), and between discrtete functions (like autocorrelation function, etc.). The efficient calculation of the log-likelihood is also supported.

Functions for fitting

PHFromTrace Performs PH distribution fitting using the EM algorithm
MAPFromTrace Performs MAP fitting using the EM algorithm

Functions for evaluating the results of fitting

SquaredDifference Returns the squared difference between two vectors
RelativeEntropy Returns the relative entropy (aka Kullback–Leibler divergence) of two vectors
EmpiricalSquaredDifference Returns the squared difference of two continuous functions given by samples and the bounds of the corresponding intervalls
EmpiricalRelativeEntropy Returns the relative entropy (aka Kullback–Leibler divergence) of two continuous functions given by samples and the bounds of the corresponding intervalls
LikelihoodFromTrace Evaluates the log-likelihood of a trace with the given PH distribution or MAP