Thread Subject: fitting Beta CDF

Subject: fitting Beta CDF

From: Pete sherer

Date: 26 Sep, 2007 17:09:26

Message: 1 of 2

Hi,

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;];

Thank you very much for your help.


Subject: fitting Beta CDF

From: Tom Lane

Date: 26 Sep, 2007 17:39:05

Message: 2 of 2

> 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


Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com