covar.m

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

M
22
字号
function cov = covar(dens,noBiasFlag)%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% covar(dens [,noBiasFlag]) --  returns the variance of a given KDE%%  if noBiasFlag = 1, this is the variance of the kernel locations themselves%  Otherwise, it is the covariance of the density estimate (ie smoothed by the BW).%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Copyright (C) 2003 Alexander Ihler; distributable under GPL -- see README.txtif (nargin < 2) noBiasFlag = 0; end;if (noBiasFlag)  cov = var(getPoints(dens)',getWeights(dens)')';else  switch(dens.type),    case 0, cov = dens.bandwidth(:,1);          % Gaussian: store variances.    case 1, cov = .2 * dens.bandwidth(:,1).^2;  % Epanetch BW -> variance    case 2, cov = 2 * dens.bandwidth(:,1).^2;   % Laplacian BW -> variance  end;end;

⌨️ 快捷键说明

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