version 1.7.0.1 (12.3 MB) by
Ameya Deoras

Slides and MATLAB® code for the day-ahead system load and price forecasting case study.

** Update: The webinar recording is available at:

http://www.mathworks.com/videos/electricity-load-and-price-forecasting-with-matlab-81765.html

This example demonstrates building a short term electricity load (and price) forecasting system with MATLAB®. Two non-linear regression models (Neural Networks and Bagged Regression Trees) are calibrated to forecast hourly day-ahead loads given temperature forecasts, holiday information and historical loads. The models are trained on hourly data from the NEPOOL region (courtesy ISO New England) from 2004 to 2007 and tested on out-of-sample data from 2008.

The application includes an (optional) Excel front end which enables users to call the trained load forecasting models through a MATLAB-deployable DLL.

The document titled "Introduction to Load & Price Forecasting Case Study" will guide you through the different components of the analysis.

If you do not have all of the required toolboxes, you can still view the results of running the analysis by clicking on one of the HTML reports below.

NOTE: The Access database shown in the webinar is not provided with this archive due to size restrictions. The equivalent data sets are provided in MAT-files in the folders Load\Data and Price\Data for the load and price forecasting studies respectively. The raw data files can be obtained directly from ISO New England (www.iso-ne.com)

MORE ON LOAD AND PRICE FORECASTS:

Accurate load forecasts are critical for effective operations and planning for utilities. The load forecast influences a number of decisions including which generators to commit for a given period, and acutely affects the wholesale electricity market prices. Load and price forecasting algorithms typically also feature prominently in reduced-form hybrid models for electricity price, which are some of the most accurate models for simulating markets and modeling energy derivatives. The electricity price forecast is also used widely by market participants in many trading and risk management applications.

Ameya Deoras (2021). Electricity Load and Price Forecasting Webinar Case Study (https://www.mathworks.com/matlabcentral/fileexchange/28684-electricity-load-and-price-forecasting-webinar-case-study), MATLAB Central File Exchange. Retrieved .

Created with
R2010a

Compatible with any release

**Inspired by:**
Intelligent Dynamic Date Ticks

**Inspired:**
Commodities Trading with MATLAB

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!Create scripts with code, output, and formatted text in a single executable document.

Abolfazl Nejatianthis is my forecasting code which allows you to predict time series data with LSTM, CNN, and MLP Networks.

https://www.mathworks.com/matlabcentral/fileexchange/69506-time-series-prediction

NNHi

I am unable to compute forecasting in excel file. It shows error.

Somayeh SHaiyanhi Ameya and everyone

i can't find the file data.mat to have hourly raw data.

and i have problem finding it in iso-ne.com.

please help me. my email adders: s_shaiyan@yahoo.com

Bayartsog OyunbaatarHello everyone! I tried my excel data for short term forecasting it's still not working. Please help me. rataabnuyo@gmail.com

Francesca PiconeHi all, everyone can help me understanding how do i have to change the code as i can use it with a dataset.xlsx??

Thanks to every one :)

Waqar WaheedDoes anyone still have the updated code? or data set. I would appreciate it if u could lend a hand. Thanks

waqar-waheed@hotmail.com

Adam SummersThe forcaster.xlsx file is not working.

Menzi DubeHi all, tried working the model with 2019 hourly data and it’s not working. Please help with modifications, menzilennon.dube@gmail.com

Pietro CraigheroHi does anyone have the dataset? It would be great if you could send it to me at craigheropiero@gmail.com

Tasawar MurtazaThe forcaster.xlsx file is not working. So I can't test the tranined model with some new data.

Can anyone help me regarding this?

Mark ColoniaDoes anyone still have the updated code? or data set. Would appreciate if u could lend a hand. Thanks

OJO AVOKE DANIELI need matlab code on how to model a short term load forecasting using artificial neural network for my master project.my email ID is :iavokeo@gmail.com

Obanla SundayPlease I need matlab code on how to model a short term load forecasting using artificial neural network for my final year project. Thanks

