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개)

카테고리

Help CenterFile Exchange에서 Probability Distributions에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by