EMMA Coverage Report (generated Sun Feb 05 10:43:15 CET 2012)
[all classes][de.uka.ipd.sdq.probfunction.math.apache.impl]

COVERAGE SUMMARY FOR SOURCE FILE [StudentTDistribution.java]

nameclass, %method, %block, %line, %
StudentTDistribution.java0%   (0/1)0%   (0/26)0%   (0/143)0%   (0/36)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class StudentTDistribution0%   (0/1)0%   (0/26)0%   (0/143)0%   (0/36)
<static initializer> 0%   (0/1)0%   (0/8)0%   (0/1)
StudentTDistribution (int): void 0%   (0/1)0%   (0/22)0%   (0/5)
add (IProbabilityDensityFunction): IProbabilityDensityFunction 0%   (0/1)0%   (0/4)0%   (0/1)
checkConstrains (): void 0%   (0/1)0%   (0/4)0%   (0/1)
div (IProbabilityDensityFunction): IProbabilityDensityFunction 0%   (0/1)0%   (0/4)0%   (0/1)
getArithmeticMeanValue (): double 0%   (0/1)0%   (0/8)0%   (0/3)
getCumulativeFunction (): IProbabilityDensityFunction 0%   (0/1)0%   (0/4)0%   (0/1)
getDegreesOfFreedom (): double 0%   (0/1)0%   (0/4)0%   (0/1)
getFourierTransform (): IProbabilityDensityFunction 0%   (0/1)0%   (0/4)0%   (0/1)
getInverseFourierTransform (): IProbabilityDensityFunction 0%   (0/1)0%   (0/4)0%   (0/1)
getLowerDomainBorder (): double 0%   (0/1)0%   (0/4)0%   (0/1)
getMedian (): Object 0%   (0/1)0%   (0/3)0%   (0/1)
getPercentile (int): Object 0%   (0/1)0%   (0/4)0%   (0/1)
getStandardDeviation (): double 0%   (0/1)0%   (0/4)0%   (0/1)
getVariance (): double 0%   (0/1)0%   (0/22)0%   (0/5)
getXinf (): double 0%   (0/1)0%   (0/2)0%   (0/1)
getXsup (): double 0%   (0/1)0%   (0/2)0%   (0/1)
greaterThan (IProbabilityDensityFunction): double 0%   (0/1)0%   (0/4)0%   (0/1)
hasOrderedDomain (): boolean 0%   (0/1)0%   (0/4)0%   (0/1)
lessThan (IProbabilityDensityFunction): double 0%   (0/1)0%   (0/4)0%   (0/1)
mult (IProbabilityDensityFunction): IProbabilityDensityFunction 0%   (0/1)0%   (0/4)0%   (0/1)
probabilisticEquals (IProbabilityDensityFunction): double 0%   (0/1)0%   (0/4)0%   (0/1)
scale (double): IProbabilityDensityFunction 0%   (0/1)0%   (0/4)0%   (0/1)
shiftDomain (double): IProbabilityDensityFunction 0%   (0/1)0%   (0/4)0%   (0/1)
stretchDomain (double): IProbabilityDensityFunction 0%   (0/1)0%   (0/4)0%   (0/1)
sub (IProbabilityDensityFunction): IProbabilityDensityFunction 0%   (0/1)0%   (0/4)0%   (0/1)

