#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Voorbeeld van standaardafwijking: populatie (ddof=0) vs steekproef (ddof=1). Hoofdstuk: 41 — Spreiding schatten Vereist: numpy (pip install numpy) """ import numpy as np data = np.array([1.2, 1.5, 1.7, 1.6, 1.4]) pop = np.std(data, ddof=0) # populatie steek = np.std(data, ddof=1) # steekproef (Bessel-correctie) print("Data:", data) print("std (populatie, ddof=0):", pop) print("std (steekproef, ddof=1):", steek)