hypothesis Population sampling Functions Hypothesis structure
I I
:
Null
I
all ppl in a
group
status quo ↳
describes pop + b1 Sample In with-replacement) Table & Observed
parameter : . Hypothesis Test
.
,
2 stat stat
assume under this
1 .
we
sample : random selection of ~p . random Choice (arr , n , replace) Array
pop
.
reason other than
Alt :
chance
↳
Statistic : mer fromsamplaa sample-proportions (e model-proportions) ,
. Distribution of test
3 Stat 4 .
Conclusion
Alb Testing Table wh groups ald
I
=
P -
valve TVD distribution of
Table w/ prop Is the a variable
I
Prob that test stat under the cull : TV
2 +
categories X diff between 2
groups ? wo
is equal to or further in the direction
↳
If
group doesn't matter , shuffling
get dist of proportions & variable replacement shouldn't effect
of the alt than observed test stat
we a 1
. Identify 2 groups have an
np count nonzero (test
=
observed. + sp
sum (abs (array1-array2)/2 . Define
2 null alt and test stat 1 p count nonzero (test stats & obs-Stat)
p
= . . - stat = ,
↑ = . - -
#bs when direction don't matter (test-stat)
-
↑ en(test - stats) . Sim
3 under null len
Bootstrapping def bootstrap (tbi) : confidence interval
? make-array
stats =
will estimate we diff sample take CL % of bootstrap confidence-wider
webootstra a b
how much a more get
change
for i i n p. arange (10000 sample when ,
-hist will be centered
1. sample is data we have bootstrap-tbl = +bl .
Sample)
95 % confidence in the process bootstrap Brec means around mean of 0
sample
.
2 Treat sample as new pop and resample stat =
up mean (bootstrap- + bl Colume (0) once made it either contains or doesn't
Gog
.
POPSD
.
SP = samples
sample mean
stats = p Append (stats stat)
. ,
Pops
Width ?
#SD
+bl sample))'no argument x
15 %. CI =
sample mean [ 2SD
= same wh replace E
.
return stats sample mean
asneer
-
both sides
Chebysner Bounds CLT center Spread
what of data is within I'K'SD Prob dist of sumlary of large enough norm np mean (arr) If we don't know pop SD for a
std(arr)
.
up
skewedbytr
a .
binary approx 0 5
arg I KSD = 1 -
1/k regardless of pop dist , centered at pop mean var , we can .
Correlation
Standard Units Coeff (r) Regression Classification
snavent
categorical)
v =
np mean(Xsu
+
Ysu) predict y given x to
X -
np . mean(x)
.
classifier assigns a category new
xsy up.StdY don't extrapolate
far
s + d(x)
directiost based a the
=
np SU : data pat
·
.
m = y = rx on
-
Ier1 from
shows linear correlation
We use binary classifiers
categories (2
mean 0 Std 1 only mean(y) m
np mean(x)
=
= b =
1p
-
+ .
training set : fit model on past data
.
i
~ is unaffected by Switching Effect deviates less from aug
Regression :
y
no units" comparable ! axes or units >su
tanlaways equal to
test set evaluate on unseen a t
og or
k -
NN
Multiple Bayes Rule
btwnew pointand trainingpoints (x -
X , +
(y -
y ,
) Linear Regression
1
p sar + (sum) (feat-1-feat-2)
+ + 2)
pragivebP(BIA
.
.
data sortdistance
multiple components
. take
3 top k neighbors
y = ax) + bx + xx + d
+ b1 ·
piv of (col-names ,
now-names , values ,
func
compare overlapping values