Can mle use a non-anonymous function for a pdf?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
I am having trouble with mle. Need to use a multi-statement custom pdf. mle works easily with anonymous pdf, but I can't get it to work with a separate script file function. Is this possible? Does anyone have a complete example? I find no answers or examples of this in Matlab's documentation. Thank you.
0 comentarios
Respuestas (1)
David Young
el 30 de Abr. de 2014
Editada: David Young
el 30 de Abr. de 2014
There's no difference between a handle to an anonymous function and a handle to a function in an m-file.
I can think of two possible explanations. One is that your m-file has a script in it, not a function. This is suggested by your use of "script" in your question. The m-file must contain a function, and not a script.
Another possibility is that you aren't generating a function handle properly. If your function is in, say, distribution.m (and is on your path), this is how you'd call mle
phat = mle(data, 'pdf', @distribution, ...)
If neither of those thoughts helps, please edit your question to show the line of code that calls mle and also your m-file for the PDF.
For documention, search for "function handle" in the help window.
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!