Rok CiglarHi guys, could you please send me the data to the email: rok.ciglar@gmail, because I can not open web site... This will mean a lot to me. Thanks!

AlexDear Ameya, all

Can anyone make me understand the function (or notion) of genPredictor function?

Thanks

Akash MenonHi does anyone have the dataset? It would be great if you could send it to me at akashm26@gmail.com

Hicham BelhHi, i have the same Problem as Muhammad Asad.

@ M. Asad: did you solve this issue?

will be grateful for any Help from anyone.

thx

Muhammad AsadHi, excel application is not running properly. It is giving message "Error in Forecaster.Class1.1_0: Invalid calling syntax for the "predict" command. Type "help predict" for more information".

Can anyone help me?

hanieh allahkaramiHi, I could not access the data. Thank you, one of my friends sends the data to me...haniehallahkarami72@gmail.com

Anant SaxenaThanks a ton Fred. Will be forever grateful to you.

Poonam Dhakahi guys, I am not able to find the datasets. could anyone please send me the data to the email: ppoonam_phd18@thapar.edu

Georgi ZhegovHi guys, could you please send me the data to the email: sevenx@abv.bg. I can not open the site.

Thank you in advance!!

FredHi guys,

This is the latest direct link to dataset:

https://www.iso-ne.com/isoexpress/web/reports/load-and-demand/-/tree/zone-info

Thanks,

Fred

Bongani NdlovuHie guys, if anyone has the dataset for this example please email on bongz82@yahoo.com

Thanos Toliasif someone can send me (tolias96@gmail.com) the dataset it would be great!

jose idelfonsoHello guys, does anyone have the dataset for this example? If you can share it with me please. My email address is jos.idelfonso@gmail.com. Thank you in advance.

Si Yong HengCan I use equest data for short term load forecasting? I am doing a project on BEMS for shopping malls. Any help is appreciated. Thank You!

Desmond SzeHi Guys,

I am new to this so i don't exactly know how to run the codes. Would appreciate it if anyone can teach me how to do it step by step. Can the codes also run in Matlab R2017b? Thanks a lot!

Desmond

Testing zoneHello Matlab mates, I want to create a project in MATLAB that can detect

# No of faces in real-time through webcam or CCTV

# save the values in the database how many customers came to shop or brand today

# and then I want to apply some Artifical intelligence to predict and forecast how many customers come in next day.

*but I don't know how to implement the prediction or forecasting code in Matlab*

Syer Khomainie Mohamad yakophi guys, for this coding.. could anyone explain the purpose of data.Numdate ? i found in not make sense value when converted to datetime? for example 731947.0000 = 3904-01-01

Syer Khomainie Mohamad yakophi Ameya, hope you healthy, i just want to ask how you convert numdate 731947.0417 to real time? hope you could help.tq

Ioannis TsikriteasDoes anyone has the files that needed from ISO New England (www.iso-ne.com)?

hsu hsuuhello~

the iso new england webistite is not accessible.

someone please provide me raw data files .

please either upload or send it to me.

Isaaclbert EinewstonThese models are really useful, the structure of codes is simple to understand, the results are beatiful, I like. VERY NICE WORK!

saurabh singhhi everyone,

the iso new england webistite is not accessible.

someone please provide me raw data files .

plz either upload or send it to me...

Fausto Quezadajunwei liugood

SOUY BunhengHello, I would like to ask you about the load forecasting presentation. When I have already build the matlab compile for excel add in but I do not know how to add or import figure into excel spreadsheet. Could you tell about? Thanks in advance.

Best regards!

CarlosThe data is not available

Nisarg PatelHi everybody,

I am having trouble downloading the data from

www.iso-ne.com

can somebody help me with this problem?

Maybe somebody can upload it for me or send it to me?

that would be very nice

thanks in advance

Nisarg

dina mohamedgood

amin mnthi. how can I run this progam?

I cant link the data to main file,plz help me?

