Code covered by the BSD License
-
Electricity Load Forecasting ...
-
Electricity Price Forecasting...
-
Load Forecasting using Bagged...
-
Predictor Comparison
-
createHolidayDates(startDate,...
New Years Day
-
dynamicDateTicks(axH, link)
DYNAMICDATETICKS is a wrapper function around DATETICK which creates
-
fetchDBLoadData(startDate, en...
Set preferences with setdbprefs.
-
fetchDBPriceData(startDate, e...
Set preferences with setdbprefs.
-
filterDates(startDate, endDat...
FILTERDATES returns a list of dates between the start and end dates that
-
fitPlot(dates, YMatrix1, res1...
FITPLOT is a modified auto-generated function to create a plot of the actual series,
-
genPredictors(data, term, hol...
GENPREDICTORS generates a matrix of predictor variables for the price
-
genPredictors(data, term, hol...
GENPREDICTORS generates a matrix of predictor variables for the load
-
loadForecast(date, temperatur...
LOADFORECAST performs a day-ahead load forecast using a pre-trained
-
trainAndTestNN(trainX, trainY...
Train and test a neural network for a given set of training and test
-
TreesInDetail.m
-
importData.m
-
View all files
from
Electricity Load and Price Forecasting Webinar Case Study
by Ameya Deoras
Slides and MATLABĀ® code for the day-ahead system load and price forecasting case study.
|
| fetchDBPriceData(startDate, endDate)
|
function data = fetchDBPriceData(startDate, endDate)
% Set preferences with setdbprefs.
s.DataReturnFormat = 'structure';
s.ErrorHandling = 'store';
s.NullNumberRead = 'NaN';
s.NullNumberWrite = 'NaN';
s.NullStringRead = 'null';
s.NullStringWrite = 'null';
s.JDBCDataSourceFile = '';
s.UseRegistryForSources = 'yes';
s.TempDirForRegistryOutput = 'C:\Temp';
s.DefaultRowPreFetch = '10000';
setdbprefs(s)
% Make connection to database. Note that the password has been omitted.
% Using ODBC driver.
conn = database('EnergyData','','password');
% Read data from database.
e = exec(conn,['SELECT ALL Date,Hour,DryBulb,DewPnt,SYSLoad,NGPrice,ElecPrice FROM NEData WHERE Date BETWEEN #' startDate '# AND #' endDate '# ']);
e = fetch(e);
close(e)
% Assign data to output variable.
data = e.Data;
data.NumDate = datenum(data.Date, 'yyyy-mm-dd') + (data.Hour-1)/24;
% Close database connection.
close(conn)
|
|
Contact us