public class Regression extends StatisticObject
Regression
class is producing a linear regression for two
ValueSupplier
objects called x and y.UNDEFINED
Constructor and Description |
---|
Regression(Model ownerModel,
java.lang.String name,
java.lang.String xName,
java.lang.String yName,
boolean showInReport,
boolean showInTrace)
Constructor for a Regression object that is NOT connected to any
ValueSuppliers for the x and y values. |
Regression(Model ownerModel,
java.lang.String name,
java.lang.String xName,
java.lang.String yName,
ValueSupplier xValsup,
ValueSupplier yValsup,
boolean showInReport,
boolean showInTrace)
Constructor for a Regression object that is observing two
ValueSuppliers for the x and y values. |
Regression(Model ownerModel,
java.lang.String name,
ValueSupplier xValsup,
ValueSupplier yValsup,
boolean showInReport,
boolean showInTrace)
Constructor for a Regression object with no names for the x and y values.
|
Modifier and Type | Method and Description |
---|---|
double |
correlationCoeff()
Returns the correlation coefficient.
|
Reporter |
createDefaultReporter()
Returns a Reporter to produce a report about this Regression analysis.
|
double |
getXMean()
Returns the mean x-value.
|
java.lang.String |
getXName()
Returns the name of the x-value.
|
double |
getXValue()
Returns the actual value of the
ValueSupplier supplying
the x-value. |
double |
getYMean()
Returns the mean y-value.
|
java.lang.String |
getYName()
Returns the name of the y-value.
|
double |
getYValue()
Returns the actual value of the
ValueSupplier supplying
the y-value. |
double |
intercept()
Returns the interception of the X-axis.
|
double |
regCoeff()
Returns the regression coefficient.
|
void |
reset()
Resets this Regression object by resetting all variables of x and y to
0.0 .
|
double |
residualStdDev()
Returns the residuale standard deviation.
|
double |
stdDevRegCoeff()
Returns the standard deviation of the regression coefficients.
|
void |
update()
Updates this
Regression object by fetching the actual
values of the ValueSupplier s and processing them. |
void |
update(double xVal,
double yVal)
Updates this
Regression object with the x and y double
values given as parameters. |
void |
update(java.util.Observable o,
java.lang.Object arg)
Implementation of the virtual
update(Observable, Object)
method of the Observer interface. |
boolean |
xIsConstant()
Returns
true when the x-values are constant. |
boolean |
yIsConstant()
Returns
true when the y-values are constant. |
getUnit, getUnitText, round, setUnit
getCorrespondingSchedulable, getDescription, getObservations, getReporter, incrementObservations, incrementObservations, reportIsOn, reportOff, reportOn, resetAt, setCorrespondingSchedulable, setDescription, setReporter
current, currentEntity, currentEntityAll, currentEvent, currentModel, currentSimProcess, debugIsOn, debugOff, debugOn, getModel, isExperimentCompatible, isModelCompatible, presentTime, sendDebugNote, sendMessage, sendTraceNote, sendWarning, skipTraceNote, skipTraceNote, traceIsOn, traceOff, traceOn
getName, getQuotedName, toString
public Regression(Model ownerModel, java.lang.String name, ValueSupplier xValsup, ValueSupplier yValsup, boolean showInReport, boolean showInTrace)
public Regression(Model ownerModel, java.lang.String name, java.lang.String xName, java.lang.String yName, ValueSupplier xValsup, ValueSupplier yValsup, boolean showInReport, boolean showInTrace)
ValueSuppliers
for the x and y values.ownerModel
- Model : The model this Regression object is associated toname
- java.lang.String : The name of this Regression objectxName
- java.lang.String : The name for the x values.yName
- java.lang.String : The name for the y values.xValsup
- ValueSupplier : The ValueSupplier providing the x values for
the regression analysis. The given ValueSupplier will be
observed by this Regression object.yValsup
- ValueSupplier : The ValueSupplier providing the y values for
the regression analysis. The given ValueSupplier will be
observed by this Regression object.showInReport
- boolean : Flag for showing the report about this Regression.showInTrace
- boolean : Flag for showing the trace output of this
Regression.public Regression(Model ownerModel, java.lang.String name, java.lang.String xName, java.lang.String yName, boolean showInReport, boolean showInTrace)
ValueSuppliers
for the x and y values.ownerModel
- Model : The model this Regression object is associated toname
- java.lang.String : The name of this Regression objectxName
- java.lang.String : The name for the x values.yName
- java.lang.String : The name for the y values.showInReport
- boolean : Flag for showing the report about this Regression.showInTrace
- boolean : Flag for showing the trace output of this
Regression.public double correlationCoeff()
public Reporter createDefaultReporter()
public double getXMean()
public java.lang.String getXName()
public double getXValue()
ValueSupplier
supplying
the x-value.ValueSupplier
object supplying the x-value.public double getYMean()
public java.lang.String getYName()
public double getYValue()
ValueSupplier
supplying
the y-value.ValueSupplier
object supplying the y-value.public double intercept()
public double regCoeff()
public void reset()
reset
in class Reportable
public double residualStdDev()
public double stdDevRegCoeff()
public void update()
Regression
object by fetching the actual
values of the ValueSupplier
s and processing them. The
ValueSupplier
s are passed in the constructor of this
Regression
object. This update()
method
complies with the one described in DESMO, see [Page91].public void update(double xVal, double yVal)
Regression
object with the x and y double
values given as parameters. In some cases it might be more convenient to
pass the values this Regression
will be updated with
directly within the update(double xVal, double yVal)
method instead of going via the ValueSupplier
.xVal
- double : The x value with which this Regression
will be updated.yVal
- double : The y value with which this Regression
will be updated.public void update(java.util.Observable o, java.lang.Object arg)
update(Observable, Object)
method of the Observer
interface. This method will be
called automatically from an Observable
object within its
notifyObservers()
method. ValueSupplier
objects providing
the x or y value is updated and calling notifyStatistics()
the x and the y value will be fetched and a new regression will be
calculated.o
- java.util.Observable : The Observable calling this method
within its own notifyObservers()
method.arg
- Object : The Object with which this Regression
is updated.public boolean xIsConstant()
true
when the x-values are constant. That means no
considerable change can be recognized.true
is returned if no considerable
change of the x-values can be recognized. false
otherwise.public boolean yIsConstant()
true
when the y-values are constant. That means no
considerable change can be recognized.true
is returned if no considerable
change of the y-values can be recognized. false
otherwise.