Description
This transformation can be used to calculate an output by using a multiple linear regression equation.
Y = constant + factor1 * value1 + factor2 * value2 + factor3 * value3;
the constant value and the factor will be provided by location attributes.
The input time series will also be defined by using location attributes.
An example is given below.
id,constant,variableId,factor,inputLocationId H4300,1,input1,2,H-2001 H4300,0,input2,3,H-2002
In the example above several attributes are defined for output location H4300.
The attributes constant, variable, factor and inputlocationId are all defined as multi-value location attributes.
This means that these attibutes can have 1 or more values. Note that multi-value location attributes should always be defined in seperate attribute file.
The attribute variable defines a avariable id in the tranformation module config file.
A variable in the transformation module defines a set of time series with 1 or more locations. To define which unique time series of this set should be used
in the tranformation the inputLocationId can be used. The variableId and the inputLocationId uniquely define a input time series. The factor for this time series will be defined by
the location attribute factor. The constant value will be defined by the location attribute constant. Note that it is possible to define a constant value can be defined for each input time series.
The constant value which will be used in the equation will be the sum of the defined constant values. Usually the constant value is only defined for 1 input time series and set to zero for the others time series.
Input
The input will be defined by the variable attribute id and the input location attribute id.
Options
- constantAttributeId,
- factorAttributeId,
- inputLocationAttributeId,
- variableAttributeId
Output
- a single output time series defined by the element <output>
Configuration example
<?xml version="1.0" encoding="UTF-8"?> <!-- edited with XMLSpy v2007 sp2 (http://www.altova.com) by WL | Delft Hydraulics (WL | Delft Hydraulics) --> <transformationModule version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.wldelft.nl/fews" xsi:schemaLocation="http://www.wldelft.nl/fews http://fews.wldelft.nl/schemas/version1.0/transformationModule.xsd"> <variable> <variableId>input1</variableId> <timeSeriesSet> <moduleInstanceId>InputVariableFunctionTest</moduleInstanceId> <valueType>scalar</valueType> <parameterId>Q.obs</parameterId> <locationId>H-2001</locationId> <timeSeriesType>external historical</timeSeriesType> <timeStep unit="day"/> <relativeViewPeriod unit="day" start="0" end="10"/> <readWriteMode>editing visible to all future task runs</readWriteMode> </timeSeriesSet> </variable> <variable> <variableId>input2</variableId> <timeSeriesSet> <moduleInstanceId>InputVariableFunctionTest</moduleInstanceId> <valueType>scalar</valueType> <parameterId>Q.obs</parameterId> <locationId>H-2002</locationId> <timeSeriesType>external historical</timeSeriesType> <timeStep unit="day"/> <relativeViewPeriod unit="day" start="0" end="10"/> <readWriteMode>editing visible to all future task runs</readWriteMode> </timeSeriesSet> </variable> <variable> <variableId>output</variableId> <timeSeriesSet> <moduleInstanceId>InputVariableFunctionTest</moduleInstanceId> <valueType>scalar</valueType> <parameterId>Q.obs</parameterId> <locationId>H4300</locationId> <timeSeriesType>simulated forecasting</timeSeriesType> <timeStep unit="day"/> <relativeViewPeriod unit="day" start="0" end="10"/> <readWriteMode>editing visible to all future task runs</readWriteMode> </timeSeriesSet> </variable> <transformation id="test"> <multipleLocationAttributes> <multipleIinearRegression> <constantAttributeId>constant</constantAttributeId> <variableAttributeId>variableId</variableAttributeId> <inputLocationAttributeId>inputLocationId</inputLocationAttributeId> <factorAttributeId>factor</factorAttributeId> <outputVariable> <variableId>output</variableId> </outputVariable> </multipleIinearRegression> </multipleLocationAttributes> </transformation> </transformationModule>