Package org.hipparchus.fitting
Class WeightedObservedPoints
java.lang.Object
org.hipparchus.fitting.WeightedObservedPoints
- All Implemented Interfaces:
Serializable
Simple container for weighted observed points used
in
curve fitting
algorithms.- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(double x, double y) Adds a point to the sample.void
add
(double weight, double x, double y) Adds a point to the sample.void
add
(WeightedObservedPoint observed) Adds a point to the sample.void
clear()
Removes all observations from this container.toList()
Gets a snapshot of the observed points.
-
Constructor Details
-
WeightedObservedPoints
public WeightedObservedPoints()Simple constructor.- Since:
- 3.0
-
-
Method Details
-
add
public void add(double x, double y) Adds a point to the sample. Calling this method is equivalent to callingadd(1.0, x, y)
.- Parameters:
x
- Abscissa of the point.y
- Observed value atx
. After fitting we should havef(x)
as close as possible to this value.- See Also:
-
add
public void add(double weight, double x, double y) Adds a point to the sample.- Parameters:
weight
- Weight of the observed point.x
- Abscissa of the point.y
- Observed value atx
. After fitting we should havef(x)
as close as possible to this value.- See Also:
-
add
Adds a point to the sample.- Parameters:
observed
- Observed point to add.- See Also:
-
toList
Gets a snapshot of the observed points. The list of stored points is copied in order to ensure that modification of the returned instance does not affect this container. Conversely, further modification of this container (through theadd
orclear
methods) will not affect the returned list.- Returns:
- the observed points, in the order they were added to this container.
- See Also:
-
clear
public void clear()Removes all observations from this container.
-