Klasse LinearRegressionTransformer

java.lang.Object
net.simplace.sim.io.FWSimIOAdapter
net.simplace.sim.io.resources.FWSimInputAdapter
net.simplace.sim.io.resources.FWSimResourceTransformer
net.simplace.sim.transformers.LinearRegressionTransformer
Alle implementierten Schnittstellen:
net.simplace.sim.util.FWSimFieldContainer

public class LinearRegressionTransformer extends net.simplace.sim.io.resources.FWSimResourceTransformer
Calculates linear Regression (slope and intercept) from two double arrays WIKI_START == Inputs and outputs == The transformer takes the field/column names from a resource that act as x and y values. It outputs - the keys of the original resource in same order and same datatypes - the slope m (DOUBLE) - intercept b (DOUBLE) - the mean of x values (DOUBLE) - the mean of y values (DOUBLE) - r square (DOUBLE) WIKI_END \[ \begin{eqnarray} \bar{x} Ungültige Eingabe: "&"=Ungültige Eingabe: "&" \frac{1}{n}\sum_{i=1}^n x_i \\ \bar{y} Ungültige Eingabe: "&"=Ungültige Eingabe: "&" \frac{1}{n}\sum_{i=1}^n y_i \\ u Ungültige Eingabe: "&"=Ungültige Eingabe: "&" \frac{1}{n}\sum_{i=1}^n x_i y_i - \bar{x} \bar{y} \\ v Ungültige Eingabe: "&"=Ungültige Eingabe: "&" \frac{1}{n}\sum_{i=1}^n x_i x_i - \bar{x} \bar{x} \\ m Ungültige Eingabe: "&"=Ungültige Eingabe: "&" \frac{u}{v} \\ b Ungültige Eingabe: "&"=Ungültige Eingabe: "&" \bar{y} -m \bar{x} \end{eqnarray} \] WIKI_START WIKI_END
Autor:
Andreas Enders
  • Verschachtelte Klassen - Übersicht

    Von Klasse geerbte verschachtelte Klassen/Schnittstellen net.simplace.sim.io.FWSimIOAdapter

    net.simplace.sim.io.FWSimIOAdapter.FREQUENCE
  • Feldübersicht

    Von Klasse geerbte Felder net.simplace.sim.io.resources.FWSimResourceTransformer

    iFieldMap, iIntColumnMap, iLastInputValuesMap, iLastProjectID, iLastUniqueID, iPoolName, iSourceName

    Von Klasse geerbte Felder net.simplace.sim.io.resources.FWSimInputAdapter

    iJexlScript, iShouldCacheToDB

    Von Klasse geerbte Felder net.simplace.sim.io.FWSimIOAdapter

    iArrayMode, iFieldcount, iFrequence, iHeaderVariables, iInterface, iJexlRule, iKeyMap, iName, iOrderNumber, iProcessTime, iResourceElement, iSession, iSourceKey
  • Konstruktorübersicht

    Konstruktoren
    Konstruktor
    Beschreibung
    LinearRegressionTransformer(net.simplace.sim.FWSimSession aSession, Integer aOrderNumber)
     
    LinearRegressionTransformer(net.simplace.sim.FWSimSession aSession, org.jdom2.Element aResourceElement, Integer aOrderNumber)
     
  • Methodenübersicht

    Modifizierer und Typ
    Methode
    Beschreibung
    net.simplace.sim.io.resources.FWSimResourceCache
    calculateLinearRegression(net.simplace.sim.util.FWSimVariable<String> aXName, net.simplace.sim.util.FWSimVariable<String> aYName, String aProjectID, net.simplace.sim.io.resources.FWSimResourceCache aCache)
    Calculates the linear regression from two vectors X and Y by the least square approach.
    HashMap<String,net.simplace.sim.util.FWSimVariable<?>>
     
    net.simplace.sim.io.resources.FWSimResourceCache
    getData(net.simplace.sim.util.FWSimVarMap aVarMap)
    standard method from outside
    net.simplace.sim.io.resources.FWSimResourceCache
    getData(net.simplace.sim.util.FWSimVarMap aVarMap, net.simplace.sim.io.resources.FWSimResourceCache aResourceCache)
    used by test cases
    protected Object[]
    MergeKeysAndValues(int aKeyFieldCount, Object aKeys, DataTransformHelper.RegressionValues aValues)
     
    void
    updateFields(net.simplace.core.FWObservable aObservable)
     

    Von Klasse geerbte Methoden net.simplace.sim.io.resources.FWSimResourceTransformer

    addVariable, createFormFields, createResourceTransformer, createResourceTransformer, createResourceTransformer, fillVarMap, getCreateFormXML, getEditFormXML, getSourceResourceCache, getVariable, isUpdated, toXML

    Von Klasse geerbte Methoden net.simplace.sim.io.resources.FWSimInputAdapter

    getContentType, getInputVariables, getJexlScript, getOutputVariables, getVarMap, isTransformer, shouldCacheToDB, toHTMLTablestring

    Von Klasse geerbte Methoden net.simplace.sim.io.FWSimIOAdapter

    addProcessTime, checkCondition, createFormFields, finalize, getFieldMap, getFrequence, getHeaderVariables, getHeaderXML, getInterface, getJexlRule, getKeyMap, getName, getOrderNumber, isArrayMode, isConditionCheck, removeVariable, setInterface, setOrderNumber, toString, writeHeaderList

    Von Klasse geerbte Methoden java.lang.Object

    clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Konstruktordetails

    • LinearRegressionTransformer

      public LinearRegressionTransformer(net.simplace.sim.FWSimSession aSession, org.jdom2.Element aResourceElement, Integer aOrderNumber)
      Parameter:
      aSession -
      aResourceElement -
      aOrderNumber -
    • LinearRegressionTransformer

      public LinearRegressionTransformer(net.simplace.sim.FWSimSession aSession, Integer aOrderNumber)
      Parameter:
      aSession -
      aOrderNumber -
  • Methodendetails

    • createVariables

      public HashMap<String,net.simplace.sim.util.FWSimVariable<?>> createVariables()
      Angegeben von:
      createVariables in Schnittstelle net.simplace.sim.util.FWSimFieldContainer
      Setzt außer Kraft:
      createVariables in Klasse net.simplace.sim.io.FWSimIOAdapter
    • getData

      public net.simplace.sim.io.resources.FWSimResourceCache getData(net.simplace.sim.util.FWSimVarMap aVarMap) throws net.simplace.sim.exceptions.MissingSimResourceException
      standard method from outside
      Angegeben von:
      getData in Klasse net.simplace.sim.io.resources.FWSimInputAdapter
      Löst aus:
      net.simplace.sim.exceptions.MissingSimResourceException
      Siehe auch:
      • FWSimInputAdapter.getData(net.simplace.sim.util.FWSimVarMap)
    • getData

      public net.simplace.sim.io.resources.FWSimResourceCache getData(net.simplace.sim.util.FWSimVarMap aVarMap, net.simplace.sim.io.resources.FWSimResourceCache aResourceCache) throws net.simplace.sim.exceptions.MissingSimResourceException
      used by test cases
      Parameter:
      aVarMap - variable map
      aResourceCache - Cached resources (soil data)
      Gibt zurück:
      delivered new data from transformer
      Löst aus:
      net.simplace.sim.exceptions.MissingSimResourceException
    • MergeKeysAndValues

      protected Object[] MergeKeysAndValues(int aKeyFieldCount, Object aKeys, DataTransformHelper.RegressionValues aValues)
    • calculateLinearRegression

      public net.simplace.sim.io.resources.FWSimResourceCache calculateLinearRegression(net.simplace.sim.util.FWSimVariable<String> aXName, net.simplace.sim.util.FWSimVariable<String> aYName, String aProjectID, net.simplace.sim.io.resources.FWSimResourceCache aCache) throws net.simplace.sim.exceptions.MissingSimResourceException
      Calculates the linear regression from two vectors X and Y by the least square approach.
      Parameter:
      aXName -
      aYName -
      aProjectID - id of the project
      aCache - original data
      Gibt zurück:
      the new created FWSimResourceCache
      Löst aus:
      net.simplace.sim.exceptions.MissingSimResourceException
    • updateFields

      public void updateFields(net.simplace.core.FWObservable aObservable)
      Angegeben von:
      updateFields in Klasse net.simplace.sim.io.resources.FWSimResourceTransformer
      Siehe auch:
      • FWSimResourceTransformer.updateFields(net.simplace.core.FWObservable)