In the SIR model, count susceptible, infectious, and recovered immune individuals. The closed population has . Under homogeneous mixing, use the paper's mass-action infection convention: each susceptible has infection hazard function , so the population infection rate is . Each infectious individual recovers with hazard function , giving population recovery rate and mean infectious duration .
Figure 1.
SIR compartment transitions with infection flow beta S I and recovery flow gamma I
. Details.
The arrows are one-way: recovered individuals are immune, and there are no demographic entries or exits. The transition intensities attached to the arrows are population flow rates, rather than individual hazard functions.
Let be the false positive rate for a genuinely cancer-free person, encompassing the harmless-tumour misclassification, and assume screening errors are conditionally independent given the latent states. A pre-clinical case tests positive with probability one; a clinical case is separately recognized. Thus a negative screen identifies latent state , whereas a positive pre-clinical screen can arise from state or . This is a Hidden Markov model with a screening misclassification model.
Conditional on the negative baseline screen, the state at year is . The negative screen at year requires staying in state for two years and then testing negative. From that state, the positive screen at year can arise either with probability while still disease-free or through pre-clinical disease. Consequently the conditional likelihood is
If the study instead specifies an initially disease-free patient and includes the baseline screening result in the likelihood function, its probability contributes a further factor , giving
The formulas use the positive emission for a pre-clinical screen, with no clinical diagnosis in this record. A persistent harmless-tumour subtype producing correlated screening errors would need an additional latent-state or emission specification; its likelihood is not determined by the single parameter .
Age changes during follow-up, so the generator matrix changes with time. The transition matrix must solve , with . It is generally not the matrix exponential of one constant matrix; even is not generally valid because the matrices at different times need not commute.
For example, write the age-dependent onset rate as and keep progression rate constant. Then
Even when the integrated onset rate is elementary, this remaining integral need not have an elementary closed form. Special cases can have closed forms; time dependence does not by itself prove universal impossibility.
For a tractable likelihood function, freeze age at its left-endpoint value, or a midpoint value, on each observation interval . The genetic covariate is already constant. This piecewise-constant covariate approximation gives a constant matrix on each interval and a product of closed-form interval probabilities:
Here is the observed state at , and the likelihood function is conditional on the initial state. The approximation improves when intervals are short relative to the variation in the age effect.
Let be age in years at follow-up time and let indicate the genetic risk factor. An age-dependent log-linear transition intensity model is
Here is the onset baseline hazard for a 50-year-old without the factor; is the genetic hazard ratio, and is the hazard ratio per additional year of age. A smooth function of age could replace the linear age term if a constant age hazard ratio were unsuitable.
Under the stated constant multiplicative hazard ratios, the requested extrapolation is therefore the baseline rate times both multipliers:
Assume the 1000 individuals are initially disease-free. The event being counted is onset during the ten-year period, not occupancy of the pre-clinical state at its end. Using the estimated transition intensity as a constant onset rate and linearity of expectation, the expected number of onsets is
The first-order approximation is close, but does not account for depletion of the disease-free group.
Starting in state , the onset waiting time has the exponential distribution of rate . Thus the probability of onset before the next screen is . This counts individuals who have already progressed to clinical disease as well as those still pre-clinical.
Conditional on onset at time , the Markov property makes the remaining progression time exponential with rate . Thus the probability of clinical progression before the screen, conditional on that onset time, is .
Integrating over the onset density gives the unconditional clinical probability
The probability of being pre-clinical at the next screen is instead
Together with and the exponential distribution for a patient initially in state , the transition matrix is
This equals the matrix exponential . The assumed unequal intensities avoid a zero denominator; at the continuous limit is .
Use three states of a continuous-time Markov chain: disease-free , pre-clinical , and clinical . The transition intensities are for onset and for progression. Clinical disease is an absorbing state. The mandatory pre-clinical phase excludes a direct jump, and this untreated progression model has no reverse transitions.
Figure 1.
Irreversible cancer progression from disease-free to pre-clinical to clinical states
. Details.
With row-vector probabilities and state order , the generator matrix is
Its rows sum to zero, so only the two off-diagonal transition intensities are unknown. This is a continuous-time multi-state model with sequential irreversible progression.
Choose a group sequential design. Randomize patients among the three arms, schedule interim analyses after prespecified amounts of information, and calculate the two Wald test statistics at each look. Prespecify efficacy boundaries and a futility rule; allow early stopping of an ineffective experimental arm or of the trial when sufficiently convincing efficacy evidence is obtained. Calibrate the boundaries for both repeated looks and the two shared-control comparisons so that the familywise error rate remains controlled. An alpha-spending function is one way to allocate the error probability across looks.
Two potential benefits are lower expected recruitment and shorter duration when a treatment is clearly effective or futile, and earlier identification of benefit or lack of benefit, reducing continued exposure to an ineffective experimental treatment. These benefits concern expected performance; the maximum sample size may still be required.
Two drawbacks are the extra operational work needed for rapid, reliable outcomes and confidential interim analyses, and more complicated inference: repeated testing requires adjusted boundaries, and ordinary fixed-sample effect estimates and confidence intervals can be misleading after data-dependent stopping. Continuing two comparisons against a shared control also requires care if an arm is stopped.
Couple the Wald test statistics as , where the joint centered bivariate normal distribution of is fixed. Increasing either enlarges, pointwise in this coupling, the event . Its probability is consequently nondecreasing in each treatment effect.
If both null hypotheses hold, then , so this probability is maximal at the joint boundary . To check the familywise error rate across all configurations, suppose only hypothesis is true. A type I error then occurs only if , with probability at most , where is the standard normal distribution function. This is no larger than the any-rejection probability at , since that joint event contains . If neither null hypothesis is true, the familywise error rate is zero. Hence the least-favourable null configuration for type I error is
where is the centered bivariate normal distribution function with correlation coefficient .
Let denote the centered unit-variance bivariate normal distribution density,
The complement of rejecting either null hypothesis is . Therefore the probability of at least one rejection is
When both null hypotheses are true, this is the familywise error rate. If one null hypothesis is false, a rejection of that hypothesis is not a type I error, so the displayed probability is then an any-rejection probability rather than the familywise error rate.
Use the usual clinical trial sampling assumption that all patients' responses are independent, with fixed positive arm sizes and positive known variances. Marginal normal distributions alone would not specify the variance of a treatment contrast without this assumption. Put , , and . The sample mean contrast estimates and has standard error . Thus the one-sided Wald statistics are
Large positive values of these Wald test statistics provide evidence against the respective null hypotheses.
The generalized additive mixed model fits
where denotes the furnace random intercept and is a centered penalized cubic regression spline. Its wiggly components have a mixed-model representation; there is no explicit furnace-specific random slope in this formula.
The plotted smooth gives no evidence that a nonparametric fixed effect is needed. It is essentially a straight rising line, and s(stir,1) indicates effective degrees of freedom close to one. The wider bands at extreme stirring rates reflect uncertainty, not detected nonlinearity. A linear fixed stirring effect is adequate on this evidence.
If the three supplied Akaike information criterion values are on a common valid likelihood basis, choose strength_model3, the fixed linear slope plus random-intercept model: its AIC is smallest, versus for the additional random slope and for the smooth. The differences are and , respectively, so especially the random-slope comparison represents modest support rather than decisive evidence. Retaining the population slope is consistent with part (c); this choice removes only its random variation.
There is a likelihood-basis caveat in the literal printed commands. lmer fits by REML by default, whereas the Gaussian gamm call defaults to ML; direct AIC on these objects need not compare the same type of likelihood. Moreover the earlier ML ANOVA prints for strength_model, whereas this table prints , so these numbers should not silently be treated as one identical ML fit. To obtain a defensible common comparison, fit all candidates to the same observations by ML:
fit_slope <- update(strength_model, REML = FALSE)
fit_intercept <- update(strength_model3, REML = FALSE)
fit_smooth <- mgcv::gamm(strength ~ s(stir, bs = "cr"),
random = list(furnace = ~ 1), method = "ML")
AIC(fit_slope, fit_intercept, fit_smooth$lme)
The supplied ranking favours the simpler random-intercept model; the displayed original calls alone do not certify that ranking as a consistent ML comparison. This distinction is particularly relevant when the smooth changes the fixed-effect space. The Gaussian gamm ML default and mixed-model representation are documented at stat.ethz.ch/R-manual/R-devel/library/mgcv/html/gamm.html.
The comparison removes the random slope and tests against , while retaining the same fixed intercept and slope. A variance cannot be negative, so zero is a boundary point of the parameter space. The regular Wilks theorem assumptions behind an ordinary likelihood-ratio test fail. Consequently the default chi-squared p-value from anova is not reliably calibrated for this variance-component likelihood-ratio test at a boundary. This is different from the fixed-slope test in part (c). The reference to strength_model1 means the earlier object strength_model; no separate model 1 object was defined.
A useful alternative is a parametric bootstrap. Fit the null random-intercept model, then simulate data on the actual predictor values and furnace grouping by generating null intercept effects and observation errors from its fitted Gaussian distribution. Refit null and alternative models to each simulated dataset using the same likelihood method and compute the same likelihood-ratio statistic. If is the observed statistic, estimate its upper-tail probability by
This incorporates the zero-variance boundary and the actual small group count. It is a fitted-null simulation approximation because nuisance parameters are estimated, not a universally exact test. Since both models have the same fixed-effect space, a similarly calibrated restricted-likelihood statistic is also possible. Under suitable asymptotics for a single identifiable added variance component the familiar limiting law is , but using the bootstrap avoids relying on that approximation with only three groups. There is no supplied statistic or calibrated bootstrap result here from which to decide whether the slope variance is required.
The restricted maximum likelihood procedure estimates covariance parameters from error contrasts that remove the unknown fixed effects. Let have rank and choose an full-rank matrix with . Then has a likelihood involving the variance parameters but not . Maximizing that likelihood is restricted maximum likelihood. An equivalent restricted likelihood from orthogonal error contrasts, up to terms independent of , is
where
After estimating , use generalized least squares for and the conditional modes from part (b). In an independent-error normal linear model, this covariance procedure reduces to estimating by instead of .
The two models being compared have different fixed-effect spaces, so their error contrasts, dimensions, and restricted likelihoods differ. Their REML values are not likelihoods of the same transformed data and must not be used directly for this fixed-effect likelihood-ratio test. Refit both with ordinary maximum likelihood, integrating out the random effects but retaining the original response vector, and maximize each model's marginal likelihood.
The null hypothesis is , leaving the random slope variance free; the alternative permits a nonzero population stirring effect. The supplied test has , one extra fixed coefficient, and approximate p-value . Retain the fixed stirring-rate effect at 5%. A mean-zero random slope cannot substitute for an estimated nonzero population slope. The asymptotic calibration assumes regular nuisance covariance parameters and should be interpreted cautiously with only three furnaces; simulation can provide a better finite-sample calibration.
For the Gaussian linear mixed model, temporarily regard as known, with here and . The joint multivariate normal distribution is
By the conditional multivariate normal distribution formula,
A nonsingular Gaussian density has its mode at its mean. Thus the conditional mode of Gaussian random effects equals the conditional expectation. Replacing the unknown parameters by fitted values gives
For positive-definite and , an equivalent derivation minimizes the negative conditional log density,
Differentiation yields
The inverse-covariance penalty shrinks furnace intercepts and slopes toward the population effects. For furnace , set and ; the same formula provides its two-component conditional mode from that furnace's observations, conditional on the fitted common parameters. If a variance component is zero, the covariance form remains meaningful and its corresponding random effect is zero, whereas the formula with needs a limiting interpretation. With known covariance parameters these are best linear unbiased predictors; plug-in variance estimates give their empirical version.
Write for stirring rate of observation in furnace . The independent random-intercept and random-slope model is
Errors and random effects are independent. The separate R terms (1 | furnace) and (0 + stir | furnace) impose independent random intercepts and random slopes; (1 + stir | furnace) would instead estimate their covariance as well. The estimates are
The corresponding estimated standard deviations are , , and ; they are not additional parameters.
For a furnace with predictor vector , the marginal formulation, obtained by integrating the Gaussian random effects, is
independently across furnaces. In particular,
In stacked notation , , giving the Gaussian linear mixed model marginal law with .
The residual-versus-fitted plot on page 17 has residuals of both signs over the fitted range, with no convincing smooth curvature or clear fan shape. Its quantile-quantile plot is roughly straight in the central region, with some tail departures and a few large negative residuals. There is no decisive visible violation, but investigate those observations. These plots mainly address conditional observation errors; they do not validate the distribution of furnace random effects or independence within furnaces. With only three furnaces, normality and the variance of the random effects are especially difficult to assess.
The null model's 99 residual degrees of freedom imply . Each predictor has a one-degree-of-freedom linear contribution in the parametric table, plus the reported nonlinear contribution. Consequently the termwise effective degrees of freedom are
Include the intercept once, giving about total effective degrees of freedom. The more precise residual degrees of freedom in the output give
There is no conflict: and are rounded, so they cannot recover the precise total. Individual unrounded termwise values are not provided.
The package's residual mean-square estimate of error variance is
matching the rounded in the table. The nonlinear experience contribution is highly significant, while the smaller nonlinear education contribution has approximate .
This calculation uses the effective residual degrees of freedom reported by this fit. For a general non-idempotent linear smoother , the noise contribution to expected RSS is , and the expectation can additionally contain squared smoothing bias. Thus dividing by is not a universal exact-unbiasedness theorem. The output's separation of linear and nonlinear term degrees of freedom is documented at cran.r-project.org/web/packages/gam/gam.pdf.
Use the backfitting algorithm to alternate conditional updates of the two additive functions. Initialize and both centered function vectors at zero. With the smoothing matrices for the chosen experience and education spline penalties, one cycle is
followed by
The centering transfers any constant component to the intercept; update to the mean of if necessary, which is under the stated constraints. Repeat until changes in the functions or objective are negligible. Each function is estimated by smoothing its partial residual, namely the response after subtracting all other currently fitted terms.
For fixed penalties these updates are block minimizations of
subject to the centering constraints. Each step cannot increase the objective; with identifiable additive terms and a positive-definite constrained quadratic, backfitting converges to its unique minimizer. Highly dependent predictors can make the decomposition poorly identified or slow convergence. The Gaussian identity-link model needs these least-squares updates directly; non-Gaussian generalized additive models use weighted backfitting inside iteratively reweighted least squares. The package implementation also separates each spline's unpenalized linear component from its nonlinear component, giving the two ANOVA tables displayed in part (e).
Both fits use the Gaussian generalized additive model
where is experience and education. Centering makes the additive decomposition identifiable. No experience-education interaction term is included.
The first fit uses local linear regression for each term. span=1 includes all observations in each nearest-neighbour neighbourhood, but distance weights and a moving target still vary: it does not make the fit exactly a global straight line. The second uses cubic smoothing splines, with separate tuning values spar=0.8 and spar=1.2. Increasing spar increases the curvature penalty and smooths more; spar is a monotone tuning parametrization, not the numerical in part (b). The relation depends on the predictor scaling and design.
The plotted experience effect is increasing in both fits. The local fit gives a broadly smooth, nearly linear rise; the spline fit follows more of the steep low-experience rise and subsequent flattening, especially near the lower boundary. Education has a weaker increasing effect. The local estimate shows some curvature, while the spline fit at spar=1.2 is closer to a straight line. The clearest difference is the amount of smoothing and the experience curvature, rather than opposite effect directions. These are centered partial-effect plots with partial residuals, not scatterplots of wage against each predictor alone.
A smaller local span would allow the first fit to capture more experience curvature. A moderately smaller education spar could reveal nonlinear detail suppressed in the second fit; its small but significant nonparametric component in part (e) supports checking that possibility. Do not tune solely to follow every point, especially at sparse boundaries. Compare candidate spans or separate spline penalties using cross-validation or generalized cross-validation; increase smoothing if flexible fits introduce unsupported wiggles. See the documented monotone spar–penalty convention at stat.ethz.ch/R-manual/R-patched/library/stats/html/smooth.spline.html.

