![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/707807/image.png)
How to estimate 95% confidence band on GPR model prediction
7 ビュー (過去 30 日間)
古いコメントを表示
I created a compact GPR model using the Regression Learner app. The model is in a structure which I have used to predict the estimates for a new set of data using: yfit = GPRnewOOS.predictFcn(x_test); where GPRnewOOS is the name of created GPR model, x_test is a set of measurements with large number of predictors, and yfit is output of the model for each measurement.
This works just fine, and I do get predictions of teh function in the array yfit. But I also need to get 95% confidence interval for the estimated yfit values.
According to Matlab literature I have to use predict function as: [ypred,ysd,yint] = predict(GPRnewOOS,x_test)
but when I do that I get an error (see attached screenshot). What am I doing wrong?
0 件のコメント
採用された回答
Cathy Chen
2021 年 8 月 10 日
%% test model
[pred,~,ci] = M5_5.predictFcn(ValiD);
plot(pred,'color','m','DisplayName','Prediction');
hold on
plot(Capa40,'color','k','DisplayName','Real');
hold on
plot(ci(:,1),'c--','DisplayName','Lower 95% Limit');
hold on
plot(ci(:,2),'blue--','DisplayName','Lower 95% Limit');
legend;
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/707807/image.png)
1 件のコメント
MAYANK DHYANI
2021 年 8 月 26 日
Thank you @Cathy Chen! I had been struggling to use the trained model to generate the confidence interval until I came across your code.
その他の回答 (1 件)
Karun Mathiazhagan
2019 年 5 月 26 日
Hello Vahe,
The "predict" method which you are trying to use belongs to the "RegressionGP" object stored within the structure that is exported from the Regression Learner app and not the structure itself. Please feel free to use "predict" on this object, once you have extracted it from the structure which is exported from the app. To do this, you should be able to use the command "GPRnewOOS.RegressionGP". This would store the resultant "RegressionGP" object in "ans".
I hope this helps.
Best,
Karun
参考
カテゴリ
Help Center および File Exchange で Gaussian Process Regression についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!