Which is a curve, similar to PDF function of Beta distribution:
ListLinePlot[x]
And I am trying to fit it to:
PDF[BetaDistribution[\[Alpha], \[Beta]], x
finding Alpha and Beta values.
I will appreciate it somebody can give me a hint how to do this properly using FindFit or any other means. I am too embarrassed to post my modest attempts here, but trust me, I've spent few hours trying before posting :)
> Which is a curve, similar to PDF function of Beta distribution:
> ListLinePlot[x]
> And I am trying to fit it to:
> PDF[BetaDistribution[\[Alpha], \[Beta]], x
> finding Alpha and Beta values.
> I will appreciate it somebody can give me a hint how to do this > properly using FindFit or > any other means. I am too embarrassed to post my modest attempts here, > but trust > me, I've spent few hours trying before posting :)
> Vadim
There are a few ways to go astray, and I imagine I replicated some of them. Here is something that seems to work. Rescale along the x axis so that those values are evenly spaced between zero and one. Now you can either also rescale on the y axis (e.g. divide each value by the total), or else simply make that scaling a part of the fit parametrization. I do the latter below.
One other thing I tried was to augment data by zeros at each end (and have x values starting at zero and ending at one). This did not work, at least not with the code I used. Another thing that failed was to let FindFit find scaling along the x axis. Hence the explicit scaling used above.
> Which is a curve, similar to PDF function of Beta distribution:
> ListLinePlot[x]
> And I am trying to fit it to:
> PDF[BetaDistribution[\[Alpha], \[Beta]], x
> finding Alpha and Beta values.
> I will appreciate it somebody can give me a hint how to do this > properly using FindFit or any other means. I am too embarrassed > to post my modest attempts here, but trust me, I've spent few > hours trying before posting :)
> Vadim
You haven't said what your 'x' represents or how it is supposed to relate to the Beta distribution. If we take the values as the counts in equal-width bins that cover [0,1], then we can get the sample mean and variance using the midpoints of the bins as the x-values, and use the method of moments to estimate 'a' and 'b', the parameters of the distribution.
> Which is a curve, similar to PDF function of Beta distribution:
> ListLinePlot[x]
> And I am trying to fit it to:
> PDF[BetaDistribution[\[Alpha], \[Beta]], x
> finding Alpha and Beta values.
> I will appreciate it somebody can give me a hint how to do this > properly using FindFit or > any other means. I am too embarrassed to post my modest attempts here, > but trust > me, I've spent few hours trying before posting :)
> Vadim
Borrowing from both Ray and Dan, I interpret the data as bin counts and use FindFit:
>> Which is a curve, similar to PDF function of Beta distribution:
>> ListLinePlot[x]
>> And I am trying to fit it to:
>> PDF[BetaDistribution[\[Alpha], \[Beta]], x
>> finding Alpha and Beta values.
>> I will appreciate it somebody can give me a hint how to do this >> properly using FindFit or any other means. I am too embarrassed >> to post my modest attempts here, but trust me, I've spent few >> hours trying before posting :)
>> Vadim
> You haven't said what your 'x' represents or how it is supposed to > relate to the Beta distribution. If we take the values as the counts > in equal-width bins that cover [0,1], then we can get the sample mean > and variance using the midpoints of the bins as the x-values, and use > the method of moments to estimate 'a' and 'b', the parameters of the > distribution.
17 bins? That's a strange number! Were there 3 empty bins at the start? In any case, this will get maximum likelihood estimates of {a,b}. To keep them positive, we estimate their logs.