gram.m

来自「kde全称是kernel density estimation.基于核函数的概率」· M 代码 · 共 14 行

M
14
字号
function G = gram(p)%% Compute the Gram matrix of the kernel centers in p, under the distance metric determined%  by the kernel sizes of the points; G(i,j) = (p_i*p_j')/bw_i%pts = getPoints(p); N = getNpts(p); d = getDim(p);G = zeros(N);for i=1:N  dummy=pts(:,i:end)-repmat(pts(:,i),1,N-i+1);  G(i:N,i) =-0.5*sum(dummy.^2 ./ getBW(p,i:N).^2 + log(getBW(p,i:N).^2) ,1)';  G(i,i:N) =-0.5*sum(dummy.^2 ./ repmat(getBW(p,i).^2,[1,N-i+1]) + repmat(log(getBW(p,i).^2) ,[1,N-i+1]) ,1);endG = exp(G) ./ (2*pi)^(d/2);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?