资源简介
提供高斯过程模型回归的预测方法,可以很好地进行模型预测
代码片段和文件信息
classdef GPR
%GPR Summary of this class goes here
% gauss process regression
%methods that do not change obj
methods (Static)
function [ret] = CalMeanElem(x meanParas)
if nargin~=2 || size(x1)~=1 || size(meanParas1)~=2 || size(meanParas2)~=1
error(‘CalMeanElem paras error!‘);
end
dA = meanParas(11);
dB = meanParas(21);
ret = dA * norm(x) + dB;
end
function [ret] = CalCovElem(row1 row2 covParas)
if nargin~=3 || size(covParas1)~=3 || size(covParas2)~=1
error(‘CalCovElem paras error!‘);
end
dA = covParas(11);
dB = covParas(21);
mSub = row1 - row2;
dR2 = sum(mSub.^2);
dKernelRet = exp(- dR2 / (4 * dA^2 ));
ret = sqrt(pi) * dA * dB * dB * dKernelRet;
end
function [ret] = CreateMeanArr(data meanParas)
dataNum = size(data 1);
ret = zeros(dataNum1);
for ii=1:dataNum
ret(ii1) = GPR.CalMeanElem(data(ii:)meanParas);
end
end
function [ret] = CreateCovMat(m1 m2 covParas)
if size(m12)~=size(m22)
error(‘CreateCovMat paras error!‘);
end
num1 = size(m11);
num2 = size(m21);
ret = zeros(num1 num2);
for ii=1:num1
rowi = m1(ii:);
for jj=1:num2
rowj = m2(jj:);
ret(iijj) = GPR.CalCovElem(rowi rowj covParas);
end
end
end
function [ret] = MeanLinearDfA(data meanParas)
dataNum = size(data1);
ret = zeros(dataNum 1);
for ii=1:dataNum
ret(ii1) = norm(data(ii:));
end
end
function [ret] = MeanLinearDfB(data meanParas)
dataNum = size(data1);
ret = ones(dataNum 1);
end
function [ret] = CovSeDfL(data covParas)
dataNum = size(data1);
ret = zeros(dataNum dataNum);
l = covParas(11);
sdFun = covParas(21);
l2 = l * l;
sdFun2 = sdFun * sdFun;
sqrtPi = sqrt(pi);
diffSquareSum = 0;
expTerm = 0;
for ii=1:dataNum
rowi = data(ii:);
for jj=1:dataNum
rowj = data(jj:);
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 20312 2018-06-22 08:39 GPR.m
- 上一篇:卡尔曼滤波视觉跟踪源代码及效果视频
- 下一篇:双目立体视觉匹配程序
评论
共有 条评论