applyMultipleLinearRegression(string
startTimeString,
string
endTimeString,
sequence tsDataSetSequence,
floating-point minimumLimit,
floating-point maximumLimit)
Apply the regression coefficients contained in the current paired data set to the array of time series data sets in tsDataSetSequence to develop a new time series data set. The applyMultipleLinearRegression function applies the multiple linear regression coefficients computed with the multipleLinearRegression function.
For the general linear regression equation, a dependent variable, Y, may be computed from a set independent variables, Xn:
Y = B0 + B1*X1 + B2*X2 + B3*X3
where Bn are linear regression coefficients.
For time series data sets, an estimate of the original time series data set values may be computed from a set of independent time series data sets using regression coefficients such that:
TsEstimate(t) = B0 + B1*TS1(t) + B2*TS2(t) + + Bn*TSn(t)
where Bn are the set of regression coefficients and TSn are the time series data sets contained in tsDataSetSequence.
The number of regression coefficients in the current PairedDataMath object must be one more than the number of independent time series data sets in tsDataSetSequence. The collection of selected time series data sets must be in the same order as when the regression coefficients were computed with the multipleLinearRegression method.
All the time series data sets must be regular interval and have the same time interval. The function filters the data to determine the time period common to all time series data sets and uses only those points in the regression analysis. For any given time, if a value is missing in any time series, the value in resultant time series is set to missing.
The parameters minimumLimit and maximumLimit can be used to specify the range of valid values for the resultant data set. Values which fall outside the specified range are set to missing. minimumLimit or maximumLimit may be entered as Constants.UNDEFINED to ignore the minimum or maximum value check.
If startTimeString or endTimeString are blank strings, the start and end time of the resultant time series will be defined by the time period common to all time series data sets in tsDataSetSequence. Otherwise the time series start and end may be defined using startTimeString and endTimeString which have the usual HEC time window format (e.g. 01JAN2001 1400).
Names, parameter type and unit labels for the new time series data set are copied over from the first time series data set in tsDataSetSequence. The F-part in the new data set is set to COMPUTED.
Parameters:
startTimeString A string containing an HEC time (e.g.
01JAN2001 1400) specifying the start time of the resultant time series data set.
May be blank ( )
endTimeString A string containing an HEC time (e.g.
01JAN2001 1400) specifying the ending time of the resultant time series data set.
May be blank ( )
tsDataSetSequence Sequence of TimeSeriesMath objects. Must all be
regular interval and have the same time interval.
minimumLimit A floating-point value specifying the minimum valid value in
the resultant time series data set. Set to Constants.UNDEFINED to ignore this
option.
maximumLimit A floating-point value specifying the maximum valid value in
the resultant time series data set. Set to Constants.UNDEFINED to ignore this
option.
Example:
newTsData =
pairedData.applyMultipleLinearRegression(
01Jan2000 0000,
31Dec2000 2300,
(tsData1, tsData2, tsData3),
Constants.UNDEFINED,
Constants.UNDEFINED)
Returns: A new regular interval TimeSeriesMath object
Generated Exceptions: Throws
a HecMathException if the number of data sets in tsDataSetSequence
is not equal to the number of regression coefficients -1, or if the data sets in
tsDataSetSequence are not regular interval time series data sets with the same
interval time.