📄 rboot.m
字号:
function z = rboot(x,B)%RBOOT Simulate a bootstrap resample from a sample.%% Z = rboot(X)%% Give a resample of the same size as X, which is assumed% to have one independent realisation in every row.% RESAMPLE(X,B) gives B columns of resamples. This form works% only for X one-dimensional, ie X column vector.% Anders Holtsberg, 14-12-94% Copyright (c) Anders Holtsbergif min(size(x)) == 1 x = x(:);endif nargin > 1 & size(x,2) > 1 if B > 1, error('X multidimensional and B > 2'), endelseif nargin < 2 B = 1;endn = size(x,1);nn = n*B;I = ceil(n*rand(nn,1));if B > 1 z = zeros(n,B); z(:) = x(I);else z = x(I,:);end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -