how to create equation from gaussian trained model from regression learner?
5 views (last 30 days)
Show older comments
But, then it give me larger error while I'm creating equation from this. As I have a different flow chart of equation. Is it possible to make equation using regression learner. I'm creating model gaussian regression matern 5/2 GPR. How can I get the equation from the this trained model. I'm selecting pressure, temperature, humidity as input and trying to get some output. The y estimated values from the trainedmodel is fitting good. But, Now I want to make equation from this model and how can I make that?
I'm also attaching the input trained data file and test data file.
I want to find coefficient for gaussian equation.
Is there any code or function to calculated the gaussian coefficients?
Answers (1)
Saarthak Gupta
on 7 Dec 2023
Edited: Saarthak Gupta
on 15 Dec 2023
Hi Nilanshu,
Looks like you are trying to obtain a closed-form expression for the Gaussian Process Regression model trained on your dataset.
Unlike other regression models such as Linear and Nonlinear, Gaussian process regression (GPR) models are nonparametric kernel-based probabilistic models. In GPR models, an instance of the response y can be modelled as:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1562624/image.png)
where f(x)~GP(0,k(x,x′)), that is f(x) are from a zero mean GP with covariance function, k(x,x′). h(x) are a set of basis functions that transform the original feature vector x in Rd into a new feature vector h(x) in Rp. β is a p-by-1 vector of basis function coefficients.
Note: The ’fitrgp’ function is used to fit a GPR model. The function estimates the covariance function, noise variance and the coefficient vector of fixed-basis functions. These properties can be accessed from the ‘RegressionGP’ object which is returned by the function.
Since the model is probabilistic, the response cannot be captured in a closed form expression. Instead, we give the probability density of a response
at a new point
, given y, X (training data) as:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1569952/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1569957/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1562639/image.png)
The expected value of ynew can then be given as:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1562644/image.png)
However, it is recommended that you use the built-in routines for prediction.
Please refer to the following MATLAB documentation for further reference:
- Gaussian Process Regression Models: https://www.mathworks.com/help/stats/gaussian-process-regression-models.html
- Exact GPR Method: https://www.mathworks.com/help/stats/exact-gpr-method.html
- RegressionGP: https://www.mathworks.com/help/stats/regressiongp.html
- fitrgp: https://www.mathworks.com/help/stats/fitrgp.html
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!