PHP 클래스 MathPHP\Statistics\Distribution

파일 보기 프로젝트 열기: markrogoyski/math-php

공개 메소드들

메소드 설명
cumulativeFrequency ( array $values ) : array Cumulative frequency distribution
cumulativeRelativeFrequency ( array $values ) : array Cumulative relative frequency distribution Cumulative frequency distribution relative to the sample size.
frequency ( array $values ) : array Frequency distribution A table that displays the frequency of various outcomes in a sample.
relativeFrequency ( array $values ) : array Relative frequency distribution Frequency distribution relative to the sample size.
stemAndLeafPlot ( array $values, boolean $print = false ) : array Stem and leaf plot Device for presenting quantitative data in a graphical format, similar to a histogram, to assist in visualizing the shape of a distribution.

메소드 상세

cumulativeFrequency() 공개 정적인 메소드

The values of the input array will be the keys of the result array. The cumulative frequency of the values will be the value of the result array for that key.
public static cumulativeFrequency ( array $values ) : array
$values array Ex: ( A, A, A, A, A, A, B, B, B, C )
리턴 array cumulative frequency distribution Ex: ( A => 6, B => 9, C => 10 )

cumulativeRelativeFrequency() 공개 정적인 메소드

Cumulative relative frequency = cumulative frequency / sample size The values of the input array will be the keys of the result array. The cumulative frequency of the values will be the value of the result array for that key.
public static cumulativeRelativeFrequency ( array $values ) : array
$values array Ex: ( A, A, A, A, A, A, B, B, B, C )
리턴 array cumulative relative frequency distribution Ex: ( A => 0.6, B => 0.9, C => 1 )

frequency() 공개 정적인 메소드

Each entry in the table contains the frequency or count of the occurrences of values within a particular group or interval. The table summarizes the distribution of values in the sample. https://en.wikipedia.org/wiki/Frequency_distribution The values of the input array will be the keys of the result array. The count of the values will be the value of the result array for that key.
public static frequency ( array $values ) : array
$values array Ex: ( A, A, A, B, B, C )
리턴 array frequency distribution Ex: ( A => 3, B => 2, C => 1 )

relativeFrequency() 공개 정적인 메소드

Relative Frequency = Frequency / Sample Size The values of the input array will be the keys of the result array. The relative frequency of the values will be the value of the result array for that key.
public static relativeFrequency ( array $values ) : array
$values array Ex: ( A, A, A, A, A, A, B, B, B, C )
리턴 array relative frequency distribution Ex: ( A => 0.6, B => 0.3, C => 0.1 )

stemAndLeafPlot() 공개 정적인 메소드

https://en.wikipedia.org/wiki/Stem-and-leaf_display Returns an array with the keys as the stems, and the values are arrays containing the leaves. Optional parameter to print the stem and leaf plot. Given input array: [ 44 46 47 49 63 64 66 68 68 72 72 75 76 81 84 88 106 ] Prints: 4 | 4 6 7 9 5 | 6 | 3 4 6 8 8 7 | 2 2 5 6 8 | 1 4 8 9 | 10 | 6
public static stemAndLeafPlot ( array $values, boolean $print = false ) : array
$values array
$print boolean Optional setting to print the distribution
리턴 array keys are the stems, values are the leaves