demand_model: Estimate the electricity demand models

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Estimate the half-hourly/hourly and seasonal demand models.

Usage

1
demand_model(hhdata, adata, hhoptformula, aoptformula)

Arguments

hhdata

The historical half-hourly/hourly demand, temperature and seasonality data

adata

The historical seasonal (annual, summer, winter or quarterly) demographic and economic data

hhoptformula

The formula for each half-hourly/hourly demand model

aoptformula

The formula for seasonal demand model

Details

Estimate the demand model using the historical data, use additive model for half-hourly/hourly demand and linear model for seasonal demand, log demand is used for half-hourly/hourly model.

Value

hh

half-hourly/hourly demand models

hhfits

fitted values of half-hourly/hourly models

hhres

half-hourly/hourly model residuals

a

seasonal model

afits

fitted values of seasonal model

fits

fitted values of the entire model

res

entire model residuals

Author(s)

Rob J Hyndman and Shu Fan

References

R. J. Hyndman and S. Fan (2010) "Density Forecasting for Long-term Peak Electricity Demand", IEEE Trans. Power Systems, 25(2), 1142–1153.

See Also

simulate_ddemand, simulate_demand, sa, sa.econ

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
# formula for half-hourly model, to be given by the user
formula.hh <- list()
for(i in 1:48)
  formula.hh[[i]] = as.formula(log(ddemand) ~ ns(temp, df=2) + day 
    + holiday + ns(timeofyear, 9) + ns(avetemp, 3) + ns(dtemp, 3) + ns(lastmin, 3) 
    + ns(prevtemp1, df=2) + ns(prevtemp2, df=2) 
    + ns(prevtemp3, df=2) + ns(prevtemp4, df=2) 
    + ns(day1temp, df=2) + ns(day2temp, df=2) 
    + ns(day3temp, df=2) + ns(prevdtemp1, 3) + ns(prevdtemp2, 3) 
    + ns(prevdtemp3, 3) + ns(day1dtemp, 3))

# formula for annual model, to be given by the user
formula.a <- as.formula(anndemand ~ gsp + ddays + resiprice)

# create lagged temperature variables
sa <- maketemps(sa,2,48)

sa.model <- demand_model(sa, sa.econ, formula.hh, formula.a)

summary(sa.model$a)
summary(sa.model$hh[[33]]) 

robjhyndman/MEFM-package documentation built on May 27, 2019, 11:39 a.m.