net.simplace.simulation.control.selectors.WeightedLeastDifferenceSelector

Selects the simulation with the best error/deviation for multiple target variables. The general error is the weighted sum of the errors.

Configuration

User has to specify

Outputs

Description

For a simulation the calculated values of different variables \(i = 1, ... cNumberOfVariables\) are compared to reference (measured) values (e.g. Yield, LAI, Biomass). The selector can handle maximum 20 different variables. Each variable exists pairwise in the simulation as observed\simulated. Observed variables normally come from a resource (datafile), where simulated ones are calculated. (Notice: The selector works also, if both variables come from resources or if both are simulated.)

For each of these variables \(n\) samples are produced by the simulation (\(n\) is determined by the simulated time span and the selectors frequence information).

Let \(\mathcal{E}: \mathbb{R}^n \times \mathbb{R}^n\ \rightarrow \mathbb{R}\) be the selected calculation method - e.g. the bias \(E(o,s)=\sum_{j=1}^n o_j - s_j\)

The weighted difference is then

\[ E = \frac{1}{\omega}\sum_{i=1}^{cNumberOfVariables} cWeight_i \mathcal{E}(cObserved_i,cSimulated_i) \] where \(\omega\) is the sum of weights: \[ \omega = \sum_{i=1}^{cNumberOfVariables} cWeight_i \]

If \(k= 1, ... l\) simulations are performed within a project, then the selector calculates all weighted errors \(E_k\) and selects the simulation with the best error. (The best error depends on the calculation method for RMSE it's the one closest to 0, for agreement index closest to 1 etc.)

The output NuberOfValues counts the number of simulations used for comparison. Normally it's equal to \(l\), but it can be lower because simulations that produce no usable result (i.e. \(E_k\) could not be calculated) are skipped.

Example

|  <selector id="Selector" class="net.simplace.simulation.control.selectors.WeightedLeastDifferenceSelector"
|      frequence="COMPLEX" rule="${observations.HasData}" >
|    <input id="cMode" datatype="CHAR">RRMSE</input>
|    <input id="cNumberOfVariables" datatype="INT">1</input>
|
|    <input id="cObserved1" datatype="DOUBLE" mode="LAST" source="observations.yield"/>
|    <input id="cSimulated1" datatype="DOUBLE" mode="LAST" source="GecrosCrop.WSO"/>
|    <input id="cWeight1" datatype="DOUBLE">0.8</input>
|
|    <input id="cObserved2" datatype="DOUBLE" mode="LAST" source="observations.greenLAI_destructive"/>
|    <input id="cSimulated2" datatype="DOUBLE" mode="LAST" source="GecrosCrop.LAI"/>
|    <input id="cWeight2" datatype="DOUBLE">0.2</input>
|  </selector>

Error methods



See also: LeastDifferenceSelector, net.simplace.util.statistics.Bias, SignedBias, net.simplace.util.statistics.MRE, net.simplace.util.statistics.MAE, net.simplace.util.statistics.RMAE, net.simplace.util.statistics.MSE, net.simplace.util.statistics.RMSE, net.simplace.util.statistics.RRMSE, net.simplace.util.statistics.SMAPE, net.simplace.util.statistics.EF, net.simplace.util.statistics.CorrelationCoefficient, net.simplace.util.statistics.ConcordanceCorrelationCoefficient, net.simplace.util.statistics.AgreementIndex, net.simplace.util.statistics.VoidErrorCalculator




public class WeightedLeastDifferenceSelector extends
net.simplace.simulation.control.FWSimulationSelector {
// Public Constructors
public WeightedLeastDifferenceSelector(Element aSimulationSelectorElement,
FWSimSession aSession);

// Protected Instance Variables
protected int maxnumber;
protected int number;
protected double weightsum;
protected FWSimVariable cNumberOfVariables;
protected ArrayList iObserved;
protected ArrayList iSimulated;
protected ArrayList cWeight;
protected FWSimVariable cMode;
protected FWSimVariable NumberOfValues;
protected FWSimVariable ErrorValue;
protected FWSimVariable ErrorValues;
protected ArrayList IndividualErrorValues;
protected FWSimVariable ErrorMethod;
protected ErrorCalculationMethod[] errorCalculator;

// Public Instance Methods
public HashMap createVariables();

public void init(); // Defines
net.simplace.simulation.control.FWSimulationControlContainer



// Protected Instance Methods
protected void select(ResultSet aResultSet); // Defines
net.simplace.simulation.control.FWSimulationSelector




}



Hierarchy: java.lang.Object - net.simplace.simulation.control.FWSimulationControlContainer (net.simplace.simulation.util.FWSimFieldContainer) - net.simplace.simulation.control.FWSimulationSelector - WeightedLeastDifferenceSelector



Extended by: LeastDifferenceSelector