Skip to content

Commit 435a1c8

Browse files
queeliusclaude
andcommitted
Fix vignette prose to match computed results
- Fix sample size mismatch (n=90 → n=150) in likelihood-contributions - Fix typo "prticular" → "particular" - Fix all.equal display to return TRUE instead of name mismatch string - Add interpretive prose after bootstrap, score, and Fisherian sections - Add uncensored CIs for direct comparison with censored CIs Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent fc0093b commit 435a1c8

File tree

2 files changed

+24
-3
lines changed

2 files changed

+24
-3
lines changed

vignettes/getting-started.Rmd

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,9 @@ cat("\nScore stored in MLE object:\n")
207207
print(score_val(mle))
208208
```
209209

210+
The score values are very close to zero, confirming that the optimizer
211+
successfully found the MLE (a stationary point of the log-likelihood).
212+
210213
## Example 5: Fisherian Likelihood Inference
211214

212215
The package supports pure likelihood-based inference in the Fisherian tradition.
@@ -234,6 +237,10 @@ rl <- relative_likelihood(mle, c(1.5, 1.0), df, model)
234237
cat("Relative likelihood at (1.5, 1.0):", rl, "\n")
235238
```
236239

240+
Negative support and a very small relative likelihood indicate that the
241+
alternative parameter values $(1.5, 1.0)$ are poorly supported by the data
242+
compared to the MLE.
243+
237244
### Likelihood Intervals
238245

239246
```{r likelihood-intervals}
@@ -313,7 +320,7 @@ ll_generic <- loglik(model_generic)(df_exp_name, unname(lambda_hat))
313320
314321
cat("Analytical loglik:", ll_analytical, "\n")
315322
cat("Generic loglik: ", ll_generic, "\n")
316-
cat("Match:", all.equal(unname(ll_analytical), ll_generic), "\n")
323+
cat("Match:", isTRUE(all.equal(unname(ll_analytical), ll_generic, tolerance = 1e-6)), "\n")
317324
```
318325

319326
## Summary of Key Functions

vignettes/likelihood-contributions.Rmd

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ for all $i,j$ are independent. The system lifetime is the minimum of the
4545
component lifetimes, i.e., $T_i = \min\{T_{i 1}, \ldots, T_{i m}\}$.
4646

4747
Let's draw a sample for this model for $m=3$ and $\lambda = (1.1, 1.2, 1.3)$
48-
for a sample size of $n=90$.
48+
for a sample size of $n=150$.
4949
```{r data-gen-exp-series}
5050
n <- 150
5151
rates <- c(1.1, 1.2, 1.3)
@@ -257,11 +257,16 @@ cat("\nBootstrap covariance:\n")
257257
print(vcov(boot_result))
258258
```
259259

260+
The bootstrap standard errors should be close to the asymptotic standard errors
261+
from the Fisher information matrix, and the bootstrap bias estimates should be
262+
negligible (all under 0.01), confirming that the MLE is nearly unbiased for
263+
this sample size.
264+
260265
## Case 2: Right-censoring
261266
We add right-censoring to the model. We assume that the right-censoring times
262267
are independent of the component lifetimes and the candidate sets.
263268

264-
In prticular, we consider the data described earlier, but with right-censoring
269+
In particular, we consider the data described earlier, but with right-censoring
265270
at time $\tau = 0.5$. The presence of this right-censoring means that we know
266271
the event occurred after time $\tau$ for these censored observations, but we do
267272
not know exactly when (and it may still be ongoing).
@@ -341,6 +346,9 @@ cat("\nCensored estimates:\n")
341346
cat(" Estimates:", coef(mle.censored), "\n")
342347
cat(" Std errors:", se(mle.censored), "\n")
343348
349+
cat("\n95% Confidence Intervals (uncensored):\n")
350+
print(confint(rates.hat))
351+
344352
cat("\n95% Confidence Intervals (censored):\n")
345353
print(confint(mle.censored))
346354
@@ -367,6 +375,12 @@ cat("\n1/8 likelihood interval for lambda_1:\n")
367375
print(li)
368376
```
369377

378+
The evidence value near 0 means the MLE and true parameters are about equally
379+
well-supported by the data, which is expected when the MLE is close to the
380+
truth. The $1/8$ likelihood interval for $\lambda_1$ provides a plausible
381+
range for the parameter without making probability statements --- it contains
382+
all parameter values whose likelihood is at least $1/8$ of the maximum.
383+
370384
## Case 3: Single-parameter model (exponential rate)
371385

372386
The `likelihood_contr_model` also works well with single-parameter models.

0 commit comments

Comments
 (0)