Suppose I have a set of univariate data held in the array errors
.
I would like to fit a PDF to my observed data distribution.
My PDF is defined in a function poissvmwalkpdf
, whose definition line looks like this:
function p = poissvmwalkpdf(theta, mu, kappa, xi)
Here, theta
is the error (the variable for which values in errors
are instances), and mu
, kappa
, and xi
are parameters of the PDF for which I want to find the best fit using maximum-likelihood estimation. This function returns the probability density at a given value of theta
.
Given all this, how would I use fminsearch
to find the values for mu
, kappa
, and xi
that best fit my observed errors
? The fminsearch
documentation doesn't make this clear. None of the examples in the documentation are examples of distribution fitting.
Note: The tutorial here clearly describes what distribution fitting is (as distinguished from curve fitting), but the example given does not use fminsearch
.
fminsearch
and you might get something decent, but it probably won't return the statistically most likely parameters. – horchlerfminsearch
to derive an MLE fit between my PDF and my data?" you seem to be arguing thatfminsearch
cannot do that, but it's a generic minimization function. it can minimize a negative log likelihood. – dbliss