필터 지우기
필터 지우기

How to estimate 95% confidence band on GPR model prediction

조회 수: 12 (최근 30일)
Vahe Ghazikhanian
Vahe Ghazikhanian 2019년 5월 23일
댓글: MAYANK DHYANI 2021년 8월 26일
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?

채택된 답변

Cathy Chen
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;
  댓글 수: 1
MAYANK DHYANI
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
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
  댓글 수: 1
Vahe Ghazikhanian
Vahe Ghazikhanian 2019년 5월 29일
Hello Karun, I tried your suggestion by typing:
>> [y_IS,yci_IS] = predict(GPRnewOOS.RegressionGP,xx_IN);
and got the error:
screenshot.jpg
The xx_IN is a matrix of 711 x 398 [711 variables each measured 398 times], and the model was created with the Regression learner app with the same number of input variable (e.g., 711 x 1376).
The only thing I can think of with 5 component is the fact that I had the PCA feature selection set to 5, and that is reflected in the model structure which shows there are "PCACcoefficients 711x5".
It seems that the "predict" function requires PCA to be applied to the input matrix before it can be evaluated?
Do you know if one can do this another way? A simple code might be helpful.

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

Community Treasure Hunt

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

Start Hunting!

Translated by