|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.openforecast.Observation
public class Observation
Represents a single observation or data point, consisting of one value of a dependent variable, and one or more values of independent variables. Note that an Observation can refer to a previously observed data value, or a future forecast value (an expected Observation).
Constructor Summary | |
---|---|
Observation(DataPoint dataPoint)
Like a copy constructor, but constructs a new Observation object by making a copy of the values from the given data point. |
|
Observation(double dependentValue)
Initializes the current Observation with the given value of the dependent variable. |
Method Summary | |
---|---|
boolean |
equals(DataPoint dp)
Compares the given DataPoint to the current DataPoint/Observation, and returns true if, and only if, the two data points represent the same data point. |
double |
getDependentValue()
Returns the current value assigned to the dependent variable. |
double |
getIndependentValue(String name)
Returns the current value assigned to the named independent variable. |
String[] |
getIndependentVariableNames()
Returns an array of all independent variable names. |
void |
setDependentValue(double value)
Sets the dependent variables' value to the given value. |
void |
setIndependentValue(String name,
double value)
Sets the named independent variables' value to the given value. |
String |
toString()
Overrides the default toString method to provide a more meaningful output of an Observation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Observation(double dependentValue)
dependentValue
- the initial value of the dependent variable.public Observation(DataPoint dataPoint)
dataPoint
- the data point that is to be copied.Method Detail |
---|
public void setDependentValue(double value)
setDependentValue
in interface DataPoint
value
- the new value for the dependent variable.public double getDependentValue()
getDependentValue
in interface DataPoint
public void setIndependentValue(String name, double value)
setIndependentValue
in interface DataPoint
value
- the new value for the dependent variable.public double getIndependentValue(String name)
getIndependentValue
in interface DataPoint
name
- the name of the independent variable required.
public String[] getIndependentVariableNames()
getIndependentVariableNames
in interface DataPoint
public boolean equals(DataPoint dp)
equals
in interface DataPoint
dp
- the DataPoint to compare this DataPoint/Observation object
to.
public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |