Quarto enables you to weave together content and executable code into a finished document. To learn more about Quarto see https://quarto.org.
Running Code
The value of beta does affect how quickly the asymptotic coverage approaches to the 95% CI. This shows that having a nonlinear transformation estimator can quickly kick in the asymptotic coverage.
library(tidyverse)
Warning: package 'tidyverse' was built under R version 4.4.3
Warning: package 'ggplot2' was built under R version 4.4.3
Warning: package 'tidyr' was built under R version 4.4.3
Warning: package 'readr' was built under R version 4.4.3
Warning: package 'purrr' was built under R version 4.4.3
Warning: package 'dplyr' was built under R version 4.4.3
Warning: package 'stringr' was built under R version 4.4.3
Warning: package 'forcats' was built under R version 4.4.3
Warning: package 'lubridate' was built under R version 4.4.3
── 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 4.0.1 ✔ tibble 3.2.1
✔ lubridate 1.9.4 ✔ tidyr 1.3.1
✔ purrr 1.0.4
── 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: There were 60000 warnings in `mutate()`.
The first warning was:
ℹ In argument: `mle = map(sample, get.mle)`.
Caused by warning in `optimize()`:
! NA/Inf replaced by maximum positive value
ℹ Run `dplyr::last_dplyr_warnings()` to see the 59999 remaining warnings.
ggplot(many_mles, aes(x = alpha_hat)) +geom_histogram(bins =40, fill ="skyblue", color ="black") +facet_wrap(~n, scales ="free")+geom_vline(xintercept =4, linetype =2, color ="red")+coord_cartesian(xlim =c(0,15)) +theme_classic(base_size =14) +labs(title =expression(hat(alpha)), x ="MLE of alpha")
ggplot(many_mles, aes(x = beta_hat)) +geom_histogram(bins =40, fill ="orange", color ="black") +facet_wrap(~n, scales ="free") +geom_vline(xintercept =2, linetype =2, color ="red") +coord_cartesian(xlim =c(0, 5)) +theme_classic(base_size =14) +labs(title =expression(hat(theta)), x ="MLE of theta")
A.) When the large value for n is introduce, the distribution for that n value becomes symmetric and it being approximately normal. As for the small n value, the distriubution becomes stronger skewed and have a slower convergence. This shows that have a small p will make the asymptotic normality to fail.
B.) When looking at the coverage, as n increase coverage will approach near or at the 95% CI. Poor coverage exist when the p is near 0 or 1 and the n value is small. When the asymptotic normality fails like in part a, coverage will become more inaccurate.
C.) The parameter space for p is 0 and 1. This allows the MLE to hit its boundary making the asymptotic normality to break which allows r(p) to take on.