2017 © Pedro Peláez
 

symfony-bundle normal-distribution-bundle

A bundle to calculate normal distribution and other related stuff

image

happyr/normal-distribution-bundle

A bundle to calculate normal distribution and other related stuff

  • Monday, June 18, 2018
  • by Nyholm
  • Repository
  • 1 Watchers
  • 0 Stars
  • 532 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 9 Versions
  • 10 % Grown

The README.md

Happyr Normal Distribution Bundle

Latest Version Software License SensioLabsInsight Total Downloads, (*1)

A bundle to calculate distributions and some statistical important values with those distributions., (*2)

The API

This bundle has three services that helps you with your distribution. Each service and function has comments that describes how to use them and why. This is a brief overview., (*3)

Calculator

Use this service when you want to calculate a normal distribution. This service has two functions normalDistribution and standardDistribution. The later calculates the unit normal distribution where meanValue = 0 and the standardDistribution = 1., (*4)

The input to both functions is an array with values like array(3,6,2,6,4,2,3,6,8, ... );, (*5)

DistributionManager

This service builds a distribution of any type and saves some data in the database. The public functions to this service are addDistribution, getPercentile and createValueFrequencyArray., (*6)

DistributionManager::addDistribution takes an identifier name and an array with the values and frequency as arguments. The array must be on the form ($value => $frequency). See example below., (*7)

<?php

namespace Acme\DemoBundle\Controller;

use Happyr\NormalDistributionBundle\Service\DistributionManager;

class DemoController
{
    public function testController()
    {
        $manager = $this->get(DistributionManager::class);

        $foo = array(8,6,2,6,4,2,3,6,4,8,2,7);
        $bar = $manager->createValueFrequencyArray($foo);
        /*
            $bar should now look like this:
            $bar = (
                2 => 3,
                3 => 1,
                4 => 2,
                6 => 3,
                7 => 1,
                8 => 2
            )
        */
        $summary = $manager->addDistribution('test_id', $bar);

        //get the percentile for a value
        $percentile = $manager->getPercentile('test_id', 3.5);

        $this->get('doctrine.orm.entity_manager')->flush();

        /* ... */
    }
}

StatisticsHelper

The StatisticsHelper is used when you want to get values from a pre-calcuated normal distribution., (*8)

  • getPercentile: Fetch the percentile for a given value
  • getZTransform: Perform a Z-transformation to get a normalized value given your normal distribution.
  • getStanine: Get the stanine value for a given value
  • getStanineForPercentile: Get the stanine value for a given percentile. This is useful when your distribution isn't a standard distribution.

Installation

Install it with Composer!, (*9)

composer require happyr/normal-distribution-bundle

After the dependencies are downloaded, then register the bundle in the AppKernel., (*10)

<?php

// in AppKernel::registerBundles()
$bundles = array(
    // ...
    new Happyr\NormalDistributionBundle\HappyrNormalDistributionBundle(),
    // ...
);

Update the database

The bundle contains two entities. You should update your database with a migration script or (if you are in a pure dev environment) run the following command:, (*11)

php app:console doctrine:schema:update --force

The Versions

18/06 2018

dev-master

9999999-dev

A bundle to calculate normal distribution and other related stuff

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

statistics normal distribution standard deviation bell curve

15/05 2018

0.4.2

0.4.2.0

A bundle to calculate normal distribution and other related stuff

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

statistics normal distribution standard deviation bell curve

29/09 2017

0.4.1

0.4.1.0

A bundle to calculate normal distribution and other related stuff

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

statistics normal distribution standard deviation bell curve

15/09 2017

dev-patch-1

dev-patch-1

A bundle to calculate normal distribution and other related stuff

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

statistics normal distribution standard deviation

15/09 2017

0.4.0

0.4.0.0

A bundle to calculate normal distribution and other related stuff

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

statistics normal distribution standard deviation

16/10 2015

0.3.1

0.3.1.0 http://developer.happyr.com/symfony2-bundles/happyr-normal-distribution-bundle

A bundle to calculate normal distribution and other related stuff

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

statistics normal distribution standard deviation

09/10 2015

0.3.0

0.3.0.0 http://developer.happyr.com/symfony2-bundles/happyr-normal-distribution-bundle

A bundle to calculate normal distribution and other related stuff

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

statistics normal distribution standard deviation

17/05 2015

0.2.0

0.2.0.0 http://developer.happyr.com/symfony2-bundles/happyr-normal-distribution-bundle

A bundle to calculate normal distribution and other related stuff

  Sources   Download

MIT

The Requires

 

statistics normal distribution standard deviation

10/07 2014

0.1.0

0.1.0.0 http://developer.happyr.com/symfony2-bundles/happyr-normal-distribution-bundle

A bundle to calculate normal distribution and other related stuff

  Sources   Download

MIT

The Requires

 

statistics normal distribution standard deviation