lscore {loadshaper} | R Documentation |
Load Shape Score
Description
lscore
provides a diagnostic score
for evaluating the derived load shape in
retaining time series properties.
Usage
lscore(ls, type = "acf", output = 2, lag = NULL)
Arguments
ls |
An object of class |
type |
Type of correlation to be
evaluate, either |
output |
Type of output to be used, either 1 or 2;
uses |
lag |
Maximum lag at which to calculate the acf or pacf.
Same as |
Details
The diagnostic measure is calculated
as a weighted mean absolute percent error (MAPE)
of auto correlation or partial auto correlation
values of the derived series with respect to the original.
The values are calculated for given lag. Lag = 0 is omitted
from calculation for auto correlation as it would be always 1.
If o_i
and d_i
are the correlation values of
original and derived load shape at lag i
, then weighted
MAPE is calculated as
wmape = \sum _{i=1}^{lag} { w_i * |(o_i - d_i) / o_i|}
where w_i = \frac{|o_i|}{\sum _{i=1}^{lag}|o_i|}
Since wmape
is a measure of error, lower value
indicates better preservation of time
series property.
Value
A list of the followings:
wmape
: Weighted MAPE.lag
: Lags at which ACF or PACF values were evaluated and used in calculatingwmape
.type
: Type of Correlation (ACF or PACF)cor_x
: ACF/PACF values of the original load.cor_y
: ACF/PACF values of the derived load.weight
: Weights at different lags used to calculatewmape
.
Examples
loads <- ercot[ercot$Year == 2019, ]$COAST
linear_loadshape <- lslin(loads, target_lf = 0.4)
# --------------
scores_1 <- lscore(linear_loadshape, type = "acf", lag = 20)
print(scores_1)
# --------------
scores_2 <- lscore(linear_loadshape, type = "pacf")
print(scores_2)