Hi @Andreas ,
After going through fitgrp function provided in the link below,
https://www.mathworks.com/help/stats/fitrgp.html
It provides a variety of options for fitting GPR models, including different fitting methods, kernel functions, and prediction techniques. However, it lacks a built-in mechanism for specifying observation weights. However, I am going to suggest workarounds and alternative approaches such as
Custom Loss Functions: One potential workaround involves modifying the loss function used during training to account for weights manually. By creating a custom loss function that integrates observational weights, you can influence how the GPR model learns from the data. This would require more advanced programming and understanding of both GPR and optimization techniques.
Weighted Least Squares: If your primary goal is to implement weights during model fitting, consider using weighted least squares (WLS) as an alternative approach. While this does not provide the full probabilistic framework of GPR, it can still yield effective results in certain contexts.
Using Cross-Validation: Although fitrgp does not support weights directly, you can conduct cross-validation with stratified sampling based on your observational importance. This won't adjust weights but could improve model robustness by ensuring that important observations are represented across folds.
Ensemble Methods: If observational weighting is critical for your analysis, consider combining GPR with ensemble methods that support weighting natively. For instance, you could use ensemble techniques like bagging or boosting alongside GPR predictions to create a composite model that accounts for varying observation importance.
Feature Engineering: Another approach might involve creating derived features that encapsulate the importance of observations (e.g., through external metrics) and including these as additional predictors in your GPR model.
While these workarounds can provide solutions, they may not fully replicate the intuitive ease of using direct observational weights as seen in other models.
Hope this helps.
Please let me know if you have any further questions.