Pinned article: Introduction to the OurBigBook Project

Welcome to the OurBigBook Project! Our goal is to create the perfect publishing platform for STEM subjects, and get university-level students to write the best free STEM tutorials ever.
Everyone is welcome to create an account and play with the site: ourbigbook.com/go/register. We belive that students themselves can write amazing tutorials, but teachers are welcome too. You can write about anything you want, it doesn't have to be STEM or even educational. Silly test content is very welcome and you won't be penalized in any way. Just keep it legal!
We have two killer features:
  1. topics: topics group articles by different users with the same title, e.g. here is the topic for the "Fundamental Theorem of Calculus" ourbigbook.com/go/topic/fundamental-theorem-of-calculus
    Articles of different users are sorted by upvote within each article page. This feature is a bit like:
    • a Wikipedia where each user can have their own version of each article
    • a Q&A website like Stack Overflow, where multiple people can give their views on a given topic, and the best ones are sorted by upvote. Except you don't need to wait for someone to ask first, and any topic goes, no matter how narrow or broad
    This feature makes it possible for readers to find better explanations of any topic created by other writers. And it allows writers to create an explanation in a place that readers might actually find it.
    Figure 1.
    Screenshot of the "Derivative" topic page
    . View it live at: ourbigbook.com/go/topic/derivative
  2. local editing: you can store all your personal knowledge base content locally in a plaintext markup format that can be edited locally and published either:
    This way you can be sure that even if OurBigBook.com were to go down one day (which we have no plans to do as it is quite cheap to host!), your content will still be perfectly readable as a static site.
    Figure 5. . You can also edit articles on the Web editor without installing anything locally.
    Video 3.
    Edit locally and publish demo
    . Source. This shows editing OurBigBook Markup and publishing it using the Visual Studio Code extension.
  3. https://raw.githubusercontent.com/ourbigbook/ourbigbook-media/master/feature/x/hilbert-space-arrow.png
  4. Infinitely deep tables of contents:
    Figure 6.
    Dynamic article tree with infinitely deep table of contents
    .
    Descendant pages can also show up as toplevel e.g.: ourbigbook.com/cirosantilli/chordate-subclade
All our software is open source and hosted at: github.com/ourbigbook/ourbigbook
Further documentation can be found at: docs.ourbigbook.com
Feel free to reach our to us for any help or suggestions: docs.ourbigbook.com/#contact