How to use 'mle' function on multi-dimension vector represented by matrix?

2 views (last 30 days)
Hi everyone,
I want to try run mle to estimate parameters from a pdf function on a multi-column dataset. The number of rows are same.
Different columns represent data in different samples. But I don't know how to input it into ‘mle’ function
paramEsts = mle(x, 'pdf',mypdf, 'start',start, 'lower',lb, 'upper',ub);
x is a 10957x10 double matrix
It gave me feedback as follows
Error mle (line 210)
DATA must be a vector.
It seems that mle does not accept multidimensional vector. I felt that I very likely wrongly defined the data variable. But I don't know how to define it properly to be accepted by Matlab.

Accepted Answer

Walter Roberson
Walter Roberson on 12 Dec 2015
paramEsts = arrayfun(@(IDX) mle(x(:,IDX), 'pdf',mypdf, 'start',start, 'lower',lb, 'upper',ub), 1:size(x,2), 'Uniform', 0)
  1 Comment
Joy Tian
Joy Tian on 12 Dec 2015
Return the error
Error evaluating the user-supplied pdf function '@(x,p,lamda1,lamda2)p*exppdf(x,lamda1)+(1-p)*exppdf(x,lamda2)'.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!