MEFM (version 2.2)

demand_model: Estimate the electricity demand models

Description

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

Usage

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

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

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.

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

Run this code
# 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]]) 

Run the code above in your browser using DataLab