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

3 次查看(过去 30 天)
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.

采纳的回答

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

请先登录,再进行评论。

更多回答(0 个)

Community Treasure Hunt

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

Start Hunting!

Translated by