1package de.uka.ipd.sdq.probfunction.math.apache.impl;
2 
3import org.apache.commons.math.distribution.TDistributionImpl;
4 
5import de.uka.ipd.sdq.probfunction.math.IProbabilityDensityFunction;
6import de.uka.ipd.sdq.probfunction.math.IStudentTDistribution;
7import de.uka.ipd.sdq.probfunction.math.exception.DomainNotNumbersException;
8import de.uka.ipd.sdq.probfunction.math.exception.FunctionNotInFrequencyDomainException;
9import de.uka.ipd.sdq.probfunction.math.exception.FunctionNotInTimeDomainException;
10import de.uka.ipd.sdq.probfunction.math.exception.FunctionsInDifferenDomainsException;
11import de.uka.ipd.sdq.probfunction.math.exception.IncompatibleUnitsException;
12import de.uka.ipd.sdq.probfunction.math.exception.InvalidSampleValueException;
13import de.uka.ipd.sdq.probfunction.math.exception.NegativeDistanceException;
14import de.uka.ipd.sdq.probfunction.math.exception.ProbabilityFunctionException;
15import de.uka.ipd.sdq.probfunction.math.exception.ProbabilitySumNotOneException;
16import de.uka.ipd.sdq.probfunction.math.exception.UnitNameNotSetException;
17import de.uka.ipd.sdq.probfunction.math.exception.UnitNotSetException;
18import de.uka.ipd.sdq.probfunction.math.exception.UnknownPDFTypeException;
19import de.uka.ipd.sdq.probfunction.math.exception.UnorderedDomainException;
20 
21/**
22 * Student's t-distribution. This distribution has a single parameter called the degrees of freedom.
23 * <p>
24 * The implementation of this class is partly based on the information given in [1].
25 * <p>
26 * [1] http://en.wikipedia.org/w/index.php?title=Student%27s_t-distribution&oldid=462316896
27 * 
28 * @author Philipp Merkle
29 * 
30 */
31public class StudentTDistribution extends AbstractContinousPDF implements IStudentTDistribution {
32 
33    private int degreesOfFreedom;
34 
35    /**
36     * Default constructor.
37     * 
38     * @param degreesOfFreedom
39     *            the parameter of this distribution, which must be a positive integer
40     */
41    public StudentTDistribution(int degreesOfFreedom) {
42        assert (degreesOfFreedom > 0) : "The parameter degrees of freedom must be a positive integer.";
43        this.degreesOfFreedom = degreesOfFreedom;
44        this.internalFunction = new TDistributionImpl(degreesOfFreedom);
45    }
46 
47    @Override
48    public double getDegreesOfFreedom() {
49        return degreesOfFreedom;
50    }
51 
52    @Override
53    public double getVariance() {
54        // this method has been implemented in accordance with [1]
55        if (this.degreesOfFreedom == 2) {
56            return Double.POSITIVE_INFINITY;
57        } else if (this.degreesOfFreedom > 2) {
58            return this.degreesOfFreedom / (this.degreesOfFreedom - 2.0);
59        } else {
60            // undefined value
61            return Double.NaN;
62        }
63    }
64 
65    @Override
66    public double getStandardDeviation() {
67        return Math.sqrt(this.getVariance());
68    }
69 
70    @Override
71    public double getXinf() {
72        return Double.NEGATIVE_INFINITY;
73    }
74 
75    @Override
76    public double getXsup() {
77        return Double.POSITIVE_INFINITY;
78    }
79 
80    @Override
81    public IProbabilityDensityFunction add(IProbabilityDensityFunction pdf) throws FunctionsInDifferenDomainsException,
82            UnknownPDFTypeException, IncompatibleUnitsException {
83        throw new UnsupportedOperationException();
84    }
85 
86    @Override
87    public IProbabilityDensityFunction div(IProbabilityDensityFunction pdf) throws FunctionsInDifferenDomainsException,
88            UnknownPDFTypeException, IncompatibleUnitsException {
89        throw new UnsupportedOperationException();
90    }
91 
92    @Override
93    public IProbabilityDensityFunction getCumulativeFunction() throws FunctionNotInTimeDomainException {
94        throw new UnsupportedOperationException();
95    }
96 
97    @Override
98    public IProbabilityDensityFunction getFourierTransform() throws FunctionNotInTimeDomainException {
99        throw new UnsupportedOperationException();
100    }
101 
102    @Override
103    public IProbabilityDensityFunction getInverseFourierTransform() throws FunctionNotInFrequencyDomainException {
104        throw new UnsupportedOperationException();
105    }
106 
107    @Override
108    public double getLowerDomainBorder() {
109        throw new UnsupportedOperationException();
110    }
111 
112    @Override
113    public double greaterThan(IProbabilityDensityFunction pdf) throws ProbabilityFunctionException {
114        throw new UnsupportedOperationException();
115    }
116 
117    @Override
118    public double lessThan(IProbabilityDensityFunction pdf) throws ProbabilityFunctionException {
119        throw new UnsupportedOperationException();
120    }
121 
122    @Override
123    public IProbabilityDensityFunction mult(IProbabilityDensityFunction pdf)
124            throws FunctionsInDifferenDomainsException, UnknownPDFTypeException, IncompatibleUnitsException {
125        throw new UnsupportedOperationException();
126    }
127 
128    @Override
129    public double probabilisticEquals(IProbabilityDensityFunction pdf) throws ProbabilityFunctionException {
130        throw new UnsupportedOperationException();
131    }
132 
133    @Override
134    public IProbabilityDensityFunction scale(double scalar) {
135        throw new UnsupportedOperationException();
136    }
137 
138    @Override
139    public IProbabilityDensityFunction shiftDomain(double scalar) throws DomainNotNumbersException {
140        throw new UnsupportedOperationException();
141    }
142 
143    @Override
144    public IProbabilityDensityFunction stretchDomain(double scalar) {
145        throw new UnsupportedOperationException();
146    }
147 
148    @Override
149    public IProbabilityDensityFunction sub(IProbabilityDensityFunction pdf) throws FunctionsInDifferenDomainsException,
150            UnknownPDFTypeException, IncompatibleUnitsException {
151        throw new UnsupportedOperationException();
152    }
153 
154    @Override
155    public void checkConstrains() throws NegativeDistanceException, ProbabilitySumNotOneException,
156            FunctionNotInTimeDomainException, UnitNotSetException, UnitNameNotSetException, InvalidSampleValueException {
157        throw new UnsupportedOperationException();
158    }
159 
160    @Override
161    public double getArithmeticMeanValue() throws DomainNotNumbersException, FunctionNotInTimeDomainException {
162        // this method has been implemented in accordance with [1]
163        if (this.degreesOfFreedom > 1) {
164            return 0.0;
165        } else {
166            // undefined value
167            return Double.NaN;
168        }
169    }
170 
171    @Override
172    public Object getMedian() throws UnorderedDomainException {
173        return 0.0;
174    }
175 
176    @Override
177    public Object getPercentile(int p) throws IndexOutOfBoundsException, UnorderedDomainException {
178        throw new UnsupportedOperationException();
179    }
180 
181    @Override
182    public boolean hasOrderedDomain() {
183        throw new UnsupportedOperationException();
184    }
185 
186}

[all classes][de.uka.ipd.sdq.probfunction.math.apache.impl]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov