[jira] Created: (MATH-330) F-distribution: add density-function (through HasDensity<Double>-interface)

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (MATH-330) F-distribution: add density-function (through HasDensity<Double>-interface)

ASF GitHub Bot (Jira)
F-distribution: add density-function (through HasDensity<Double>-interface)
---------------------------------------------------------------------------

                 Key: MATH-330
                 URL: https://issues.apache.org/jira/browse/MATH-330
             Project: Commons Math
          Issue Type: Improvement
            Reporter: Mikkel Meyer Andersen
            Priority: Minor


I've added the density function for the F-distribution.

Tested from R with:
> df(1, 1, 1)
[1] 0.1591549
> df(1, 5, 2)
[1] 0.3080008
> df(1, 100, 1)
[1] 0.2407659
> df(1, 50, 200)
[1] 1.777891

The result with this new density-function:
FDistributionImpl F1 = new FDistributionImpl(1, 1);
FDistributionImpl F2 = new FDistributionImpl(5, 2);
FDistributionImpl F3 = new FDistributionImpl(100, 1);
FDistributionImpl F4 = new FDistributionImpl(50, 200);

F1.density(1.0); // gives 0.1591549430918953
F2.density(1.0); // gives 0.308000821694066
F3.density(1.0); // gives 0.2407658969285279
F4.density(1.0); // gives 1.7778909151036544

Some numeric instability may occur because it's the log density that's calculated, and then the result is the exponential function applied to this result.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (MATH-330) F-distribution: add density-function (through HasDensity<Double>-interface)

ASF GitHub Bot (Jira)

     [ https://issues.apache.org/jira/browse/MATH-330?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mikkel Meyer Andersen updated MATH-330:
---------------------------------------

    Attachment: patchfile

Implementation

> F-distribution: add density-function (through HasDensity<Double>-interface)
> ---------------------------------------------------------------------------
>
>                 Key: MATH-330
>                 URL: https://issues.apache.org/jira/browse/MATH-330
>             Project: Commons Math
>          Issue Type: Improvement
>            Reporter: Mikkel Meyer Andersen
>            Priority: Minor
>         Attachments: patchfile
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> I've added the density function for the F-distribution.
> Tested from R with:
> > df(1, 1, 1)
> [1] 0.1591549
> > df(1, 5, 2)
> [1] 0.3080008
> > df(1, 100, 1)
> [1] 0.2407659
> > df(1, 50, 200)
> [1] 1.777891
> The result with this new density-function:
> FDistributionImpl F1 = new FDistributionImpl(1, 1);
> FDistributionImpl F2 = new FDistributionImpl(5, 2);
> FDistributionImpl F3 = new FDistributionImpl(100, 1);
> FDistributionImpl F4 = new FDistributionImpl(50, 200);
> F1.density(1.0); // gives 0.1591549430918953
> F2.density(1.0); // gives 0.308000821694066
> F3.density(1.0); // gives 0.2407658969285279
> F4.density(1.0); // gives 1.7778909151036544
> Some numeric instability may occur because it's the log density that's calculated, and then the result is the exponential function applied to this result.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Closed: (MATH-330) F-distribution: add density-function (through HasDensity<Double>-interface)

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

     [ https://issues.apache.org/jira/browse/MATH-330?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Phil Steitz closed MATH-330.
----------------------------

    Resolution: Duplicate

Superceded by MATH-332

> F-distribution: add density-function (through HasDensity<Double>-interface)
> ---------------------------------------------------------------------------
>
>                 Key: MATH-330
>                 URL: https://issues.apache.org/jira/browse/MATH-330
>             Project: Commons Math
>          Issue Type: Improvement
>            Reporter: Mikkel Meyer Andersen
>            Priority: Minor
>         Attachments: patchfile
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> I've added the density function for the F-distribution.
> Tested from R with:
> > df(1, 1, 1)
> [1] 0.1591549
> > df(1, 5, 2)
> [1] 0.3080008
> > df(1, 100, 1)
> [1] 0.2407659
> > df(1, 50, 200)
> [1] 1.777891
> The result with this new density-function:
> FDistributionImpl F1 = new FDistributionImpl(1, 1);
> FDistributionImpl F2 = new FDistributionImpl(5, 2);
> FDistributionImpl F3 = new FDistributionImpl(100, 1);
> FDistributionImpl F4 = new FDistributionImpl(50, 200);
> F1.density(1.0); // gives 0.1591549430918953
> F2.density(1.0); // gives 0.308000821694066
> F3.density(1.0); // gives 0.2407658969285279
> F4.density(1.0); // gives 1.7778909151036544
> Some numeric instability may occur because it's the log density that's calculated, and then the result is the exponential function applied to this result.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.