- Train your Gaussian Process Regression model using the “fitrgp” function
- Obtain predictions and prediction intervals using the “predict” function
- To calculate PICP:
- Define the lower and upper bounds of the prediction interval, such as yLower and yUpper, based on the prediction intervals obtained in the previous step.
- Calculate the number of observations within the prediction interval: numObservations = sum(yLower <= YTest & YTest <= yUpper).
- Calculate the PICP as the ratio of the number of observations within the prediction interval to the total number of observations: PICP = numObservations / numel(YTest)
- Calculate the width of each prediction interval: intervalWidths = yUpper - yLower
- Calculate the mean prediction interval width: MPIW = mean(intervalWidths)
- https://www.mathworks.com/help/stats/fitrgp.html
- https://www.mathworks.com/help/stats/compactregressiongp.predict.html