Ali bbbbWhen I run the visual query builder, it asks for a user and pass!! anyone have the same issue?

Baran YildizHi Ameya & All Others

Thanks for providing detailed Electricity Load and Price Forecasting example.

The version that I have 'MATLAB R2013b' won't recognize the 'genPredictors' function.

Am I missing a Toolbox or do you have any idea what might be the probelm?

Thanks

Baran

ccsI want to generate a power consumption graph. I have measured data (power, energy) for every two seconds, for say three year.

Challenge: to write a time defined matlab program that plots every measurement (scatter) for any given day or days (between 00:00 & 24:00). I hope this is clear....requests for more clarity are welcome.

Thank you all

Robert TrencanskyIm pretty new with NN´s but i like this program. Have one question, can be this program edited for predicting only temperature ? Any tips are appreciated, thanks :)

philippeHi has anyone modified it for long term forecasting ?

Dr. Pradeep Jangiri am new for this

can you tell me how to run all file step by step

when i run errors in all files

can this code run in matlab 2008a or 2013a

IrakliHello. I downloaded these files and compiled LoadForecast.m as class and other files and folders as helper files and folders. Everything went OK and compiler generated .dll and .bas files. I linked those bass files in .xlsm file, but when I press compute forecast it doesn't show "Neural Net" (files with 0-s) it shows only tree model result.

I don't know if it is relevant, but in holidays file dates are written like this: 01.01.2007, but matlab needs format like this 01-01-2007. I compiled default files and then programmatically changed "." to "-" in dates, still "Neural Net" doesn't work in both cases.

Please help me. I will appreciate any response!

DorianHi everybody,

I am having trouble downloading the data from

www.iso-ne.com

can somebody help me with this problem?

Maybe somebody can upload it for me or send it to me?

that would be very nice

thanks in advance

Dorian

DorianHi everybody,

I am having trouble downloading the data from

www.iso-ne.com

can somebody help me with this problem?

Maybe somebody can upload it for me or send it to me?

that would be very nice

thanks in advance

Dorian

MarvMr. Deoras,

I am trying to replicate your procedure. I have hit a block when I try to perform a forecast i.e.

