Package jsl.observers.variable
Class AntitheticEstimator
- java.lang.Object
-
- jsl.observers.ModelElementObserver
-
- jsl.observers.variable.AntitheticEstimator
-
- All Implemented Interfaces:
ObserverIfc
,GetNameIfc
,IdentityIfc
public class AntitheticEstimator extends ModelElementObserver
The purpose of this class is to observe response variables in order to form pairs across replications and to compute statistics across the pairs. If Y(1), Y(2), .., Y(j), .., Y(n) represent observations from the jth replication, then this class averages adjacent pairs X(1) = (Y(1)+Y(2))/2, X(2) = (Y(3)+Y(4))/2, for m = floor(n/2) pairs X(i) = (Y(2j-1) + Y(2j))/2 for j = 1, 2, 3, ... floor(n/2) If the experiment has been set to control the streams using antithetic streams for odd and even replications, then the resulting estimate from this class will implement the variance reduction technique called antithetic variates. The class is designed as an observer that can be attached to individual response variables
-
-
Field Summary
-
Fields inherited from class jsl.observers.ModelElementObserver
myName
-
-
Constructor Summary
Constructors Constructor Description AntitheticEstimator()
AntitheticEstimator(java.lang.String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
beforeExperiment(ModelElement m, java.lang.Object arg)
protected ExperimentGetIfc
getExperiment()
Returns the experiment for the simulationStatistic
getStatistic()
protected void
replicationEnded(ModelElement m, java.lang.Object arg)
-
Methods inherited from class jsl.observers.ModelElementObserver
afterExperiment, afterReplication, beforeReplication, getId, getModelElement, getName, initialize, montecarlo, removedFromModel, setModelElement, setName, timedUpdate, toString, update, update, warmUp
-
-
-
-
Method Detail
-
getExperiment
protected final ExperimentGetIfc getExperiment()
Returns the experiment for the simulation- Returns:
- the experiment
-
beforeExperiment
protected void beforeExperiment(ModelElement m, java.lang.Object arg)
- Overrides:
beforeExperiment
in classModelElementObserver
-
replicationEnded
protected void replicationEnded(ModelElement m, java.lang.Object arg)
- Overrides:
replicationEnded
in classModelElementObserver
-
getStatistic
public final Statistic getStatistic()
-
-