View source: R/TemporalRelativeDifference.R
TemporalRelativeDifference | R Documentation |
Calculates the relative difference between positive Data and and lagged Data
TemporalRelativeDifference(Data,Lag=1,
na.rm=FALSE,PlotIt=FALSE,Time,Silent=FALSE)
Data |
numerical matrix of [1:n,1:d], d>=1 |
Lag |
The number of lags (in units of observations): back shifting: positiv value,forward shifting: negative value, default is the difference to yesterday |
na.rm |
FALSE; do nothing, TRUE: all nan to zero |
PlotIt |
TRUE: plots data |
Time |
[1:n] vector defining time and used for plotting, typically as.Date object |
Silent |
TRUE: not warnings or messages |
Contrary to linear filters in this cases the range of values lies always between [-2,2]
If vector is given as input, vector is given back. If matrix is given as input, PlotIt is forced to be set as FALSE.
Reldiff numerical matrix of [1:n,1:d]. For example for Lag=1
: negative value indicate that today is lower than yesterday and positive values that todays value is higher than yesterdays.
Michael thruh
RelativeDifferenceBetweenTS
data(ElectricityBRD$Mrd_KWh)
V=TemporalRelativeDifference(ElectricityBRD$Mrd_KWh,
PlotIt=TRUE,Time=(ElectricityBRD$Time))
V=TemporalRelativeDifference(cbind(ElectricityBRD$Mrd_KWh,
ElectricityBRD$Mrd_KWh))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.