forecastLoad = sim(net, testX')';

I get a maximum variable error.

From your data, testX is 17544 x 8.

The error message is as follows:

Maximum variable size allowed by the program is exceeded.

Error in repmat (line 92)

B = A(mind,nind);

Error in fixunknowns.apply (line 14)

meanX = repmat(settings.xmeans,Q);

Error in nnMATLAB.pc (line 28)

pi = hints.inp(i).procApply{j}(pi,hints.inp(i).procSet{j});

Error in nncalc.preCalcData (line 20)

data.Pc = calcMode.pc(net,data.X,data.Xi,data.Q,data.TS,calcHints);

Error in nncalc.setup1 (line 118)

calcData =

nncalc.preCalcData(matlabMode,matlabHints,net,data,doPc,doPd,calcHints.doFlattenTime);

Error in network/sim (line 283)

[calcMode,calcNet,calcData,calcHints,~,resourceText] = nncalc.setup1(calcMode,net,data);

Error in Load_forecasting_test (line 38)

forecastLoad = sim(net, testX')';

Thank you, and great program otherwise.

Subodhwhen i run the excel interface i get the following error :-

run-time error '1004' method 'paste' of object '_worksheet' failed

JiDavid OrtizDear Ameya Deoras

I have a concern about the application made in matlab for forecasting electricity demand in the short term, I'm done my thesis basing on this application, my question is that amendments should do in the loadforecast function if I have variables temperature'm driving variables are: historical date, time and electrical demands from 2010 to 2013, and make the necessary modifications in the LoadScriptNN script and it worked perfectly but I loadforecast function does not work I get the forecast to zero .

MichaelI noticed for the genPredictors function, some of the inputs to the short term forecasting model is prevDaySameHourLoad and prev24HrAveLoad. It seems that the prev24HrAveLoad uses the current day load and averages it on a 24 hour basis and the prevDaySameHourLoad uses the load from the previous day. I m not sure how these 2 inputs can be used to predict the next day load forecast for the ANN model. For example if today is Sunday and I want to predict the load for tomorrow (Monday) and I m running the load forecast application today at 1 PM, I can't use prevDaySameHourLoad as an input because Sunday is the previous day for the forecasted day Monday and I wouldn't have the 24 hour historical data for Sunday as I m running the program at 1PM on Sunday, so data from 1 PM up to midnight is unknown. Second the prev24HrAveLoad input depends on the actual load data for that day, which for this example would be the load data that I m forecasting for the next day (Monday). I m not sure how these 2 inputs can be used to predict the day ahead load if it requires historical data that you might not have yet.

Jesse HillWhen running the forecaster, I find that each time I run the codes, I get a different forecast/model for the loads. Is there a way to guarantee a consistent forecast model or is this always the case given that the neural network may be ending in a different local minima. Thank you for your help.

SheikhAmeya:

could you please tell me what did you mean by daily5dayHighAve and daily5dayLowAve in the genpredictor function?

% Long Term Forecast Predictors

X = [data.DryBulb data.DewPnt daily5dayHighAve daily5dayLowAve data.Hour dayOfWeek isWorkingDay];

alexJorgeAbhishek RaiJose FranciscoDear Ameya,

In order to forecast the electricity price of the day ahead Dutch market I am using neural networks and real data from 2007-2011.

I constructed the X matrix as you said in the webinar for load forecasting and proved with different combinations. The one with gives me the lower MAPE value consists of 8 inputs (Hour dayOfWeek isWorkingDay prevWeekSameHourPrice prevDaySameHourPrice prev24HrAvePrice prevDayNGPrice prevWeekAveNGPrice), but I can't reduce this value more than 11%.

I need to achieve better accuracy but I don't know whar should I change. Could you send me an example of who to forecast the day ahead electricity price? My email is fran90_7@hotmail.com

Thank you in advance.

Kind regards,

Jose Francisco Bolado

Mai Hai AnSiriya SkolthanaratDear Ameya,

I tried to run the loadscriptNN but everytime it went to fatal error. I needed to close the matlab.

I also tried to follow your webinar but there is an error in the fetchDBLoaddata. It said "Undefined function or method 'fetchDBLoadData' for input arguments of type 'char'". Please clarify this. Thank you.

Muhammad Qamar RAZADear sir,

I hope you are in good health.

Sir I am using Matlab NN toolbox and try to call user define function to train the neural network.

But I have problem to call the user define the function in Matlab script.

Sir let me know how i can call these function to train the NN (in NN toolbox).

ErdemDear Deoras,

In order to forecast 'balancing system marginal price (smf)' of Turkish electricity market, i used load, day-ahead price (sgof) and the difference between up-regulation volume and down-regulation volume in MWh (nth) as inputs. When i give lagged nth (previous day and previous week same hour nth) only,the forecasting performance is bad, however when i give lagged nth with current nth (i.e kth hour nth for predicting the kth hour smf) forecasting performance is really improved successively. The problem is that forecasting nth for a future hour is a challenging task and the performance of forecasting nth is not so good. I want to give a range of current nth instead of one value (maybe probability dist. of nth / monte carlo) in order to forecast a range of smf instead of one value (probability dist.of smf instead of one forecasting value). But i do not know how to create a range of possible nth values as an input of ANN in order to find forecasted smf ranges. Would you please help me about matlab codes? Below i use the script that is modified by your genpredictor script. I hope that I could describe the problem properly and I would be glad to discuss about it with you. Thank you for your contribution and look forward to hear from you.

Best wishes,

Erdem

function [X, dates, labels] = genPredictorssmf4(data, term)

prevDaySameHourLoad = [NaN(24,1); data.SYSLoad(1:end-24)];

prevWeekSameHourLoad = [NaN(168,1); data.SYSLoad(1:end-168)];

prev24HrAveLoad = filter(ones(1,24)/24, 1, data.SYSLoad);

prevDaySameHoursgof = [NaN(24,1); data.SGOF(1:end-24)];

prevWeekSameHoursgof = [NaN(168,1); data.SGOF(1:end-168)];

prev24HrAvesgof = filter(ones(1,24)/24, 1, data.SGOF);

prevDaySameHoursmf = [NaN(24,1); data.SMF(1:end-24)];

prevWeekSameHoursmf = [NaN(168,1); data.SMF(1:end-168)];

prev24HrAvesmf = filter(ones(1,24)/24, 1, data.SMF);

prevDaySameHournth = [NaN(24,1); data.NTH(1:end-24)];

prevWeekSameHournth = [NaN(168,1); data.NTH(1:end-168)];

X = [data.Hour dayOfWeek isWorkingDay data.SYSLoad prevWeekSameHourLoad prevDaySameHourLoad prev24HrAveLoad data.SGOF prevWeekSameHoursgof prevDaySameHoursgof prev24HrAvesgof prevWeekSameHoursmf prevDaySameHoursmf prev24HrAvesmf data.NTH prevWeekSameHournth prevDaySameHournth];

labels = {'Hour', 'Weekday', 'IsWorkingDay', 'CurrentLoad', 'PrevWeekSameHourLoad', 'prevDaySameHourLoad', 'prev24HrAveLoad', 'CurrentSGOF', 'PrevWeekSameHoursgof', 'prevDaySameHoursgof', 'prev24HrAvesgof', 'PrevWeekSameHoursmf', 'prevDaySameHoursmf', 'prev24HrAvesmf', 'CurrentNTH', 'PrevWeekSameHournth', 'prevDaySameHournth'};

end

ErdemMuhammad Qamar RAZADear Ameya Deoras!

when i compiling the genpredictor.m file then its give me error in

genPredictors

Error using genPredictors (line 29)

Not enough input arguments.

which is dates = datenum(data.Date', 'yyyy-mm-dd HH:MM:SS') + (data.Hour-1)/24;

let me know how i can fix this problem.

i am wondering for this problem about half month.

i am waiting for reply1

qamar_raza786@yahoo.com

Muhammad Qamar RAZADear Ameya Deoras!

i am very new in this area.pleas tell me in detail i want import the load data into Matlab using (i have own data which is provided by the grid to me.

i am waiting for your reply

Thanks alot

Ameya DeorasIzi, that error seems to suggest that you are calling the genPredictors function without any inputs. “data” is a required input for the function and needs to be specified. See loadScriptNN for an example of how to use this function.

Ameya DeorasSatya, is the Neural Network predicting 0 load in MATLAB or in the Excel spreadsheet? If it is fine in MATLAB you may need to investigate if the model is being loaded correctly in the Excel side.

IziAmeya,

I have the same problem like Ali in May 2011. Solution?

The fun (genPredictors.m) it showed the errors as shown below:

??? Input argument "data" is undefined.

Error in ==> genPredictors at 27

dates = datenum(data.Date, 'yyyy-mm-dd HH:MM:SS') + (data.Hour-1)/24;

Could you please kindly solve the problem?

SatyaHi Ameya, When I try to use this forecaster, NeuralNet forecasts to Zero load all the day, However the other model shows the forecast load. I tried for several days all the time it is the same case where NN shows zero load. Is there anything that I can do to get NN work?

Erdal BizkevelciBineCristhiano MorenoHello.

How can i do it with a NAR Network ?

I have a temporal serie with 99 values, and I want to predict the 100 value. And finally plot this 2 series y the same figure.

Somebody can help me, I prefer with the script.

Thk u

Cristobal Samudio CarterSuposing that is necessary generate multiple demands time series forecast with the demand model made with the Neural Network Tool, this would be possible??

Thinking specifically of the demand model presented, this would be possible with a single predictor scenario (temperature for exaple).

If it were possible to generate multiple paths to the model hourly demand made, which would be the commands to use?

AliThank you for this wonderful work,

I've increased the factors like RELATIVE HUMIDITY ,WIND SPEED, but it showed the errors as shown below:

Error using ==> network.sim at 178

Inputs are incorrectly sized for network.

Matrix must have 8 rows.

Error in ==> LoadScriptNN at 94

forecastLoad = sim(net, testX')';

Could you guide me how to treat it?

Thank you very much!

JosephThis case study has been really helpful, thanks. I am having a problem with changing my network to a time-series forecast tool in which I can feed the current load back through the network to forecast the next day, or possibly the next few hours. It fits the load very well, but due to the complexity in the input preparation I can't figure out how to use it with the sim function (in my regular network I could just use what you did, i.e. sim(net,inputs'), but this won't work with the time-series setup)to actually predict new data coming in. My inputs are similar to your case study. Do you have any recommendations for preparing new inputs for a predicting function in this setup? I have played around with the network code to try and mimic what it does to the inputs, but no luck.

Ameya DeorasJack, there are two places where prediction is shown. In loadForecastNN, look for the line "forecastLoad = sim(net, testX')';". Please also take a look at my comment from 20 May 2011 for an example on using the function forecastLoad to create a prediction.

There are 3 ways of doing multi-step prediction:

1. You can build a NARX network. There are examples in the documentation that show how to do multi-step with such a network.

2. You can build a feedforward network designed for predicting N steps ahead. That is what I do in this example - build a network for 24 step-ahead prediction. This is done by lagging the inputs 24 observation. The function createLags above will do this for you.

3. Run the prediction in a loop. The function multiPredict above does this for a 1-step network. In the context of this example, you can use the N-step model to do 2N, 3N, 4N... step prediction.

While I don't think the lack of multi-step prediction warrants a 1-star rating, you are of course entitled to rate it based on whatever criteria make sense to you. This is not intended to be a tutorial on Neural Networks Toolbox so I can't possibly include everything there is to know about using it. I encourage you to consult the documentation or contact technical support for help with your specific needs.

Ameya DeorasHere is a function that can be used to run multi-step prediction from a 1-step feed-forward network:

function pred = multiPredict(net, X, numSteps)

% multiPredict performs iterated prediction with a feed-forward neural

% network.

%

% SYNTAX: pred = multiPredict(net, X, numSteps)

%

% INPUTS:

% net is a feed-forward neural net

% X is a matrix of size numObservations * numPredictors

% numSteps is the number of steps to predict (eg. 10)

%

% OUTPUTS:

% pred is a matrix of size numObservations * numSteps where every column is

% the ith step prediction for that sample observations. The first column is

% the 1-step prediction, the second columns is the 2-step prediction and so

% on.

numObs = size(X,1);

pred = zeros(numObs, numSteps);

pred(:, 1) = net(X')';

for i = 2:numSteps

X = [pred(:,i-1) X(:,1:end-1)];

pred(:,i) = net(X')';

end

Ameya DeorasHere is a function that can be used to create an arbitrary predictor matrix with any number of lags:

function mat = createLags(vec, lags)

% CREATELAGS generates lagged versions of an input vector or matrix to

% generate a predictor matrix.

%

% USAGE:

% predictorMatrix = createLags(series, lags)

%

% Here series is a numObs-by-numDim matrix of observations. If numDim > 1,

% it implies the input series is a multidimensional series. lags is a

% vector of integer lags where 0 corresponds to no lag, +1,+2,+3... correspond to

% lags of 1,2,3... steps, and -1,-2,-3 correspond to "leads" of 1,2,3

% steps. predictorMatrix is a numObs-by-numDim*numLags matrix of the

% shifted versions of the input matrix

% x = [1 2 3 4; -1 -2 -3 -4]'

% y = createLags(x, [-1 0 2])

[numObs, numDim] = size(vec);

numLags = length(lags);

mat = NaN(numObs, numDim * numLags);

for i = 1:length(lags)

mStaInd = max(1, lags(i)+1);

mEndInd = min(numObs, lags(i)+numObs);

vStaInd = max(1, 1-lags(i));

vEndInd = min(numObs, numObs-lags(i));

mat(mStaInd:mEndInd, (i-1)*numDim+1:i*numDim) = vec(vStaInd:vEndInd,:);

end

JackThe problem with this example it is that Ameya doesn't show how to make a multi step prediction.

This should have been it the example because the title is FORECASTING.

I see a lot or questions everywhere on the web about multi step ahead prediction.

Everyone know how to load datas. I means it's almost like opening an Excel file. But to make a prediction is very difficult.

I've a NARX neural network with 10 hidden neurons and 2 delays. As input I have a 510x5 (called Inputx) and as output I have a 510x1 (called Target).

I want to forecast 10 days ahead but it's really not working...

I tried the following code but I'm stuck now. :-(

Would you mind to help me ? Some code will be awesome. :-(

***////////////////////////////////////////////******** ***/////////////////////////////////////////// ******

inputSeries = tonndata(Inputx,false,false);

targetSeries = tonndata(Target,false,false);

netc = closeloop(net);

netc.name = [net.name ' - Closed Loop'];

[xc,xic,aic,tc] = preparets(netc,inputSeries,{},targetSeries);

yc = netc(xc,xic,aic);

***////////////////////////////////////////////******** ***/////////////////////////////////////////// ******

JackHow do we make a prediction with the Matlab generated script above ?

The example should have shown that ... really !!!

ThanhDear Ameya,

I have problem with command:

data = fetchDBLoadData('2004-01-01','2008-12-31')

This is the dislay after entering the command:

-----------

??? Error using ==> chkprops at 18

Invalid com.mathworks.toolbox.database.PrefsDBPanel property: ' DefaultRowPreFetch '.

Error in ==> setdbprefs at 91

p = chkprops(DatabasePrefs,p,prps);

Error in ==> setdbprefs at 88

setdbprefs(flds,vals)

Error in ==> fetchDBLoadData at 14

setdbprefs(s)

------

That's all. Could you guide me how to treat it?

Thank you very much!

AliAmeya,

When I tried to run the fun (genPredictors.m) it showed the errors as shown below:

??? Input argument "data" is undefined.

Error in ==> genPredictors at 27

dates = datenum(data.Date, 'yyyy-mm-dd HH:MM:SS') + (data.Hour-1)/24;

Could you please kindly solve the problem?

Ameya DeorasHi. A simple example call to loadForecast has been provided in a previous post. If you need something more, could you please describe it in more detail?

Here is the example again:

% Temperature forecast

temp = [38 36 36 36 35 34 35 35 36 38 40 41 42 43 44 44 44 43 42 41 40 40 40 40;31 30 30 30 30 29 30 31 32 32 32 32 32 32 32 32 34 35 36 37 38 38 38 38]';

% Load forecast for that temperature forecast for April 2, 2008

y = loadForecast('April 2, 2008', temp, 'No');

fafaDear ameya

i'm trying to run the price forecast program,but i receive errors,would you please send me an example of this program.

kamiplease be concider simple example without excel file

kamidear ameya

would you please send me the example of this program .includ "temp,holiday,price"

Ameya DeorasThe second input to loadForecast is the temperature forecast for the day for which you want to predict the load. The second requirement is that the day you choose must have some historical data in the database for the week prior. You will therefore also need the database installed. You can contact me to get access to the access database used for this example. Once the database is set up, you can call loadForecast as follows:

y = loadForecast('April 2, 2008', temp, 'No');

where temp is a 24-by-2 array of hourly temperature and dew point forecasts for the day in question.

temp = [38 36 36 36 35 34 35 35 36 38 40 41 42 43 44 44 44 43 42 41 40 40 40 40;31 30 30 30 30 29 30 31 32 32 32 32 32 32 32 32 34 35 36 37 38 38 38 38]';

HamedHi; I want to run this load forecast without using Excel front page. Can you please identify what is the process? In "LoadForecast.m" file at line 46 I am receiving error showing that "temperature" is not defined. How should I define this temperature?

Ameya DeorasFor long term forecasting, you may need to take into account additional predictors such as the economic growth in an area and new industrial or residential developments. The existing model could be modified to remove the lagged load dependence. This would give you a model that would generate a forecast based only on temperature, date/time and holiday information. You could then use it either in a Monte-Carlo fashion or for different scenarios of future temperatures (average, 1 std dev, 2 std dev etc) to create a profile or distribution of load forecasts. Check out my other submission "Energy Trading & Risk Management with MATLAB" for an example of a temperature simulation model.

The temperature data in provided is historical. If you were to use to model to make a forecast, you would use forecast temperature values. In my example, I pretend that today is April 2, 2009 and use actual temperatures for the next day as my assumed temperature forecast. So, only actual temperatures and not forecasts are being used to create the load forecast.

Jesse HillFor the purposes of the 'long' term forecasting, is the period any different than the short term's period? Are we really only changing the factors used to build the model in order to forecast the future load?

In addition, is the temperature data that was provided in the test set a forecast or the historical data? I see that the slides/pdf show that we would be using forecasts, but I wasn't sure if that was the case on the provided data.

Thank you,

Jesse

Ameya DeorasThanks for the feedback. You can certainly use time-delay networks for such an application. In this example, I manually create time-lagged versions of the response (load) and use them as variables in the predictor matrix. I use the 168-hour lagged load, the 24-hour lagged load and a smoothed or averaged 24-hour lagged load.

kemal ozsariAmeya, your data also has time series property. So is it possible to have a model that is using time-delay dynamic networks? Also may be narx network, with multiple inputs and past y data. If possible and you update your webinar with new models, it will be great. Thx.

SamAmeya,

I wish to supplement one more point regarding the problem mentioned above: I could successfully run the loadForecast.m in Matlab and generate the forecast.

So, I wonder if there was something wrong with my setups in the operating system or in the Visual Studio environment at the compile-time and run-time, e.g., the path or whatsoever possible.

I look forward to your hints and helps. Thanks.

SamI wish to get some helps from you to test the running the function in the spreadsheet.

I have compiled your Forecaster.prj and imported the corresponding .bas files into the Forecaster.xlsm. But when I tried it by clicking the "Compute Forecast" button, it showed the run-time errors in the forecast cells, as shown below:

Error in Forecaster.Class1.1_0: Undefined function or method 'sim' for input arguments of type 'struct'.

Error in => loadForecast.m at line 56

The folder where the sim.m situated was already in my Matlab path when I checked through the Set Path command.

I also noticed that you had indicated in the loadForecast.m the paths for looking up the NN and tree models as well as the data file.

Could you please kindly provide some hints to pin point and solve the problem?

Ameya DeorasThanks for your question. The methodology in this example isn't taken from any one source. There are a couple of papers I read which gave me some ideas. Please also check the references within.

* Eugene Feinberg & Dora Genethliou, Applied Mathematics for Power Systems, Chapter 12 Load Forecasting

* K. Liu et al, "Comparison of Very Short-Term Load Forecasting Techniques", IEEE Transactions on Power Systems Vol 11 No 2, May 1996

* Rafal Weron, "Modeling and Forecasting Electricity Loads and Prices" Wiley

Jesse HillWould you be able to provide some of the sources/authors that contribute to the background to the code?

Thank you for your help

Ameya DeorasI have updated the submission to include the relevant data in MAT-files so you shouldn't need the Access database anymore. The Intro document has also been updated to reflect this.

Ashraf Ul HaqueCould you kindly advise me how can I get energy.accdb file?

Thanks for your cooperation.

Ashraf Ul HaqueHi, don't get energy.accdb file