ma 416 - lecture 3

0.0(0)
Studied by 0 people
call kaiCall Kai
Locked
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/32

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 3:50 AM on 9/17/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

33 Terms

1
New cards

what is the motivating problem for Monte Carlo simulation?

standard statistics (Z, T, KS, CvM, AD) follow known distributions or have critical value tables

if you invent your own custom statistic, there is no table to look up critical values or p-values from

2
New cards

define monte carlo simulation

a technique where you…

numerically draw many random samples from the null distribution,

compute your test statistic on each simulated sample

and use the resulting collection of values to build an empirical approximation of the true distribution of that statistic

…allowing estimation of critical values and p-values with no closed-form formula

3
New cards

what is a monte carlo simulation in plain english?

instead of doing the math to derive the theoretical distribution of a weird statistic, simulate it thousands of times on a computer and look at the resulting histogram

4
New cards

What inputs does the toy ⋆_stat require?


Only the sample mean x̄ and the claimed population mean μ₀.


5
New cards

What is the "ideal" value of ⋆_stat if H₀ is exactly true, and why?


4/3

If H₀ holds, x̄ ≈ μ₀, so the ratio ≈ 1, giving (1+3)/(1+2) = 4/3

6
New cards

Why is knowing the ideal value 4/3 not enough to make a decision?

you still need to know how far from 4/3 the statistic must fall before the difference is statistically rather than randomly different, which requires the distribution of  ⋆_stat

7
New cards

List the steps for conducting a Monte Carlo simulation, in order.


(1) Set a random seed.

(2) Create an empty vector for simulated statistics.

(3) Choose a large number of monte carlo simulations.

(4) Loop nmc times: draw a simulated sample from the null at the same n, compute the statistic, append it.

(5) Visualize with a histogram.


8
New cards

How do you choose nmc, and what is the tradeoff?


Arbitrarily large is the guiding principle (e.g. 100,000). More simulations give a smoother, more accurate approximation but take longer to run.


9
New cards

What must match between your simulated samples and your real data?


The sample size.

Example: mcS = rnorm(length(S), 21, 1.5) matches n, the claimed μ₀, and an assumed σ.


10
New cards

What does the histogram of simulated statistics show you?

What typical values of your statistic look like if H₀ really were true.


11
New cards

How do you extract critical values from a Monte Carlo simulation?

y taking quantiles (percentiles) of the vector of simulated statistic values.

12
New cards

For a two-sided test at level α, how is α split, and what is the R code?


 α/2 in each tail. starcrits = quantile(mcstarstats, c(alpha/2, 1-alpha/2))

13
New cards

Monte Carlo decision rule for a two-sided test?


If the observed statistic falls outside the critical range (below the lower or above the upper critical value), you have evidence to reject H₀.


14
New cards

Define a simple distribution test.


Testing against ONE fully specified distribution, with both the family and its exact parameters pinned down (e.g. N(μ = 21, σ = 1.5)).


15
New cards

Define a composite distribution test.


Testing against an entire FAMILY of distributions without caring about specific parameter values (e.g. "is this sample normal at all").


16
New cards

Which is generally easier to satisfy (fail to reject), simple or composite, and why?

Composite, because you only need to match any member of a whole family rather than one specific exact distribution.


17
New cards

Do t-tests, ANOVA, and least-squares regression require simple or composite normality?


Composite.

You do not need to nail down the exact mean/variance in advance, just confirm the data is normal enough in general.



18
New cards

In the composite CvM workflow, why and how is the sample standardized?


Because it is a composite test, sort the data then compute zS = (S − mean(S))/sd(S), placing it on a standard normal (mean 0, sd 1) scale for fair comparison.


19
New cards

Which tail holds the rejection region for CvM-type statistics, and why?


Entirely the RIGHT tail, because the statistic is built from squared differences so it can only be zero or positive. Large values indicate poor fit and small values indicate good fit, so there is no meaningful "too small" direction.



20
New cards

R code for a one-sided CvM critical value?


cvm_crit = quantile(mymccvm, 1-alpha), putting all of α in the single right tail.


21
New cards

CvM decision rule and the worked example result?


If CvM_stat > CvM_crit, reject H₀. Here 200.4893 > 0.1254684, so the HourlyWage sample does NOT come from a normal population.



22
New cards

Important caveat about normality tests

Different tests (KS, CvM, AD, or eyeballing a histogram) can disagree, and their relative accuracy depends on sample size and data structure. There is no single infallible test.


23
New cards

Historically, why did statisticians design statistics that follow known distributions?

Because known distributions (Z, T, χ², F) had usable tables, even when a better custom statistic (more power, more robustness, better at small n) might exist without any known distribution.

24
New cards

What constraint does Monte Carlo free you from?

The need for your test statistic to match a textbook distribution family.

It approximates the sampling distribution for any statistic you can dream up.

25
New cards

What does qnorm(A, lower.tail=FALSE) return?


The critical value with area A in the RIGHT tail.


26
New cards

What does qnorm(A, lower.tail=TRUE) return?


The critical value with area A in the LEFT tail.

27
New cards

What does pnorm(q, lower.tail=FALSE) return?


The area/probability ABOVE the value q (right tail).


28
New cards

 What does pnorm(q, lower.tail=TRUE) return?


The area/probability BELOW the value q (left tail).


29
New cards

What does rnorm(n, mu, sigma) do?


Generates a random sample of size n from a Normal(mu, sigma) population.


30
New cards

General q/p/r naming pattern in R?


q-functions give a critical value from a probability/area. p-functions give a probability/area from a value. r-functions generate random samples.


31
New cards

t-distribution R functions and parameter?

Back: qt(), pt(), rt(n, v), where v = degrees of freedom.


32
New cards

Chi-squared R functions and parameter?


qchisq(), pchisq(), rchisq(n, v), where v = degrees of freedom.


33
New cards

F-distribution R functions and parameters?


qf(), pf(), rf(n, v1, v2), where v1 = numerator df and v2 = denominator df.