How can I fit the parameters using mle with a self-defined function?
Mostrar comentarios más antiguos
I 'm trying to fit the patameter of normal distribution using mle function I didn't use the built in function but with a self-defined function
Codes are as follows
clear;
clc;
f=@(x,mu,sigma) 1/sigma/sqrt(2*pi)*exp(-(x-mu).^2/2/sigma^2);
x=normrnd(0,1,[1000,1]);
pha=mle(x,'pdf',f,'Start',[0,1])
f is a function of the standard normal distribution I am using the mle function to fit the parameters but an error of "Numbers of input are not correct" happened I think a period of time but fail to find the soluition Can anyone help to solve this problem? Thanks
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Logical en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!