Model Belirsizliği ve Örneklem Dağılımları

Python ile Doğrusal Modellemenin Temelleri

Jason Vestuto

Data Scientist

Evrensel Kitle Yok

Gün sayısı ile sıcaklık aralıkları histogramı, Ağustosta günlük en yüksek sıcaklıklar

Python ile Doğrusal Modellemenin Temelleri

Evrensel Kitle Modeli Olarak Örneklem

2 histogram: biri örneklem, biri evrensel kitle için; her ikisinde de normalize edilmiş gün sayısı vs. sıcaklık aralıkları; örneklem çubukları, evrensel kitle çubuklarıyla neredeyse aynı yükseklikte

Python ile Doğrusal Modellemenin Temelleri

Örneklem İstatistiği

Tek bir örneklemin histogramı, gün sayısı vs. sıcaklık aralıkları

Python ile Doğrusal Modellemenin Temelleri

Bootstrap Yeniden Örnekleme

3 histogramın grafiği: üç örneklemin her biri için birer tane; merkezleri birbirinden kaymış; eksenler gün sayısı ve sıcaklık aralıkları

Python ile Doğrusal Modellemenin Temelleri

Yeniden Örnekleme Dağılımı

Ortalamalar histogramı, eksenler örneklem sayısı ve ortalama sıcaklık aralıkları

Python ile Doğrusal Modellemenin Temelleri

Kodla Bootstrap

# Use sample as model for population
population_model = august_daily_highs_for_2017
# Simulate repeated data acquisitions by resampling the "model"
for nr in range(num_resamples):
    bootstrap_sample = np.random.choice(population_model, size=resample_size, replace=True)
    bootstrap_means[nr] = np.mean(bootstrap_sample)
# Compute the mean of the bootstrap resample distribution
estimate_temperature = np.mean(bootstrap_means)
# Compute standard deviation of the bootstrap resample distribution
estimate_uncertainty = np.std(bootstrap_means)
Python ile Doğrusal Modellemenin Temelleri

Yinelemeli Seçim

# Define the sample of notes
sample = ['A', 'B', 'C', 'D', 'E', 'F', 'G']
# Replace = True, repeats are allowed
bootstrap_sample = np.random.choice(sample, size=4, replace=True)
print(bootstrap_sample)
C C F G
Python ile Doğrusal Modellemenin Temelleri

Yinelemeli Seçim

# Replace = False
bootstrap_sample = np.random.choice(sample, size=4, replace=False)
print(bootstrap_sample)
C G A F
# Replace = True, more lengths are allowed
bootstrap_sample = np.random.choice(sample, size=16, replace=True)
print(bootstrap_sample)
C C F G C G A E F D G B B A E C
Python ile Doğrusal Modellemenin Temelleri

Hadi pratik yapalım!

Python ile Doğrusal Modellemenin Temelleri

Preparing Video For Download...