# 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);
end
CostForecast.time = tvec;
CostForecast.signals.values = CostMat;
CostForecast.signals.dimensions = M;
PpvForecast.time = tvec;
PpvForecast.signals.values = PpvMat;
PpvForecast.signals.dimensions = M;
##### 댓글 수: 1표시 없음숨기기 없음
Walter Roberson 2020년 10월 2일

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

### 답변(1개)

Raunak Gupta 2020년 10월 2일
Hi,
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;
prob.optimoptions
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표시 이전 댓글 수: 1숨기기 이전 댓글 수: 1
Raunak Gupta 2020년 10월 3일
Hi,
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