Comments (5)
I'd love to have these functions available. If I understand correctly, it is possible to work around it by using gburtini\Distributions\Accessories\BetaFunction. I'm doing this to get a graph of the distribution curve to display it visually:
$last = 0; $data = array();
for ($i=0;$i<=1.0;$i+=0.01) {
$b = BetaFunction::incompleteBetaFunction($i, $this->alpha, $this->beta);
$data[] = $b-$last;
$last = $b;
}
from probability-distributions-for-php.
For beta
CDF is definded by integral
https://en.wikipedia.org/wiki/Beta_function#Incomplete_beta_function
Because of different needs we should balance between time and accuracy. I propose the following interface
$beta->cdf($x, ?$params) // optional $params as associative array with info about precision
from probability-distributions-for-php.
@tvogt it looks good. I will test behavior of your solution tomorrow and type there about potential boundaries. I didn't know that this package has incompleteBetaFunction implemented.
from probability-distributions-for-php.
Look into Accessories\BetaFunction - there is quite a bit of code there which I mostly don't understand (I mean I understand the code, but not what it means).
from probability-distributions-for-php.
@tvogt I added the following CDF for Beta Distribution.
/**
* @param $x
* @return float|int
* Definition: https://en.wikipedia.org/wiki/Beta_function#Incomplete_beta_function
* we can calculate integral but better idea is to use fraction representation:
* In our code there is implemented method http://functions.wolfram.com/GammaBetaErf/Beta3/10/
*/
public function cdf($x)
{
return BetaFunction::incompleteBetaFunction($x, $this->alpha, $this->beta);
}
In link
You have a representation of this function that has quite nice convergence. Integrating is more intuitive, but due to numerical reason is not preferred.
from probability-distributions-for-php.
Related Issues (19)
- Abstract simulation testing strategy. HOT 1
- Normal icdf does not use Mean and Variance HOT 1
- PHP7 - All instances of mt_rand() should be changed to random_int(); HOT 3
- please move implementations into declarations and git rid of ugly HOT 5
- Add parameter estimators for statistical distributions HOT 1
- Code organization for new distributions? HOT 3
- Parameters in Gamma distribution HOT 5
- Add versioning to the package HOT 1
- Interface of normal distribution - notice about convention
- Increase code coverage and show coverage HOT 1
- Replace Abstract Class Distribution by Interface HOT 1
- Tag a composer release.
- binomial icdf returns value > 1.0 HOT 2
- PHPUnit version is broken on PHP >=7.3
- Figure out why ugly branch is still diverged. Merge appropriately. HOT 1
- Question: about binomial distribution
- Student's T distribution buggy HOT 3
- Resolve licensing choices. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from probability-distributions-for-php.