Using MLE function to estimate the parameters of a custom distribution

前端 未结 1 1406
温柔的废话
温柔的废话 2020-12-21 18:20

I am trying to use mle() function in MATLAB to estimate the parameters of a 6-parameter custom distribution.

The PDF of the custom di

1条回答
  •  梦毁少年i
    2020-12-21 18:35

    • exp() is a function, not a variable, precise the argument
    exp^(-c*w) ---> exp(-c*w)
    
    • The starting point concerns the 6 parameters, not only one 0.1*ones(1,6)
    • In custcdf mle requires the upper bound of the integral to be a scalar, I did some trial and error and the range is [2~9]. for the trial some values lead to negative cdf or less than 1 discard them.
    • Then use the right one to compute the upper bound see if it's the same as the one you predefined.

    I re-write all the functions, check them out

    The code is as follow

    Censored = ones(5,1);% All data could be trusted 
    
    data        =  rand(5,1); % Since I cannot upload the acutal data, we may use this
    
    f         =  @(w,a,b,c) (w.^(a-1)).*((1-w).^(b-1)).*exp(-c.*w);
    % to estimate the parameters
    custpdf     =  @(t,alpha,theta,beta, a,b,c)...
                    (((integral(@(w)f(w,a,b,c), 0,1)).^-1).*...
                    beta.*...
                    ((igamma(alpha, (theta./t).^beta)).^(a-1)).*...
                    ((theta./t).^(alpha.*beta + 1 )).*...
                    exp(-(((theta./t).^beta)+...
                    c.*igamma(alpha, (theta./t).^beta)./gamma(alpha))))./...
                    (theta.*...
                    ((gamma(alpha)).^(a+b-1)).*...
                     ((gamma(alpha)-...
                     igamma(alpha, (theta./t).^beta)).^(1-b)));
    
    
    custcdf = @(t,alpha,theta,beta, a,b,c)...
             ((integral(@(w)f(w,a,b,c), 0,1)).^-1).*...         
         (integral(@(w)f(w,a,b,c), 0,2));
    
    
    
    phat = mle(data,'pdf',custpdf,'cdf',custcdf,'start', 0.1.*ones(1,6),'Censoring',Censored);
    

    Result

        phat = 0.1017    0.1223    0.1153    0.1493   -0.0377    0.0902
    

    0 讨论(0)
提交回复
热议问题