Filter löschen
Filter löschen

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

3 Ansichten (letzte 30 Tage)
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.

Akzeptierte Antwort

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

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by