⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 resample.m

📁 Non-parametric density estimation
💻 M
字号:
function p2 = resample(p,Np,ksType)%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% resample(p,Np,KSType) -- construct a new estimate of the KDE p by sampling%                      Np new points; determines a bandwidth by ksize(pNew,KSType)%                      NOTE: KStype = 'discrete' resamples points by weight &%                            preserves original kernel size% see also: kde, ksize%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Copyright (C) 2003 Alexander Ihler; distributable under GPL -- see README.txt  if (nargin < 3) ksType = 'rot'; end;  if (nargin < 2) Np = getNpts(p); end;  if (strcmp(ksType,'discrete'))    q = kde(getPoints(p),zeros(getDim(p),1),getWeights(p));     [samplePts,ind] = sample(q,Np);    if (size(p.bandwidth,2)>2*p.N), ks = getBW(p,ind);    else ks = getBW(p,1); end;    p2 = kde(samplePts,ks);  else    samplePts = sample(p,Np);    p2 = kde(samplePts,ksType);  end;

⌨️ 快捷键说明

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