Home > wafo > wavemodels > braylfit.m

braylfit

PURPOSE ^

Parameter estimates for Beta-Rayleigh data.

SYNOPSIS ^

[phat, cov,pci]=braylfit(data1,alpha)

DESCRIPTION ^

 BRAYLFIT Parameter estimates for Beta-Rayleigh data.
 
  CALL: [phat,cov, pci] = braylfit(data,alpha);
 
    phat  = [a, b, c] = maximum likelihood estimates of the
            parameters of the Beta-Rayleigh distribution (see
            braylpdf) given the data.
    cov   = asymptotic covariance matrix of estimates
    pci   = 100*(1-alpha) percent confidense intervals
    data  = data matrix
    alpha = confidence level (default 0.05 corresponding to 95% CI)
 
  Example:
   a = .9; b = 105; sz = [100,1]
   R = sort(wbetarnd(a,b,sz));
   phat = braylfit(R)
   empdistr(R,[R braylpdf(R,p(1),p(2),p(3))])
 
  See also  braylpdf, wbetafit

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

001 function [phat, cov,pci]=braylfit(data1,alpha)
002 %BRAYLFIT Parameter estimates for Beta-Rayleigh data.
003 %
004 % CALL: [phat,cov, pci] = braylfit(data,alpha);
005 %
006 %   phat  = [a, b, c] = maximum likelihood estimates of the
007 %           parameters of the Beta-Rayleigh distribution (see
008 %           braylpdf) given the data.
009 %   cov   = asymptotic covariance matrix of estimates
010 %   pci   = 100*(1-alpha) percent confidense intervals
011 %   data  = data matrix
012 %   alpha = confidence level (default 0.05 corresponding to 95% CI)
013 %
014 % Example:
015 %  a = .9; b = 105; sz = [100,1]
016 %  R = sort(wbetarnd(a,b,sz));
017 %  phat = braylfit(R)
018 %  empdistr(R,[R braylpdf(R,p(1),p(2),p(3))])
019 %
020 % See also  braylpdf, wbetafit
021 
022 % tested on: matlab 5.2
023 %History:
024 
025 % revised pabnov 2004
026 % -replaced fmins with fminsearch  
027 % by Per A. Brodtkorb 14.02.99
028 %   Reference:
029 
030 error(nargchk(1,2,nargin))
031 if (nargin < 2)|isempty(alpha)
032     alpha = 0.05;
033 end
034 p_int = [alpha/2; 1-alpha/2];
035 
036 data1=data1(:)
037 
038 c=sqrt(2)*max(data1);
039 pinit=[wbetafit((data1./c).^2) c]
040 
041 %simultanous MLE
042 mvrs=version;ix=find(mvrs=='.');
043 if str2num(mvrs(1:ix(2)-1))>5.2,
044   phat = fminsearch('loglike',pinit,[],data1,'braylpdf');
045 else
046   phat = fmins('loglike',pinit,[],[],data1,'braylpdf');
047 end
048 
049 % Old call
050 %phat = fmins('brayllike',pinit,[],[],data1);
051 
052 
053 if nargout >1 
054    [L, cov] = loglike(phat,data1,'braylpdf')
055    %[logL,cov]=brayllike(phat,data1); % old call
056    sigma = diag(cov).';
057    pci = wnorminv(repmat(p_int,1,2),[phat; phat],[sigma;sigma]);
058  end
059  
060 
061

Mathematical Statistics
Centre for Mathematical Sciences
Lund University with Lund Institute of Technology

Comments or corrections to the WAFO group


Generated on Thu 06-Oct-2005 02:21:16 for WAFO by m2html © 2003