Skip to content

Commit 346d163

Browse files
Merge pull request #196 from SergeStinckwich/master
kurtosis, skewness and variance are not defined on Cauchy distribution
2 parents becefbc + 29aec66 commit 346d163

File tree

1 file changed

+27
-8
lines changed

1 file changed

+27
-8
lines changed

src/Math-Numerical/PMCauchyDistribution.class.st

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
"
2+
PMCauchyDistribution is a continuous probability distribution, depending of 2 parameters: mu and beta.
3+
"
14
Class {
25
#name : #PMCauchyDistribution,
36
#superclass : #PMProbabilityDensity,
@@ -65,6 +68,13 @@ PMCauchyDistribution >> initialize: aNumber1 scale: aNumber2 [
6568
beta := aNumber2
6669
]
6770

71+
{ #category : #information }
72+
PMCauchyDistribution >> kurtosis [
73+
"The kurtosis of the receiver is not defined."
74+
75+
self shouldNotImplement
76+
]
77+
6878
{ #category : #information }
6979
PMCauchyDistribution >> parameters [
7080

@@ -73,18 +83,26 @@ PMCauchyDistribution >> parameters [
7383

7484
{ #category : #information }
7585
PMCauchyDistribution >> privateInverseDistributionValue: aNumber [
76-
"Private - Answer the number whose acceptance is aNumber."
77-
^aNumber =0
78-
ifTrue:[Float infinity negated]
79-
ifFalse: [aNumber =1
80-
ifTrue:[Float infinity ]
81-
ifFalse:[( ( aNumber - (1 / 2)) * Float pi) tan * beta + mu]].
86+
"Answer the number whose acceptance is aNumber."
87+
88+
^ aNumber = 0
89+
ifTrue: [ Float infinity negated ]
90+
ifFalse: [ aNumber = 1
91+
ifTrue: [ Float infinity ]
92+
ifFalse: [ ((aNumber - (1 / 2)) * Float pi) tan * beta + mu ] ]
93+
]
94+
95+
{ #category : #information }
96+
PMCauchyDistribution >> skewness [
97+
"The skewness of the receiver is not defined."
98+
self shouldNotImplement
8299
]
83100

84101
{ #category : #information }
85102
PMCauchyDistribution >> standardDeviation [
86103
"The standard deviation of the receiver is not defined."
87-
^nil
104+
105+
self shouldNotImplement
88106
]
89107

90108
{ #category : #information }
@@ -107,5 +125,6 @@ PMCauchyDistribution >> valueAndGradient: aNumber [
107125
{ #category : #information }
108126
PMCauchyDistribution >> variance [
109127
"The variance of the receiver is not defined."
110-
^nil
128+
129+
self shouldNotImplement
111130
]

0 commit comments

Comments
 (0)