5 - For a grid of n∈{4,8,15} and σ∈{1,2,3}, verify that ((n-1) S2)/σ2 ∼χ_(n-1)^2 by simulating 10,000 realizations of this statistic for each parameter combination in the grid and plotting the simulated densities superimposed with the analytic densities. Additionally, use these simulation results to create a table of the simulated mean and variance of S^2 compared to their analytic counterparts, to verify that your computations from 4B are correct.
library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr 1.1.4 ✔ readr 2.1.5
✔ forcats 1.0.0 ✔ stringr 1.5.1
✔ ggplot2 3.5.2 ✔ tibble 3.3.0
✔ lubridate 1.9.4 ✔ tidyr 1.3.1
✔ purrr 1.1.0
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag() masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(purrrfect)
Attaching package: 'purrrfect'
The following objects are masked from 'package:base':
replicate, tabulate
Warning: Returning more (or less) than 1 row per `summarise()` group was deprecated in
dplyr 1.1.0.
ℹ Please use `reframe()` instead.
ℹ When switching from `summarise()` to `reframe()`, remember that `reframe()`
always returns an ungrouped data frame and adjust accordingly.
`summarise()` has grouped output by 'n', 'sigma'. You can override using the
`.groups` argument.
6 - Pick a single-parameter parent population (exponential, Poisson, Bernoulli, geometric). Simulate 1,000 replications across a parameter grid involving n∈{10,20,30} and the parameter of that population. Create scatterplots of S^2 vs Y ̅ for each combination in your grid. Verify that for these non-normal parent populations that S^2 and Y ̅ are not independent.