Can the custom pdf function for MLE be written for a flexible number of parameters that is determined from the vector of start values?
MATLAB: Flexible number of paramters for MLE with custom function
mleStatistics and Machine Learning Toolbox
Related Solutions
doc normcdfdoc normpdf
When you know what you want but not sure the name, try something like
>> lookfor normalrealmin - Smallest positive normalized floating point number.randn - Normally distributed pseudorandom numbers.sprandn - Sparse normally distributed random matrix.surfnorm - Surface normals.isonormals - Isosurface normals.cde - cd elliptic function with normalized complex argument.sne - sn elliptic function with normalized complex argument.addfreqcsmenu - Add a cs menu to switch between linear and normalized frequencyconvertfrequnits - converts between Normalized, Hz, kHz, etchistfit - Histogram with superimposed fitted normal density.jbtest - Jarque-Bera hypothesis test of composite normality.lhsnorm - Generate a latin hypercube sample with a normal distributionlogncdf - Lognormal cumulative distribution function (cdf).lognfit - Parameter estimates and confidence intervals for lognormal data.logninv - Inverse of the lognormal cumulative distribution function (cdf).lognlike - Negative log-likelihood for the lognormal distribution.lognpdf - Lognormal probability density function (pdf).lognrnd - Random arrays from the lognormal distribution.lognstat - Mean and variance for the lognormal distribution.mvncdf - Multivariate normal cumulative distribution function (cdf).mvnpdf - Multivariate normal probability density function (pdf).mvnrnd - Random vectors from the multivariate normal distribution.normcdf - Normal cumulative distribution function (cdf).normfit - Parameter estimates and confidence intervals for normal data.norminv - Inverse of the normal cumulative distribution function (cdf).normlike - Negative log-likelihood for the normal distribution.normpdf - Normal probability density function (pdf).normplot - Displays a normal probability plot.normrnd - Random arrays from the normal distribution.normspec - Plots normal density between specification limits.normstat - Mean and variance for the normal distribution.logn3fit - Fit a 3-param lognormal dist'n using cumulative probabilities.wgtnormfit - Fitting example for a weighted normal distribution.wgtnormfit2 - Fitting example for a weighted normal distribution (log(sigma) parameterization).>>
Judicious search terms help but seeing the list of things related to "normal" lets you find the two functions of interest (plus a lot more depending upon which toolboxes are available, maybe) that might be of use/interest...
This
[p2,c2]=mle(r,'cdf',cdf_norm);
is not a valid syntax for the MLE function (for two reasons, but I'll assume you left out 'start' by accident). The help is perhaps not clear enough about this, but if you do not specify one of the two dozen or so "canned" distributions, then you MUST pass in either the PDF, or the log PDF, or the negative log-likelihood. The above syntax, without the 'pdf' input, is not ever shown in the help (if it is, please let us know where, it's a documentation bug).
It turns out that because you didn't provide 'pdf', or 'logpdf', or 'nloglf', MLE assumes you must want one of the "canned" distributions, and because you didn't specify one, it assumes 'normal'. You 'cdf' input is ignored.
So, you cannot use MLE if you do not have a PDF -- it does not auto-differentiate the CDF. If you absolutely cannot compute the PDF, you might take a look at the Fitting a Univariate Distribution Using Cumulative Probabilities demo that ships with the Statistics Toolbox.
Best Answer