makeentropyintervals.m
来自「一些偏最小二乘法(PLS)间隔偏最小二乘(siPLS)联合区间偏最小二乘等的建模」· M 代码 · 共 34 行
M
34 行
function EntropyInt=makeEntropyIntervals(X,intervals)
% makeEntropyIntervals gives indices for entropy intervals based on std (Ralf Torgrip)
%
% Input:
% X is the independent variables
% intervals: the number of intervals wanted, e.g. 20
%
% Output:
% EntropyInt is a double array containing interval information for direct use with ipls
%
% Copyright, Chemometrics Group - KVL, Copenhagen, Denmark
% Lars N鴕gaard, March 2004
%
% EntropyInt=makeEntropyIntervals(X,intervals);
if nargin==0
disp(' ')
disp(' EntropyInt=makeEntropyIntervals(X,intervals);')
disp(' ')
return
end
deviations=std(X);
splitpoint=sum(deviations)/(intervals);
sumdev=cumsum(deviations);
EntropyInt=[];
for i=1:intervals
ix=find((i-1)*splitpoint<=sumdev & sumdev<=i*splitpoint);
EntropyInt=[EntropyInt ix(1) ix(end)];
end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?