Calculation of Schur complement returns matrix which is not positive semidefinite

9 次查看(过去 30 天)
I'm trying to implement some basic Gaussian process regression. I know Matlab has functions that do this but I want to do a bit by hand so I feel more comfortable with the methods.
I'm using the following code to calculate the Schur complement to generate a covariance matrix for the data conditioned on the observations yObserv.
A = K(1:end-nObserv,1:end-nObserv);
B = K(1:end-nObserv,end-(nObserv-1):end);
C = K(end-(nObserv-1):end,end-(nObserv-1):end);
KSchur = A - B*(C\B');
mu = B*(C\(yObserv'));
Unfortunately, in some cases this expression returns a matrix which is not positive semidefinite, apparently due to numerical factors. The alternate strategy:
KSchur = A - B*inv(C)*B';
Has the same problem. I'm not experienced with such issues, so I'm hoping someone can suggest a way to formulate this operation to avoid the problem. Any suggestions?

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Mathematics and Optimization 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by