Interval forecast | MATLAB implements QRDNN deep neural network quantile regression time series interval forecast

Interval forecast | MATLAB implements QRDNN deep neural network quantile regression time series interval forecast

List of effects

2
1

3

basic introduction

MATLAB implements QRDNN deep neural network quantile regression time series interval prediction. The QRDNN model is a deep neural network model for time series forecasting. It can realize the ability to predict time series intervals by combining deep neural network and quantile regression methods, and has certain advantages and application prospects.

Model description

  • QRDNN (Quantile Regression Deep Neural Network) is a deep neural network model for time series forecasting. It achieves the ability to predict time series intervals by combining deep neural networks and quantile regression methods.

  • In the QRDNN model, firstly, methods such as convolutional neural network (CNN) or recurrent neural network (RNN) are used to perform feature extraction and representation learning on time series data. Then, the extracted features are input into the quantile regression layer, and the interval prediction for different confidence levels is realized through multiple quantile outputs.

  • Specifically, the QRDNN model can be expressed as the following mathematical formula:

y τ = f τ ( x ; θ ) y_\tau = f_\tau(x;\theta)yt=ft(x;i )

  • Among them, y τ y_\tauytExpressed at the confidence level as τ \tauPredicted value at τ , xxx represents the input time series data,θ \thetaθ denotes the model parameters. f τ f_\tauftis the quantile regression layer, which can be obtained through training.

  • The advantage of the QRDNN model is that it can provide interval predictions for different confidence levels, so it can better reflect the uncertainty of the prediction results. In addition, due to the use of deep neural networks for feature extraction and representation learning, the QRDNN model can better handle complex time series data.

programming

  • Complete program and data acquisition method: private message blogger.

1. Matlab realizes the time series interval forecasting model based on QRDNN quantile regression deep neural network;
2. Multi-map output, multi-index output (MAE, RMSE, MSE, R2), multi-input and single-output, including different confidence interval maps, Probability density map;
3. data is the data set, power data set, using the variables of the past period of time to predict the target, the target is the last column, and can also be applied to load forecasting and wind speed forecasting; MainQRDNNTS is the main program, and the rest are function files. no need to run

%% DNN网络训练
tic
DNNnet = trainNetwork(inputn_train,outputn_train,layers,opts);
toc;
analyzeNetwork(layers)
%% DNN测试数据
function [DNN, state] = TrainRecovery(n)
%% 恢复之前的结果,接着进行训练;或者加载现有神经网络.
% n:各层神经元个数,其中按顺序第一个元素为输入层神经元的个数,
% 最后一个元素为输出层神经元的个数,其余元素为隐藏层的神经元个数.
% DNN: cell数组,依次存放A1, A2, A3, ...和 E, Loss.
% state: 若返回值>0则表示DNN已训练完毕,返回精度.


DNN = LoadNN();

if isempty(DNN)
    % 从头开始训练.
    h = length(n); % 网络层数
    DNN = cell(1, h+1);
    for i = 1:h-1
        % 第一列为偏置项.
        DNN{
    
    i} = rand(n(i+1), n(i) + 1) - 0.5;
    end
    % 倒数第2个元素为零列和单位阵的组合.
    DNN{
    
    h} = [zeros(n(h), 1), eye(n(h))];
end

disp('DNN infomation:'); disp(DNN);

for i = 1:length(n)
    fprintf('第[%g]层神经元个数: %g.\n', i, n(i));
end

%% 检测此神经网络是否已训练完成.
state = 0;
if isempty(DNN{
    
    end})
    return
end
EarlyStopping = 3; %DNN早停条件
loss = DNN{
    
    end}(3, 1:end-EarlyStopping);
best = max(loss);
count = 0;
for i = max(length(loss)+1, 1):length(DNN{
    
    end})
    if 0 <= DNN{
    
    end}(3,i) && DNN{
    
    end}(3,i) <= best
        count = count + 1;
        if count == EarlyStopping
            state = best;
        end
    else
        break
    end
end

end
————————————————
版权声明:本文为CSDN博主「机器学习之心」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/kjm13182345320/article/details/129066749

References

[1] https://blog.csdn.net/kjm13182345320/article/details/127931217
[2] https://blog.csdn.net/kjm13182345320/article/details/127418340
[3] https://blog.csdn.net/kjm13182345320/article/details/127380096

Guess you like

Origin blog.csdn.net/kjm13182345320/article/details/130565212