Я пытаюсь использовать функцию mle()
в MATLAB для оценки параметров 6-параметрического пользовательского распределения.
PDF пользовательского дистрибутива:
, а CDF
, где Γ (x, y) и Γ (x) являются верхняя неполная гамма-функция и гамма-функция соответственно. α , θ , β , a , b и c являютсяпараметры нестандартного дистрибутива. K задается как
Учитывая вектор данных 'data
', я хочу оценить параметры α , θ , β , a, b и c.
Итак, пока я придумал этот код:
data = rand(20000,1); % Since I cannot upload the acutal data, we may use this
t = 0:0.0001:0.5;
fun = @(w,a,b,c) w^(a-1)*(1-w)^(b-1)*exp^(-c*w);
% to estimate the parameters
custpdf = @(data,myalpha,mybeta,mytheta,a,b,c)...
((integral(@(t)fun(t,a,b,c),0,1)^-1)*...
mybeta*...
igamma(myalpha,((mytheta/t)^mybeta)^(a-1))*...
(mytheta/t)^(myalpha*mybeta+1)*...
exp(-(mytheta/t)^mybeta-(c*(igamma(myalpha,(mytheta/t)^mybeta)/gamma(myalpha)))))...
/...
(mytheta*...
gamma(myalpha)^(a+b-1)*...
(gamma(myalpha)-igamma(myalpha,(mytheta/t)^mybeta))^(1-b));
custcdf = @(data,myalpha,mybeta,mytheta,a,b,c)...
(integral(@(t)fun(t,a,b,c),0,1)^-1)*...
integral(@(t)fun(t,a,b,c),0,igamma(myalpha,(mytheta/t)^mybeta)^mybeta/gamma(myalpha));
phat = mle(data,'pdf',custpdf,'cdf',custcdf,'start',0.0);
Но я получаю следующую ошибку:
Error using mlecustom (line 166)
Error evaluating the user-supplied pdf function
'@(data,myalpha,mybeta,mytheta,a,b,c)((integral(@(t)fun(t,a,b,c),0,1)^-1)*mybeta*igamma(myalpha,((mytheta/t)^mybeta)^(a-1))*(mytheta/t)^(myalpha*mybeta+1)*exp(-(mytheta/t)^mybeta-(c*(igamma(myalpha,(mytheta/t)^mybeta)/gamma(myalpha)))))/(mytheta*gamma(myalpha)^(a+b-1)*(gamma(myalpha)-igamma(myalpha,(mytheta/t)^mybeta))^(1-b))'.
Error in mle (line 245)
phat = mlecustom(data,varargin{:});
Caused by:
Not enough input arguments.
Я попытался просмотреть строки ошибок, но не могу понять, где на самом деле ошибка.
В какой функции отсутствуетменьше входов?Это относится к fun
?Почему mle
не хватает входных данных при попытке оценить параметры?
Может ли кто-нибудь помочь мне отладить ошибку?
Заранее спасибо.