• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

PolyMathOrg / PolyMath / 4385132063

pending completion
4385132063

push

github

GitHub
Merge pull request #316 from jecisc/divers-cleanings

2977 of 2977 new or added lines in 214 files covered. (100.0%)

19725 of 24212 relevant lines covered (81.47%)

2.44 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

18.42
/src/Math-Distributions/PMChiSquareDistribution.class.st
1
Class {
2
        #name : #PMChiSquareDistribution,
3
        #superclass : #PMGammaDistribution,
4
        #category : #'Math-Distributions-Gamma'
5
}
6

7
{ #category : #creation }
8
PMChiSquareDistribution class >> degreeOfFreedom: anInteger [
3✔
9
        "Create a new instance of the receiver with given degree of freedom."
3✔
10

3✔
11
        ^ anInteger > 40
3✔
12
                ifTrue: [ PMAsymptoticChiSquareDistribution degreeOfFreedom: anInteger ]
3✔
13
                ifFalse: [ super shape: anInteger / 2 scale: 2 ]
3✔
14
]
3✔
15

16
{ #category : #information }
17
PMChiSquareDistribution class >> distributionName [
×
18

×
19
        ^'Chi square distribution'
×
20
]
×
21

22
{ #category : #creation }
23
PMChiSquareDistribution class >> fromHistogram: aHistogram [
×
24
        "Create an instance of the receiver with parameters estimated from the given histogram using best guesses. This method can be used to find the initial values for a fit.        "
×
25
        | dof |
×
26
        aHistogram minimum < 0
×
27
                ifTrue: [ ^nil].
×
28
        dof := aHistogram average rounded.
×
29
        ^dof > 0 ifTrue: [ self degreeOfFreedom: aHistogram average rounded]
×
30
                         ifFalse:[ nil]
×
31
]
×
32

33
{ #category : #creation }
34
PMChiSquareDistribution class >> shape: aNumber1 scale: aNumber2 [
×
35

×
36
        ^self error: 'Illegal creation message for this class'
×
37
]
×
38

39
{ #category : #transformation }
40
PMChiSquareDistribution >> changeParametersBy: aVector [
×
41
        "Modify the parameters of the receiver by aVector."
×
42

×
43
        super changeParametersBy: (Array with: aVector first / 2 with: 0)
×
44
]
×
45

46
{ #category : #information }
47
PMChiSquareDistribution >> confidenceLevel: aNumber [
×
48
        "Answer the probability in percent of finding a chi square value distributed according to the receiver larger than aNumber."
×
49

×
50
        ^ (1 - (self distributionValue: aNumber)) * 100
×
51
]
×
52

53
{ #category : #information }
54
PMChiSquareDistribution >> parameters [
×
55

×
56
        ^ Array with: alpha * 2
×
57
]
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc