Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/Fitting.java @ 4357:11cf29eb002c
FacetTypes: New type: exreme_wq_curve_base (for the Stuetz-Q-Poits).
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Fri, 02 Nov 2012 11:58:11 +0100 |
parents | e727e3ebdf85 |
children | a7d080347ac3 |
rev | line source |
---|---|
3011
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.artifacts.model.fixings; |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
2 |
3107
cbf308f5c41b
FixA: Store the standard deviation of delta Ws of reference points into parameters, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3096
diff
changeset
|
3 import de.intevation.flys.artifacts.math.Outlier; |
cbf308f5c41b
FixA: Store the standard deviation of delta Ws of reference points into parameters, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3096
diff
changeset
|
4 |
3011
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
5 import de.intevation.flys.artifacts.math.fitting.Function; |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
6 |
3107
cbf308f5c41b
FixA: Store the standard deviation of delta Ws of reference points into parameters, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3096
diff
changeset
|
7 import gnu.trove.TDoubleArrayList; |
3011
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
8 |
3107
cbf308f5c41b
FixA: Store the standard deviation of delta Ws of reference points into parameters, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3096
diff
changeset
|
9 import java.util.ArrayList; |
cbf308f5c41b
FixA: Store the standard deviation of delta Ws of reference points into parameters, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3096
diff
changeset
|
10 import java.util.List; |
3011
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
11 |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
12 import org.apache.commons.math.MathException; |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
13 |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
14 import org.apache.commons.math.optimization.fitting.CurveFitter; |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
15 |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
16 import org.apache.commons.math.optimization.general.LevenbergMarquardtOptimizer; |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
17 |
3107
cbf308f5c41b
FixA: Store the standard deviation of delta Ws of reference points into parameters, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3096
diff
changeset
|
18 import org.apache.commons.math.stat.descriptive.moment.StandardDeviation; |
3011
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
19 |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
20 import org.apache.log4j.Logger; |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
21 |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
22 public class Fitting |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
23 { |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
24 private static Logger log = Logger.getLogger(Fitting.class); |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
25 |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
26 /** Use instance of this factory to find meta infos for outliers. */ |
3096
d7b0f52d6d04
FixA: Calculate Delta W(t) for reference points, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3073
diff
changeset
|
27 public interface QWDFactory { |
3011
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
28 |
3096
d7b0f52d6d04
FixA: Calculate Delta W(t) for reference points, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3073
diff
changeset
|
29 QWD create(double q, double w); |
3011
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
30 |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
31 } // interface QWFactory |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
32 |
3096
d7b0f52d6d04
FixA: Calculate Delta W(t) for reference points, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3073
diff
changeset
|
33 public static final QWDFactory QWD_FACTORY = new QWDFactory() { |
3022
705d2058b682
FixA: Store the referenced QW for each km, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3011
diff
changeset
|
34 @Override |
3096
d7b0f52d6d04
FixA: Calculate Delta W(t) for reference points, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3073
diff
changeset
|
35 public QWD create(double q, double w) { |
d7b0f52d6d04
FixA: Calculate Delta W(t) for reference points, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3073
diff
changeset
|
36 return new QWD(q, w); |
3022
705d2058b682
FixA: Store the referenced QW for each km, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3011
diff
changeset
|
37 } |
705d2058b682
FixA: Store the referenced QW for each km, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3011
diff
changeset
|
38 }; |
705d2058b682
FixA: Store the referenced QW for each km, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3011
diff
changeset
|
39 |
3729
e727e3ebdf85
Factored out a pure QW model to be more reusable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3565
diff
changeset
|
40 protected boolean checkOutliers; |
e727e3ebdf85
Factored out a pure QW model to be more reusable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3565
diff
changeset
|
41 protected Function function; |
e727e3ebdf85
Factored out a pure QW model to be more reusable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3565
diff
changeset
|
42 protected QWDFactory qwdFactory; |
e727e3ebdf85
Factored out a pure QW model to be more reusable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3565
diff
changeset
|
43 protected double chiSqr; |
e727e3ebdf85
Factored out a pure QW model to be more reusable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3565
diff
changeset
|
44 protected double [] parameters; |
e727e3ebdf85
Factored out a pure QW model to be more reusable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3565
diff
changeset
|
45 protected ArrayList<QWI> removed; |
e727e3ebdf85
Factored out a pure QW model to be more reusable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3565
diff
changeset
|
46 protected QWD [] referenced; |
e727e3ebdf85
Factored out a pure QW model to be more reusable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3565
diff
changeset
|
47 protected double standardDeviation; |
3011
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
48 |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
49 |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
50 public Fitting() { |
3729
e727e3ebdf85
Factored out a pure QW model to be more reusable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3565
diff
changeset
|
51 removed = new ArrayList<QWI>(); |
3011
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
52 } |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
53 |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
54 public Fitting(Function function) { |
3096
d7b0f52d6d04
FixA: Calculate Delta W(t) for reference points, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3073
diff
changeset
|
55 this(function, QWD_FACTORY); |
3011
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
56 } |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
57 |
3096
d7b0f52d6d04
FixA: Calculate Delta W(t) for reference points, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3073
diff
changeset
|
58 public Fitting(Function function, QWDFactory qwdFactory) { |
d7b0f52d6d04
FixA: Calculate Delta W(t) for reference points, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3073
diff
changeset
|
59 this(function, qwdFactory, false); |
3022
705d2058b682
FixA: Store the referenced QW for each km, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3011
diff
changeset
|
60 } |
705d2058b682
FixA: Store the referenced QW for each km, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3011
diff
changeset
|
61 |
705d2058b682
FixA: Store the referenced QW for each km, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3011
diff
changeset
|
62 public Fitting( |
3096
d7b0f52d6d04
FixA: Calculate Delta W(t) for reference points, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3073
diff
changeset
|
63 Function function, |
d7b0f52d6d04
FixA: Calculate Delta W(t) for reference points, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3073
diff
changeset
|
64 QWDFactory qwdFactory, |
d7b0f52d6d04
FixA: Calculate Delta W(t) for reference points, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3073
diff
changeset
|
65 boolean checkOutliers |
3022
705d2058b682
FixA: Store the referenced QW for each km, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3011
diff
changeset
|
66 ) { |
705d2058b682
FixA: Store the referenced QW for each km, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3011
diff
changeset
|
67 this(); |
705d2058b682
FixA: Store the referenced QW for each km, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3011
diff
changeset
|
68 this.function = function; |
3096
d7b0f52d6d04
FixA: Calculate Delta W(t) for reference points, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3073
diff
changeset
|
69 this.qwdFactory = qwdFactory; |
3022
705d2058b682
FixA: Store the referenced QW for each km, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3011
diff
changeset
|
70 this.checkOutliers = checkOutliers; |
3011
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
71 } |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
72 |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
73 public Function getFunction() { |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
74 return function; |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
75 } |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
76 |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
77 public void setFunction(Function function) { |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
78 this.function = function; |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
79 } |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
80 |
3022
705d2058b682
FixA: Store the referenced QW for each km, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3011
diff
changeset
|
81 public boolean getCheckOutliers() { |
705d2058b682
FixA: Store the referenced QW for each km, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3011
diff
changeset
|
82 return checkOutliers; |
705d2058b682
FixA: Store the referenced QW for each km, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3011
diff
changeset
|
83 } |
705d2058b682
FixA: Store the referenced QW for each km, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3011
diff
changeset
|
84 |
705d2058b682
FixA: Store the referenced QW for each km, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3011
diff
changeset
|
85 public void setCheckOutliers(boolean checkOutliers) { |
705d2058b682
FixA: Store the referenced QW for each km, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3011
diff
changeset
|
86 this.checkOutliers = checkOutliers; |
705d2058b682
FixA: Store the referenced QW for each km, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3011
diff
changeset
|
87 } |
705d2058b682
FixA: Store the referenced QW for each km, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3011
diff
changeset
|
88 |
3011
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
89 public double getChiSquare() { |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
90 return chiSqr; |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
91 } |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
92 |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
93 public void reset() { |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
94 chiSqr = 0.0; |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
95 parameters = null; |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
96 removed.clear(); |
3022
705d2058b682
FixA: Store the referenced QW for each km, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3011
diff
changeset
|
97 referenced = null; |
3107
cbf308f5c41b
FixA: Store the standard deviation of delta Ws of reference points into parameters, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3096
diff
changeset
|
98 standardDeviation = 0.0; |
3011
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
99 } |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
100 |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
101 public boolean hasOutliers() { |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
102 return !removed.isEmpty(); |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
103 } |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
104 |
3729
e727e3ebdf85
Factored out a pure QW model to be more reusable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3565
diff
changeset
|
105 public List<QWI> getOutliers() { |
3011
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
106 return removed; |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
107 } |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
108 |
3729
e727e3ebdf85
Factored out a pure QW model to be more reusable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3565
diff
changeset
|
109 public QWI [] outliersToArray() { |
e727e3ebdf85
Factored out a pure QW model to be more reusable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3565
diff
changeset
|
110 return removed.toArray(new QWI[removed.size()]); |
3011
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
111 } |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
112 |
3096
d7b0f52d6d04
FixA: Calculate Delta W(t) for reference points, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3073
diff
changeset
|
113 public QWD [] referencedToArray() { |
d7b0f52d6d04
FixA: Calculate Delta W(t) for reference points, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3073
diff
changeset
|
114 return referenced != null ? (QWD [])referenced.clone() : null; |
3022
705d2058b682
FixA: Store the referenced QW for each km, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3011
diff
changeset
|
115 } |
705d2058b682
FixA: Store the referenced QW for each km, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3011
diff
changeset
|
116 |
3065
ee653971fa84
FixA: Figure out max Q during fitting.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3030
diff
changeset
|
117 public double getMaxQ() { |
ee653971fa84
FixA: Figure out max Q during fitting.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3030
diff
changeset
|
118 double maxQ = -Double.MAX_VALUE; |
ee653971fa84
FixA: Figure out max Q during fitting.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3030
diff
changeset
|
119 if (referenced != null) { |
3729
e727e3ebdf85
Factored out a pure QW model to be more reusable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3565
diff
changeset
|
120 for (QWI qw: referenced) { |
3065
ee653971fa84
FixA: Figure out max Q during fitting.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3030
diff
changeset
|
121 if (qw.getQ() > maxQ) { |
ee653971fa84
FixA: Figure out max Q during fitting.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3030
diff
changeset
|
122 maxQ = qw.getQ(); |
ee653971fa84
FixA: Figure out max Q during fitting.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3030
diff
changeset
|
123 } |
ee653971fa84
FixA: Figure out max Q during fitting.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3030
diff
changeset
|
124 } |
ee653971fa84
FixA: Figure out max Q during fitting.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3030
diff
changeset
|
125 } |
ee653971fa84
FixA: Figure out max Q during fitting.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3030
diff
changeset
|
126 return maxQ; |
ee653971fa84
FixA: Figure out max Q during fitting.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3030
diff
changeset
|
127 } |
ee653971fa84
FixA: Figure out max Q during fitting.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3030
diff
changeset
|
128 |
3011
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
129 public double [] getParameters() { |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
130 return parameters; |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
131 } |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
132 |
3107
cbf308f5c41b
FixA: Store the standard deviation of delta Ws of reference points into parameters, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3096
diff
changeset
|
133 public double getStandardDeviation() { |
cbf308f5c41b
FixA: Store the standard deviation of delta Ws of reference points into parameters, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3096
diff
changeset
|
134 return standardDeviation; |
cbf308f5c41b
FixA: Store the standard deviation of delta Ws of reference points into parameters, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3096
diff
changeset
|
135 } |
cbf308f5c41b
FixA: Store the standard deviation of delta Ws of reference points into parameters, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3096
diff
changeset
|
136 |
3011
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
137 public boolean fit(double [] qs, double [] ws) { |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
138 |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
139 TDoubleArrayList xs = new TDoubleArrayList(qs.length); |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
140 TDoubleArrayList ys = new TDoubleArrayList(ws.length); |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
141 |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
142 for (int i = 0; i < qs.length; ++i) { |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
143 if (!Double.isNaN(qs[i]) && !Double.isNaN(ws[i])) { |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
144 xs.add(qs[i]); |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
145 ys.add(ws[i]); |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
146 } |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
147 else { |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
148 log.warn("remove invalid value " + qs[i] + " " + ws[i]); |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
149 } |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
150 } |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
151 |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
152 if (xs.size() < 2) { |
3073
0ace00c0c12a
FixA: Improved W/Q facet code
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3066
diff
changeset
|
153 log.warn("Too less points."); |
3011
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
154 return false; |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
155 } |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
156 |
3565
b136113dad53
FixA: Only evict only one(!) data point as outlier before recalculating the function.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3203
diff
changeset
|
157 List<Double> inputs = new ArrayList<Double>(xs.size()); |
3011
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
158 |
3096
d7b0f52d6d04
FixA: Calculate Delta W(t) for reference points, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3073
diff
changeset
|
159 de.intevation.flys.artifacts.math.Function instance = null; |
d7b0f52d6d04
FixA: Calculate Delta W(t) for reference points, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3073
diff
changeset
|
160 |
3202
307842cf8d9e
FixA: Make fitting more tolerant.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3127
diff
changeset
|
161 LevenbergMarquardtOptimizer lmo = null; |
307842cf8d9e
FixA: Make fitting more tolerant.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3127
diff
changeset
|
162 |
3011
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
163 for (;;) { |
3202
307842cf8d9e
FixA: Make fitting more tolerant.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3127
diff
changeset
|
164 parameters = null; |
307842cf8d9e
FixA: Make fitting more tolerant.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3127
diff
changeset
|
165 for (double tolerance = 1e-10; tolerance < 1e-3; tolerance *= 10d) { |
3011
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
166 |
3202
307842cf8d9e
FixA: Make fitting more tolerant.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3127
diff
changeset
|
167 lmo = new LevenbergMarquardtOptimizer(); |
307842cf8d9e
FixA: Make fitting more tolerant.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3127
diff
changeset
|
168 lmo.setCostRelativeTolerance(tolerance); |
307842cf8d9e
FixA: Make fitting more tolerant.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3127
diff
changeset
|
169 lmo.setOrthoTolerance(tolerance); |
307842cf8d9e
FixA: Make fitting more tolerant.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3127
diff
changeset
|
170 lmo.setParRelativeTolerance(tolerance); |
307842cf8d9e
FixA: Make fitting more tolerant.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3127
diff
changeset
|
171 |
307842cf8d9e
FixA: Make fitting more tolerant.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3127
diff
changeset
|
172 CurveFitter cf = new CurveFitter(lmo); |
307842cf8d9e
FixA: Make fitting more tolerant.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3127
diff
changeset
|
173 |
307842cf8d9e
FixA: Make fitting more tolerant.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3127
diff
changeset
|
174 for (int i = 0, N = xs.size(); i < N; ++i) { |
307842cf8d9e
FixA: Make fitting more tolerant.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3127
diff
changeset
|
175 cf.addObservedPoint(xs.getQuick(i), ys.getQuick(i)); |
307842cf8d9e
FixA: Make fitting more tolerant.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3127
diff
changeset
|
176 } |
307842cf8d9e
FixA: Make fitting more tolerant.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3127
diff
changeset
|
177 |
307842cf8d9e
FixA: Make fitting more tolerant.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3127
diff
changeset
|
178 try { |
307842cf8d9e
FixA: Make fitting more tolerant.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3127
diff
changeset
|
179 parameters = cf.fit(function, function.getInitialGuess()); |
307842cf8d9e
FixA: Make fitting more tolerant.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3127
diff
changeset
|
180 break; |
307842cf8d9e
FixA: Make fitting more tolerant.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3127
diff
changeset
|
181 } |
307842cf8d9e
FixA: Make fitting more tolerant.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3127
diff
changeset
|
182 catch (MathException me) { |
307842cf8d9e
FixA: Make fitting more tolerant.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3127
diff
changeset
|
183 if (log.isDebugEnabled()) { |
307842cf8d9e
FixA: Make fitting more tolerant.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3127
diff
changeset
|
184 log.debug("tolerance " + tolerance + " + failed."); |
307842cf8d9e
FixA: Make fitting more tolerant.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3127
diff
changeset
|
185 } |
307842cf8d9e
FixA: Make fitting more tolerant.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3127
diff
changeset
|
186 } |
3011
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
187 } |
3202
307842cf8d9e
FixA: Make fitting more tolerant.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3127
diff
changeset
|
188 if (parameters == null) { |
3011
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
189 return false; |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
190 } |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
191 |
3127
71484036b6ae
FixA: Moved function instantiation to always have a valid function instance.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3107
diff
changeset
|
192 // This is the paraterized function for a given km. |
71484036b6ae
FixA: Moved function instantiation to always have a valid function instance.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3107
diff
changeset
|
193 instance = function.instantiate(parameters); |
71484036b6ae
FixA: Moved function instantiation to always have a valid function instance.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3107
diff
changeset
|
194 |
3022
705d2058b682
FixA: Store the referenced QW for each km, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3011
diff
changeset
|
195 if (!checkOutliers) { |
3011
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
196 break; |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
197 } |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
198 |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
199 inputs.clear(); |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
200 |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
201 for (int i = 0, N = xs.size(); i < N; ++i) { |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
202 double y = instance.value(xs.getQuick(i)); |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
203 if (Double.isNaN(y)) { |
3565
b136113dad53
FixA: Only evict only one(!) data point as outlier before recalculating the function.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3203
diff
changeset
|
204 y = Double.MAX_VALUE; |
3011
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
205 } |
3565
b136113dad53
FixA: Only evict only one(!) data point as outlier before recalculating the function.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3203
diff
changeset
|
206 inputs.add(Double.valueOf(ys.getQuick(i) - y)); |
3011
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
207 } |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
208 |
3565
b136113dad53
FixA: Only evict only one(!) data point as outlier before recalculating the function.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3203
diff
changeset
|
209 Integer outlier = Outlier.findOutlier(inputs); |
3011
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
210 |
3565
b136113dad53
FixA: Only evict only one(!) data point as outlier before recalculating the function.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3203
diff
changeset
|
211 if (outlier == null) { |
3011
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
212 break; |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
213 } |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
214 |
3565
b136113dad53
FixA: Only evict only one(!) data point as outlier before recalculating the function.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3203
diff
changeset
|
215 int idx = outlier.intValue(); |
b136113dad53
FixA: Only evict only one(!) data point as outlier before recalculating the function.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3203
diff
changeset
|
216 removed.add( |
b136113dad53
FixA: Only evict only one(!) data point as outlier before recalculating the function.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3203
diff
changeset
|
217 qwdFactory.create( |
b136113dad53
FixA: Only evict only one(!) data point as outlier before recalculating the function.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3203
diff
changeset
|
218 xs.getQuick(idx), ys.getQuick(idx))); |
b136113dad53
FixA: Only evict only one(!) data point as outlier before recalculating the function.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3203
diff
changeset
|
219 xs.remove(idx); |
b136113dad53
FixA: Only evict only one(!) data point as outlier before recalculating the function.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3203
diff
changeset
|
220 ys.remove(idx); |
3011
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
221 } |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
222 |
3107
cbf308f5c41b
FixA: Store the standard deviation of delta Ws of reference points into parameters, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3096
diff
changeset
|
223 StandardDeviation stdDev = new StandardDeviation(); |
cbf308f5c41b
FixA: Store the standard deviation of delta Ws of reference points into parameters, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3096
diff
changeset
|
224 |
3096
d7b0f52d6d04
FixA: Calculate Delta W(t) for reference points, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3073
diff
changeset
|
225 referenced = new QWD[xs.size()]; |
3022
705d2058b682
FixA: Store the referenced QW for each km, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3011
diff
changeset
|
226 for (int i = 0; i < referenced.length; ++i) { |
3096
d7b0f52d6d04
FixA: Calculate Delta W(t) for reference points, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3073
diff
changeset
|
227 QWD qwd = qwdFactory.create(xs.getQuick(i), ys.getQuick(i)); |
3066
4c22194b733a
Some minor bugfixes in fix analysis calculation and some more debug output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3065
diff
changeset
|
228 |
3096
d7b0f52d6d04
FixA: Calculate Delta W(t) for reference points, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3073
diff
changeset
|
229 if (qwd == null) { |
3066
4c22194b733a
Some minor bugfixes in fix analysis calculation and some more debug output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3065
diff
changeset
|
230 log.warn("QW creation failed!"); |
4c22194b733a
Some minor bugfixes in fix analysis calculation and some more debug output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3065
diff
changeset
|
231 } |
4c22194b733a
Some minor bugfixes in fix analysis calculation and some more debug output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3065
diff
changeset
|
232 else { |
3096
d7b0f52d6d04
FixA: Calculate Delta W(t) for reference points, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3073
diff
changeset
|
233 referenced[i] = qwd; |
d7b0f52d6d04
FixA: Calculate Delta W(t) for reference points, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3073
diff
changeset
|
234 double dw = (qwd.getW() - instance.value(qwd.getQ()))*100.0; |
d7b0f52d6d04
FixA: Calculate Delta W(t) for reference points, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3073
diff
changeset
|
235 qwd.setDeltaW(dw); |
3107
cbf308f5c41b
FixA: Store the standard deviation of delta Ws of reference points into parameters, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3096
diff
changeset
|
236 stdDev.increment(dw); |
3066
4c22194b733a
Some minor bugfixes in fix analysis calculation and some more debug output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3065
diff
changeset
|
237 } |
3022
705d2058b682
FixA: Store the referenced QW for each km, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3011
diff
changeset
|
238 } |
705d2058b682
FixA: Store the referenced QW for each km, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3011
diff
changeset
|
239 |
3107
cbf308f5c41b
FixA: Store the standard deviation of delta Ws of reference points into parameters, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3096
diff
changeset
|
240 standardDeviation = stdDev.getResult(); |
cbf308f5c41b
FixA: Store the standard deviation of delta Ws of reference points into parameters, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3096
diff
changeset
|
241 |
3011
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
242 chiSqr = lmo.getChiSquare(); |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
243 |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
244 return true; |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
245 } |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
246 } |
ab81ffd1343e
FixA: Reactivated rewrite of the outlier checks.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
247 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |