|
> Are there any function similar to glmfit but for fitting the
> Beta or Gamma CDF.
>
> For example, I have the empirical CDF that I would like to
> fit the Beta or Gamma CDF to.
>
> x = 0:0.1:1.0;
> data = [0.001;0.02;0.15;0.2;0.3;0.45;0.7;0.82;0.9;0.95;0.98;];
Pete, this can be taken different ways.
1. If you just want to fit a nonlinear function of x to data by least
squares:
>> x=x';
>> p=nlinfit(x,data,@(b,x)betacdf(x,b(1),b(2)),[1 1])
p =
2.2548 2.2327
>> plot(x,data,'bo',x,betacdf(x,p(1),p(2)),'r-')
2. If data represents the empirical cumulative distribution of a sample y,
do you have y? Then you could use betafit on y.
3. If data represents a binomial response for different values of a
stimulus x, then you could use glmfit. If data is y./N then you'd need both
y and N. You could use the 'link' argument to specify a beta cdf as the
link function.
-- Tom
|