estim_psi.m
来自「对MATLAB的函数进行的一个补充添加,你只要在MATLAB里面添加下就能使用了」· M 代码 · 共 30 行
M
30 行
% SCORE FUNCTION ESTIMATION BY THE GAUSSIAN KERNEL DENSITY ESTIMATOR%-------------------------------------------------------------------------------% sigma = variance of the Gaussian Kernel density estimator % x = imput (by rows)% y = output (by rows)%-------------------------------------------------------------------------------
% Grenoble, December 2000
% This work has been partly funded by the European project BLIS (IST-1999-14190)
function y=estim_psi(x,sigma)% initialisations[nl,nc]=size(x);y=zeros(nl,nc);y=y';x=x';for i=1:nl M=x(:,i)*ones(1,nc); M=M-M'; K=exp(-(M.^2)/(2*sigma^2)); % density estimator DK=-M.*K/sigma^2; % density derivative estimator y(:,i)=sum(DK,2)./sum(K,2); % score function estimationend;y=y';
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?