<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169625</link>
    <title>MATLAB Central Newsreader - Fitting CDF of Beta distribution data</title>
    <description>Feed for thread: Fitting CDF of Beta distribution data</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Tue, 20 May 2008 18:07:03 -0400</pubDate>
      <title>Fitting CDF of Beta distribution data</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169625#433180</link>
      <author>Pete sherer</author>
      <description>Right now I am fitting the CDF data using the normal&lt;br&gt;
distribution via the GLMFIT. Are there any way I can do the&lt;br&gt;
same fitting but assuming the BETA distribution.&lt;br&gt;
&lt;br&gt;
The current code I am using to fit Normal CDF data is as&lt;br&gt;
shown below:&lt;br&gt;
x = [0.1294;0.2211;0.3779;0.5559;0.7034;0.8901;1.1263;];&lt;br&gt;
y = [0;0;0.004;0.007;0.029;0.078;0.192;];&lt;br&gt;
&lt;br&gt;
Y    = roundn( [y*100  100*ones(length(y), 1)], 0);&lt;br&gt;
b    = glmfit( x, Y, 'binomial', 'link', 'probit'); &lt;br&gt;
&lt;br&gt;
% Equivalent Normal parameters are (From Tom Lane):&lt;br&gt;
mean   = -b(1)/b(2);&lt;br&gt;
stdDev = 1/b(2);&lt;br&gt;
&lt;br&gt;
Thank you very much for your help,</description>
    </item>
    <item>
      <pubDate>Thu, 22 May 2008 01:15:31 -0400</pubDate>
      <title>Re: Fitting CDF of Beta distribution data</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169625#433437</link>
      <author>Tom Lane</author>
      <description>Pete, with the &quot;probit&quot; link function you are saying the binomial &lt;br&gt;
probabilities follow the form of a normal cdf.  The b(1) and b(2) parameters &lt;br&gt;
adjust the mean and standard deviation of the distribution function.&lt;br&gt;
&lt;br&gt;
That's not the case with a beta distribution.  It's not a location/scale &lt;br&gt;
family.  It would be possible to use a beta distribution function with &lt;br&gt;
parameters that you specify in advance, and then let the b(1) and b(2) &lt;br&gt;
parameters define a location/scale transformation of that.  I'll bet that's &lt;br&gt;
not what you intend, though.  Also, unlike the normal, this distribution has &lt;br&gt;
zero probability outside a finite range; this may or may not cause troubles &lt;br&gt;
for you..&lt;br&gt;
&lt;br&gt;
I can't think of any way to use glmfit and estimate the beta function &lt;br&gt;
parameters.  I have seen work people have done to estimate parameters in a &lt;br&gt;
link function.  If that's what you really want, let me know.  Maybe I can &lt;br&gt;
find a reference.&lt;br&gt;
&lt;br&gt;
-- Tom&lt;br&gt;
&lt;br&gt;
&quot;Pete sherer&quot; &amp;lt;tsh@abg.com&amp;gt; wrote in message &lt;br&gt;
news:g0v407$9e9$1@fred.mathworks.com...&lt;br&gt;
&amp;gt; Right now I am fitting the CDF data using the normal&lt;br&gt;
&amp;gt; distribution via the GLMFIT. Are there any way I can do the&lt;br&gt;
&amp;gt; same fitting but assuming the BETA distribution.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; The current code I am using to fit Normal CDF data is as&lt;br&gt;
&amp;gt; shown below:&lt;br&gt;
&amp;gt; x = [0.1294;0.2211;0.3779;0.5559;0.7034;0.8901;1.1263;];&lt;br&gt;
&amp;gt; y = [0;0;0.004;0.007;0.029;0.078;0.192;];&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Y    = roundn( [y*100  100*ones(length(y), 1)], 0);&lt;br&gt;
&amp;gt; b    = glmfit( x, Y, 'binomial', 'link', 'probit');&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; % Equivalent Normal parameters are (From Tom Lane):&lt;br&gt;
&amp;gt; mean   = -b(1)/b(2);&lt;br&gt;
&amp;gt; stdDev = 1/b(2);&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Thank you very much for your help, </description>
    </item>
    <item>
      <pubDate>Thu, 22 May 2008 02:30:21 -0400</pubDate>
      <title>Re: Fitting CDF of Beta distribution data</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169625#433442</link>
      <author>Pete sherer</author>
      <description>Hi Tom,&lt;br&gt;
&lt;br&gt;
It doesn't have to use the GLMFIT. Any function that can be&lt;br&gt;
used to estimate the parameters of beta distribution would do. &lt;br&gt;
&lt;br&gt;
Thanks a lot.&lt;br&gt;
&lt;br&gt;
Pete </description>
    </item>
    <item>
      <pubDate>Thu, 22 May 2008 15:26:14 -0400</pubDate>
      <title>Re: Fitting CDF of Beta distribution data</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169625#433541</link>
      <author>Tom Lane</author>
      <description>&amp;gt; It doesn't have to use the GLMFIT. Any function that can be&lt;br&gt;
&amp;gt; used to estimate the parameters of beta distribution would do.&lt;br&gt;
&lt;br&gt;
Okay, Pete.  Usually I tell people that they need to be clear about whether &lt;br&gt;
to approach something as a distribution fitting problem or a curve fitting &lt;br&gt;
problem.  Let's just say you have a curve fitting problem, which just &lt;br&gt;
happens to use a curve in the form of a distribution function.&lt;br&gt;
&lt;br&gt;
Your largest x value is bigger than 1.  So the beta distribution on [0,1] is &lt;br&gt;
not appropriate.  Let's say you have a beta distribution with parameters A &lt;br&gt;
and B on the interval [0,C] where there are now three parameters to &lt;br&gt;
estimate.  Here's one way of going about that.  I exponentiated all the &lt;br&gt;
parameters just as a convenient way to force them to be positive.&lt;br&gt;
&lt;br&gt;
I hope this is enough to get you started.&lt;br&gt;
&lt;br&gt;
-- Tom&lt;br&gt;
&lt;br&gt;
x = [0.1294;0.2211;0.3779;0.5559;0.7034;0.8901;1.1263;];&lt;br&gt;
y = [0;0;0.004;0.007;0.029;0.078;0.192;];&lt;br&gt;
&lt;br&gt;
f = @(p,x) betacdf(x/exp(p(1)),exp(p(2)),exp(p(3)));&lt;br&gt;
&lt;br&gt;
p = nlinfit(x,y,f,[2 1 1])&lt;br&gt;
fmt = 'Beta distributionon on [0,%g] with parameters %g and %g \n',...&lt;br&gt;
t = sprintf(fmt, exp(p));&lt;br&gt;
&lt;br&gt;
xx = linspace(0,1.2);&lt;br&gt;
plot(x,y,'bo',xx,f(p,xx),'r-')&lt;br&gt;
title(t) </description>
    </item>
  </channel>
</rss>

