Professional Documents
Culture Documents
In the lack of active imagination, parallel universes and the likes, we need an
alternative way of producing fake data set that resemble the parallel universes.
Bootstrapping is the practice of sampling from the observed data (X,Y) in estimating
statistical properties.
We first pick randomly a ball and replicate it. This is called sampling with
replacement. We move the replicated ball to another bucket.
Again
And again
Sample 1
Sample 2
Size N
Dataset Sample 3
Size N
CS109A, PROTOPAPAS, RADER, TANNER 15 15
Bootstrapping for Estimating Sampling Error
Definition
Bootstrapping is the practice of estimating properties of an estimator
by measuring those properties by, for example, sampling from the
observed data.
train
Model 1:
𝑠
Size N 1
Sample with replacement
^𝛽(𝑖)
𝜇 ^𝛽 = ∑
𝑠 𝑖=1
train
√
Model 2:
𝑠
1 ^ (𝑖 ) 2
𝜎 ^𝛽= ∑ ( 𝛽 − 𝛽 )
𝑠 𝑖=1
Dataset train
Model s:
We can empirically estimate the standard deviations which are called the
standard errors, through bootstrapping.
Alternatively:
If we know the variance of the noise , we can compute analytically using
the formulae below (no need to bootstrap):
√ 1 𝑥
2 Where is the number of
𝑆𝐸 ( ^
𝛽 0 )=𝜎 𝜖 + observations
𝑛 ∑ ( 𝑥𝑖− 𝑥)2
𝑖
𝜎𝜖
is the mean value of the
𝑆𝐸 (^
𝛽 1) = predictor.
√ ∑ 2
( 𝑥𝑖 − 𝑥 )
𝑖
CS109A, PROTOPAPAS, RADER, TANNER 18
Standard Errors
√
2
1 𝑥
More data: and 𝑆𝐸 ( ^
𝛽 0 ) =𝜎 𝜖 +
𝑛 ∑ ( 𝑥𝑖− 𝑥)2
Larger coverage: or 𝑖
𝜎 (𝜖 )
Better data: 𝑆𝐸 ( ^
𝛽 1) =
√ ∑ ( 𝑥
𝑖
𝑖 − 𝑥 )
2
√
^
( 𝑓 ( 𝑥 ) − 𝑦𝑖 )
2
Better model:
𝜎 ( 𝜖 )= ∑
𝑛−2
Question: What happens to the , under these scenarios?
In practice, we do not know the value of since we do not know the exact distribution of
the noise .
However, if we make the following assumptions,
• the errors and are uncorrelated, for ,
• each has a mean 0 and variance ,
then, we can empirically estimate , from the data and our regression line:
√ √
2
𝑛∙ 𝑀𝑆𝐸 ( ^𝑓 ( 𝑥 ) − 𝑦 𝑖 )
𝜎 𝜖=
𝑛− 2
=¿ ∑ 𝑛− 2
¿
95%
68%
𝑪 𝑰 ^𝜷 =( ^
𝜷− 𝟐 𝝈 ^𝜷 , ^
𝜷+𝟐 𝝈 ^𝜷 )