How can I use bootstrapping with different sized data sets?

조회 수: 1 (최근 30일)
Laurence hutton-smith
Laurence hutton-smith 2016년 1월 27일
댓글: jgg 2016년 1월 27일
I wish to use MATLAB's bootstrapping functionality, however my data sets are of different sizes. See the code below as an example of what I would like to be able to do:
function [ci,bootstat] = bootstrap_test ()
clc
clear
close all
% simulate data
y = normrnd(0,1,100,1);
z = normrnd(100,2,200,1);
% run bootci
[ci,bootstat] = bootci(5, @calc_mu_sigma, y, z);
%%func
function [ output ] = calc_mu_sigma( a, b )
% calculate output and assign
mu_1 = mean(a);
sigma_1 = std(a);
mu_2 = mean(b);
sigma_2 = std(b);
output = [ mu_1, sigma_1, mu_2, sigma_2 ];
end
end
I understand this is not possible using this function, however is there an alternative method that I could implement? In my actual script both data sets are required to be present within the bootstrapping function, obviously this is not the case in this code.
  댓글 수: 1
jgg
jgg 2016년 1월 27일
Why, exactly, are you trying to bootstrap two datasets at once? That seems very odd. It also seems to be the root of your problem, rather than the fact they have different sample sizes. The bootstrap procedure is designed to creature CI for your data; it cannot possibly come up with correct CI for datasets of different sizes being drawn together, since the empirical likelihood of sampling a given value for either is quite different.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Resampling Techniques에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by