Gaussian process regression - how to fit a basis function but not other parameters

16 ビュー (過去 30 日間)
Bill Tubbs
Bill Tubbs 2023 年 2 月 23 日
コメント済み: Vitek Stepien 2023 年 9 月 6 日
I'm doing Gaussian process regression with the fitrgp function and want to manually control some parameters such as the kernel parameters and the noise parameter, but automatically fit a basis function (e.g. 'linear').
However, it seems that to fit a basis function the FitMethod parameter cannot be 'none':
1. Manual parameter settings (no parameter fitting) but no basis function
gpr_model = fitrgp(x_d, y_d, ...
'KernelParameters', [1.5; 1], ...
'Sigma', 0.1, ...
'FitMethod', 'none' ...
);
plot showing GP model predictions compared to true values
2. To fit the basis function I can't have FitMethod set to 'none' ('exact' is the default) but then it ignores my parameter values:
gpr_model = fitrgp(x_d, y_d, ...
'KernelParameters', [1.5; 1], ...
'Sigma', 0.1, ...
'BasisFunction', 'linear' ...
);
plot showing GP model predictions compared to true values
3. If I set FitMethod to none, it ignores the basis function:
gpr_model = fitrgp(x_d, y_d, ...
'KernelParameters', [1.5; 1], ...
'Sigma', 0.1, ...
'BasisFunction', 'linear', ...
'FitMethod', 'none' ...
);
plot showing GP model predictions compared to true values
(same a Fig. 1).
Is there a way to fit a basis function but not the other parameters?
  3 件のコメント
mono
mono 2023 年 9 月 5 日
Facing a similar problem to perform optimizations of a gaussian process with one specific paramater fixed...
Bill Tubbs
Bill Tubbs 2023 年 9 月 5 日
Let me know if you find a solution!

サインインしてコメントする。

回答 (2 件)

Vitek Stepien
Vitek Stepien 2023 年 9 月 5 日
If I understand correctly, you're trying to programatically figure out whoch fitting function would work best for the data given? If so, then the short answer is no, there isn't a good way - I tried doing that in a much more complex setting and there is no automatic way of trying different functions. The workaround would be to write a script that fits a number of functions to the data (I presume you have a few specific functions that you wnat to check), and check which fit has the best "goodness", for example using SSE as the quantifier. Then the script would return the fucntion with best fit (lowest SSE) and you can go from there. Let me know if that helped!
  3 件のコメント
mono
mono 2023 年 9 月 6 日
If I understood the question correctly, @Bill Tubbs and myself are trying to perform parameters optimizations but with one or several specific paramaeters fixed.
E.g. with initial theta as theta0 = [1, 2], now only want to optimizae theta0[1] but with theta0[2] = 2 fixed without optimization.
Vitek Stepien
Vitek Stepien 2023 年 9 月 6 日
I see, it looked similar to a problem I had but I guess I don't know how to help in your case. Sorry and good luck finding the answer!

サインインしてコメントする。


Alan Weiss
Alan Weiss 2023 年 9 月 5 日
I might misunderstand what you are trying to do, but perhaps you could use the OptimizeHyperparameters name-value argument to find the parameter you are trying to optimize. I am not sure that this can give you what you want, because I don't really understand what you are doing, but you can check whether the argument might be applicable.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation

カテゴリ

Help Center および File ExchangeGaussian Process Regression についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by