• No results found

Module: Some Applications in Bootstrap-2

N/A
N/A
Protected

Academic year: 2023

Share "Module: Some Applications in Bootstrap-2"

Copied!
11
0
0

Loading.... (view fulltext now)

Full text

(1)

Subject: Statistics

Paper: Advanced Data Analysis

Module: Some Applications in Bootstrap-2

(2)

Development Team

Principal investigator: Prof. Bhaswati Ganguli,

Department of Statistics, University of Calcutta

Paper co-ordinator: Prof. Kalyan Das,

Department of Statistics, University of Calcutta

Content writer: Souvik Kumar Bandyopadhyay,

Indian Institute of Public Health, Hyderabad, Public Health Foundation of India

Content reviewer: Prof. Bhaswati Ganguli,

Department of Statistics, University of Calcutta

(3)

Objective

Objective

I

Bootstrap of mean

I

Bootstrap of median

(4)

Some Applications of Bootstrap

Recap

I

Bias for estimator θ ˆ 0f θ is b = E(ˆ θ − θ)

I

For a Univariate normal distribution

I The MLE ofσ2is Sn= Σni=1(Xi−X¯)2/n, whereX¯ is the sample mean

I Biasb=−σ2/n

I Bootstrap estimate of biasb isB where

B=E(θ−θ) =ˆ E(θ−Sn);θ= Σni=1(Xi−X¯)2/n

I The monte carlo approximation toB isBM onte= ΣBj/N whereBjj−θˆandθj is the sample variance of thejth bootstrap sample

Ref: Bootstrap methods with application to R by Michael

R.Chernik and Robert A. LaBudde Chapter-2

(5)

Some Applications of Bootstrap

#Bootstrap methods with application to R by Michael R.Chernik

# and Robert A. LaBudde Chapter-2#

set.seed(5^13) #set random seed for reproduciblity n<- 25

x<- rnorm(n)

varx<- var(x)*(n-1)/n # sample variance, uncorrected

#sample variance and bias relative to true value of 1.0

# and expected value of bias c(varx, varx - 1.0, -1/sqrt(n))

## [1] 0.8665871 -0.1334129 -0.2000000

(6)

Some Applications of Bootstrap

B<- 5000 #number of bootstrap resamples

bvarx<- NULL #initialize resample variances vector for (i in 1:B) { #for each resample

xstar<- sample(x, n, replace=TRUE) #generate resample of size n from data bvarx[i]<- var(xstar)*(n-1)/n #resample variance, uncorrected

}

thetastar<- mean(bvarx) #estimate of variance

#resample variance estimate and bias estimate c(thetastar, thetastar - varx)

## [1] 0.82884859 -0.03773855

(7)

Some Applications of Bootstrap: Jackknife

require('bootstrap')

## Loading required package: bootstrap

theta<- function(x) var(x)*(n-1)/n #uncorrected variance jack<- jackknife(x, theta)

names(jack)

## [1] "jack.se" "jack.bias" "jack.values" "call"

jvarx<- mean(jack$jack.values) jvarx

## [1] 0.8665871

(8)

Some Applications of Bootstrap: A problem

Bootstrap methods with application to R: Problem-1, Chapeter-2

Airline accidents: According to the U.S. National Transportation Safety Board, the number of airline accidents by year from 1983 to 2006 were 23, 16, 21, 24, 34, 30, 28, 24, 26, 18, 23, 23, 36, 37, 49, 50, 51, 56, 46, 41, 54, 30, 40, and 31. For the sample data, compute the mean and its standard error and the median.

Compute the same bootstrap estimates

(9)

Some Applications of Bootstrap: Solution

set.seed(1)

x<- c(23, 16, 21, 24, 34, 30, 28, 24, 26, 18, 23, 23, 36, 37, 49, 50, 51, 56, 46, 41, 54, 30, 40, 31)

n<- length(x) B<- 1000 xMean<- NULL xMed<- NULL xSEmean<- NULL xSEmed<- NULL

(10)

Some Applications of Bootstrap: Solution

for (i in 1:B) { #for each bootstrap resample xx<- sample(x, n, replace=TRUE) #resample

xMean[i]<- mean(xx) #keep track of mean estimates xMed[i]<- median(xx) #keep track of median estimates }

#show mean of data and calculated standard error c(mean(x), sd(x)/sqrt(n))

## [1] 33.791667 2.462751

#show mean estimate and standard error c(mean(xMean), sd(xMean))

## [1] 33.690417 2.472755

(11)

Some Applications of Bootstrap: Solution

median(x) #show median of data

## [1] 30.5

c(mean(xMed), sd(xMed)) #show median estimate and standard error

## [1] 31.421500 3.880741

median(xMed) #show median of medians

## [1] 30.5

References

Related documents

Department of Social Work (UGC Centre of Advanced Study), Faculty of Social Sciences, Jamia Millia Islamia (A Central University), New Delhi, India and School of Public

Unit 2: (1) DENTAL HYGIENE, ORAL PRQPHLAXIS, DENTAL HEALTH EDUCATION, COMMUNITY PUBLIC HEALTH DENTISTRY &amp; PREVENTIVE DENTISTRY:. Definition of Health and

Sanitation Technology from the Institute of Public Health &amp; Hygiene, New Delhi and registered by the AP Para

World Food Programme, UNICEF, Institute of Public Health Nutrition, Ministry of Health and Family Welfare.. Government of the People's Republic

Intel India said it had partnered IIIT Hyderabad, Public Health Foundation of India and the Telangana government to unveil a research centre to focus on leveraging

These are: (1) refusal to license by the patent holder to enter into a voluntary licensing agreement on the reasonable commercial terms offered by the applicant (2) Public

The World Health Organization de ned Health Education as “comprising of consciously constructed opportunities for learning, involving some form of communication designed to

I knew nothing about public health, so I learnt about it by getting involved with Harvard's School of Public Health; this took me to the Gates Foundation where I championed the