understanding forecasting code in matlab

조회 수: 3(최근 30일)
NN 2020년 9월 26일
댓글: Raunak Gupta 2020년 10월 3일
Below is the code attached for cost , pv and load from matab example file.
Can i know what method is used for forecasting and how can i compare forecasted values and initial values by plotting it both ?what is the code for poltting and comparing?
Construct forecast vectors for optimization (N x M) matrix
for i = 1:N
CostMat(i,:) = C(i:i+M-1);
PpvMat(i,:) = clearPpvVec(i:i+M-1);
PloadMat(i,:) = loadDataOpt(i:i+M-1,loadSelect);
CostForecast.time = tvec;
CostForecast.signals.values = CostMat;
CostForecast.signals.dimensions = M;
PpvForecast.time = tvec;
PpvForecast.signals.values = PpvMat;
PpvForecast.signals.dimensions = M;
PloadForecast.time = tvec;
PloadForecast.signals.values = PloadMat;
PloadForecast.signals.dimensions = M;


Raunak Gupta
Raunak Gupta 2020년 10월 2일
The default method used by the optimoptions mentioned in the code is linprog which is to solve linear programming problems.
You can see it by creating an optimization problem and displaying the optimoptions property.
prob = optimproblem;
In the file energyOptimizationscript.m, the last part is for plotting the forecasted output. Similarly, you may also plot input data which is being loaded in the very first line. battSolarOptimize function explains the exact setup of optimization problem.
Hope it clarifies!
  댓글 수: 2
Raunak Gupta
Raunak Gupta 2020년 10월 3일
Forecasting in essence means the same, like you want to predict the future data based on the past experience. So, the method by which the information is extracted from previous data is linear programming as mentioned in the answer. For the question of how, a model is fitted based on the data given and that model is used for generating output.
If the model is good in replicating then the forecasting will be good.
Hope this clarify the doubts!

댓글을 달려면 로그인하십시오.


Find more on Quadratic Programming and Cone Programming in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by