Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/fitting/SQRTFunction.java @ 9646:0380717105ba
Implemented alternative fitting strategy for Log-Linear function.
author | Gernot Belger <g.belger@bjoernsen.de> |
---|---|
date | Mon, 02 Dec 2019 17:56:15 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
9645:eb1a29fe823f | 9646:0380717105ba |
---|---|
1 /** Copyright (C) 2017 by Bundesanstalt für Gewässerkunde | |
2 * Software engineering by | |
3 * Björnsen Beratende Ingenieure GmbH | |
4 * Dr. Schumacher Ingenieurbüro für Wasser und Umwelt | |
5 * | |
6 * This file is Free Software under the GNU AGPL (>=v3) | |
7 * and comes with ABSOLUTELY NO WARRANTY! Check out the | |
8 * documentation coming with Dive4Elements River for details. | |
9 */ | |
10 package org.dive4elements.river.artifacts.model.fixings.fitting; | |
11 | |
12 import org.apache.commons.math3.stat.StatUtils; | |
13 | |
14 /** | |
15 * @author Gernot Belger | |
16 */ | |
17 final class SQRTFunction { | |
18 private final ArraySubstraction substraction; | |
19 | |
20 public SQRTFunction(final double[] observations) { | |
21 this.substraction = new ArraySubstraction(observations); | |
22 } | |
23 | |
24 public double calc_sqrt(final double[] values) { | |
25 | |
26 final double[] difference = this.substraction.evaluate(values); | |
27 | |
28 return StatUtils.sumSq(difference); | |
29 } | |
30 } |