Assume an independent Gaussian sample, positive-definite population covariance, and . Define the sample mean and unbiased sample covariance matrix by
The standard test is based on Hotelling's T-squared statistic
Reject the null hypothesis for large values. Under the null its exact distribution is
The factor uses the unbiased, divisor- covariance convention. Normal-sample theory makes independent of the residual covariance, whose whitened version has a Wishart distribution; this yields the stated F-distribution. The condition gives invertibility of almost surely and positive denominator degrees of freedom.
This is also the likelihood-ratio test. To see the connection, put and . The maximized covariance estimates under the unrestricted and null models are and , respectively. The determinant identity for a rank-one update gives
Thus the likelihood ratio is , decreasing in . The term best is understood here as this standard likelihood-ratio, affine-invariant procedure; a two-sided multidimensional alternative does not specify a single direction to optimize power against.
For the transformed sample , with the prescribed nonsingular coordinate transformation, we have
Consequently
This proves the affine invariance of Hotelling's statistic. The statistic, its p-value and its test decision are unchanged by a nonsingular affine transformation, provided the null mean is transformed with the data. Changes of units and rotations are included.
Use a multivariate normal distribution within each species, a common positive-definite covariance matrix, equal prior odds and equal misclassification costs. Assume the training observations are independent and representative of the populations. Substituting the sample means and pooled sample covariance matrix gives a fitted linear discriminant analysis rule, rather than a rule with known population parameters.
The determinant of the pooled covariance is , so
The midpoint of the sample means is , whose scalar product with is . Hence the fitted log likelihood ratio is
Assign fattus when and apathus when ; either assignment is optimal on under equal priors. The separating line is , with fattus below it. As a sign check, the scores at the two sample means are and , respectively. This uses the corrected Gaussian Bayes classifier from (a).
Principal component analysis replaces the original coordinates by orthogonal linear combinations, ordered so that the first few retain as much variance as possible. It gives a lower-dimensional summary for visualization or compression and reveals the main directions of variation. A direction of large variance need not be the direction most useful for classification.
Write . For a unit vector , the centered score has variance
Maximizing this Rayleigh quotient with a Lagrange multiplier gives
Thus a maximizing direction must be an eigenvector of the covariance matrix. To identify the maximum, use the spectral theorem for real symmetric matrices to choose an orthonormal basis of eigenvectors , with eigenvalues . Writing gives
Equality is attained at . Consequently the first population principal component is
For each subsequent principal component, maximize the same variance over unit coefficient vectors orthogonal to all the previously chosen ones. Restricting the expansion above to the remaining eigenvectors gives , then , and so on. Thus
The principal components are uncorrelated; they need not be independent unless additional distributional assumptions, such as joint Gaussianity, hold. Their total variance is . Signs of eigenvectors are arbitrary, and a repeated eigenvalue permits any orthonormal basis in its eigenspace. In sample principal component calculations, replace by the sample mean and by the sample covariance matrix.
For a bootstrap-t confidence interval, estimate the original standard error of , for example by the standard deviation of the outer paired bootstrap correlations. For each outer resample , estimate its own standard error by drawing many inner paired resamples from that outer sample and taking the standard deviation of their correlations. The resulting studentized statistics are
Let be their empirical quantiles. Approximating the distribution of by that of and solving the two inequalities for gives
The reversal of quantiles is essential. The pivot requires positive standard errors and nondegenerate correlations; its claimed 95% coverage is an approximation under bootstrap regularity, not an exact finite-sample guarantee. One may intersect the final interval with the parameter space .
The same percentile and studentized procedures can be applied to the sample mean of , and then only the observations need be resampled. They are useful when a normal approximation is doubtful. However the mean already has the simple standard-error estimate here. For normal observations, the classical exact interval is
and the same form is an asymptotic approximation for independent finite-variance observations under appropriate large-sample conditions. Thus bootstrap intervals are valid alternatives, but are often unnecessary for a mean with a reliable classical pivot; the correlation has no corresponding distribution-free elementary pivot. An infinite-variance distribution would require other theory rather than this ordinary standard-error argument.
Write , , and . The normal likelihood is proportional to . Its unrestricted maximizers are , . Under the null the variance maximizer is . Substitution gives the generalized likelihood-ratio test statistic
The ratio decreases as increases, so the likelihood-ratio rejection region is two-sided in . Under , is standard normal and is independent chi-squared with degrees of freedom. Independence follows by resolving the isotropic Gaussian sample vector into its projection on the constant vector and its orthogonal complement. Hence has the exact Student t-distribution with degrees of freedom.
For a chosen significance level , compute the sample mean and the sample standard deviation with denominator , and reject precisely when
Equivalently, report the two-sided -value . This requires and positive population variance; holds almost surely under that model. The nuisance variance is removed by the exact null distribution, so one should not substitute a normal critical value or a large-sample chi-squared approximation. This is the normal-mean likelihood ratio with unknown variance.
Transform each observation to . If has full row rank , the transformed sample is multivariate normal with mean and positive-definite covariance matrix . Its sample mean is and its unbiased sample covariance matrix is . The Hotelling test of linear hypotheses therefore uses
Here is required. Reject for a large scaled statistic using the relevant upper F-distribution quantile. If the rows of are dependent, choose a basis for their row space, use that basis as the contrast matrix, and replace by its rank . The null hypothesis is unchanged, but redundant contrasts must not be treated as independent dimensions. Rank zero gives no restrictions and hence no nontrivial test.
The solid Poisson regression profile and dashed negative binomial regression profile peak at essentially the same . The dashed profile is slightly wider and has heavier shoulders: it gives larger relative likelihood to values farther from the common maximizer. Thus the estimated mean ratio is stable, while the negative binomial model expresses slightly greater uncertainty.
The Poisson distribution constrains variance to equal the mean. A common negative binomial parametrization instead has , with additional shape ; it permits overdispersion due, for example, to unexplained between-physician heterogeneity. Profiling this extra parameter lets the data support greater count variability and usually reduces information about the mean contrast. In this two-group model, the fitted group means remain the sample means for fixed , which explains the nearly identical maximizers. The small separation of the profiles indicates a modest effect here, not overwhelming evidence for strong overdispersion. The comparison concerns the original PDF figure; no figure is reproduced.
The first matrix contains the leave-one-out samples, and each element of vect is their sample mean. For ,
Thus R4a computes the jackknife variance estimator of the full sample mean:
where is the unbiased sample variance. R5a computes the estimated bias used in jackknife bias correction. The identity for the average leave-one-out sample mean gives R5a = 0, apart from floating-point rounding.
The second printed loop contains an indexing error: its row index is i, although its loop variable is b. Literally, after the first block, i equals . When , every iteration overwrites row of the new matrix; the other rows remain missing. Hence vect contains one finite mean and 198 missing entries. R's default sorting removes missing entries, leaving a vector of length one, so selecting its fifth and 195th entries gives R7b = c(NA, NA). If , the matrix assignment is out of bounds; if the second block runs independently with i undefined, it fails even earlier. This is a source error, not a property of the bootstrap.
Replacing just the row index by b gives the intended algorithm: draw 199 independent bootstrap samples and sort their sample means as . The two indices are and , so
These are the endpoints of an approximate 95% percentile bootstrap confidence interval for the population mean. Their actual numerical values depend on the supplied data and random draws, which are not specified. They are not the reflected endpoints of a basic bootstrap confidence interval, and the choice of ranks does not guarantee exact finite-sample coverage.
Negative covariance can be exploited through antithetic variates, but it must belong to an actual joint sampling scheme. Two separately independent samples do not inherit negative covariance merely because one can imagine a coupling of their marginal distributions. Interpret the data as independent matched pairs with covariance , together with independent unmatched observations if the sample sizes differ. Other known pairing schemes can be handled by substituting their actual covariance of the two means.
Let , , and put
For any fixed , the combination is an unbiased estimator of the common mean. Its variance is . Differentiation, or completing the square, gives the minimum-variance combination of unbiased sample means:
With , both weights are positive. This is efficiency among fixed linear unbiased combinations, not a universal claim about every possible estimator for arbitrary distributions .
For an immediately implementable exactly unbiased estimator without known moments, use fixed , the pooled sample mean. Its variance is
which shows directly the gain from negative covariance. For any fixed weight, estimate using , and using , with the usual unbiased sample covariance of the matched pairs. Substitute them into the variance quadratic. At least two matched pairs are needed to estimate their covariance nonparametrically.
If the unknown optimal weights are desired while retaining exact unbiasedness, a cross-fitted combination of unbiased sample means gives an algorithm using the supplied data. Split the independent pairs and unmatched observations into two folds, keeping each pair together and retaining observations of both types in each fold. Estimate the moments from fold 2 to choose the weight for the fold-1 sample means, adjusting the variance terms for fold 1's sample sizes; do the converse for fold 2. Clip estimated weights to , to keep them bounded when training moment estimates are unstable. Average the two held-out combinations with deterministic weights, for example one half each for balanced folds.
Conditional on its training fold, each held-out pair of sample means has expectation , and its weights sum to one. Each held-out combination, and hence their average, is therefore exactly an unbiased estimator. Under consistent moment estimation with increasing balanced folds, the weights approach and recover its first-order variance advantage. In contrast, estimating a weight from the same data to which it is applied need not yield an unbiased estimator.
Estimate the variance of this fitted-weight procedure by a bootstrap that resamples matched pairs as blocks and unmatched observations separately, repeats the entire split/weight/combination procedure, and takes the sample variance of the resulting estimates. This preserves the negative covariance and includes variability of the fitted weights. Resampling the and values independently would erase the feature responsible for the improvement. The bootstrap estimate has its usual large-sample qualification; the fixed-weight plug-in variance formula above is the simpler alternative when weights are predetermined.
A random vector has multivariate normal distribution if every real linear combination is normally distributed, with mean and variance . The covariance matrix is symmetric positive semidefinite; zero variances permit degenerate normals. Its moment-generating function is , including the degenerate cases.
For the given , let . The joint moment-generating function of the is
The last equality uses the assumed orthogonality of the row spaces. Its factors are exactly the individual moment-generating functions, so the hint implies the random vectors are independent. Also every linear combination of the stacked vector is a linear combination of , hence normally distributed. Consequently
This establishes both claims without excluding singular block covariances.
For the sample mean and sample variance result, assume and set . Independence of the observations gives . Let , , and . Then . The first transformed vector is the scalar , and the second is the residual vector . They are independent by the just-proved result. Applying the measurable function to the residual vector preserves independence from the sample mean. Thus
Put , , and . Componentwise,
Thus the James–Stein shrinkage toward the sample mean leaves the average unchanged and multiplies every contrast about it by the same data-dependent factor . If the contrasts shrink without changing sign; if their signs reverse, and if their magnitudes increase. The event has probability zero, and the estimator can be assigned there.
The sample mean is a linear normal statistic with mean and variance , so
The error splits into orthogonal mean and contrast components:
Since the second term is perpendicular to , its cross product with the first is zero for every sample. Taking squared norms and expectations, , which yields the risk function
To compute the contrast risk, choose an orthonormal basis matrix for the range of , with , and . Then with , , and the contrast norm is the norm of . Expand it:
For , the Gaussian Stein identity gives
This application at a singularity is valid: near zero the reciprocal squared radius is integrable in dimension , since its radial integral is . Apply Gaussian integration by parts outside a ball of radius ; the inner boundary contribution is bounded by a constant times and vanishes. The Gaussian tail eliminates the boundary at infinity. Therefore all required expectations are finite and the displayed identity holds.
Since , the Stein risk identity now gives contrast risk . Adding the unit mean risk proves
Finally has the noncentral chi-squared distribution with . To establish where its reciprocal expectation is largest, complete the square in the normal representation to obtain its Laplace transform:
Since , the Tonelli theorem gives the reciprocal moment of a noncentral chi-squared variable
Its integrand is positive and strictly decreasing in for every . The expectation is therefore strictly largest at , where
Because this expectation is subtracted in the risk, the minimizing set is exactly , that is, all coordinates of equal. On this line the risk is :
There is a genuine normalization error in the printed function. Write independently, and . The internal sum produces a scalar; taking its mean does not divide by . The literal returned value is therefore
Since and , its expectation is
It does not estimate unbiasedly unless , and no fixed control variate coefficient removes this bias. In particular the actual call with returns
This is an instance of summing before taking a mean changes Monte Carlo normalization.
The intended corrected method replaces the sum by a sample mean:
It uses symmetry to write the tail as , then Monte Carlo integration on a bounded interval, and finally a mean-zero control variate. For the intended estimator is , whose summands are smooth and bounded. Keeping the average normalization, and
Differentiating this quadratic gives the Cauchy tail control variate on a bounded interval coefficient
Here , , so . Also
Consequently
The negative sign is consistent with decreasing and increasing. One may estimate the covariance and variance using a separate pilot sample and fix the resulting coefficient for a fresh sample. This coefficient minimizes the literal function's variance as well, but its missing factor of still leaves the bias above.
Write and . An equaliser rule has constant risk . An Extended Bayes rule has, for every , a proper prior such that , where . If a rule has both properties, every competitor satisfies
Letting proves that its maximum risk is the minimax risk.
For the given normal distribution model, completing the square in prior times likelihood gives the posterior , with and . Another completion of the square gives
This is maximized uniquely at . Consequently the Bayes act and posterior posterior expected loss are
The posterior loss is independent of , so averaging over the predictive distribution gives the same value for the Bayes risk of this Bayes decision rule.
The sample mean obeys , so its risk is the constant . Take any fixed and let the proper prior precisions . The optimal Bayes risks just calculated tend to , while the integrated risk of is exactly for every prior. Thus its excess Bayes risk tends to zero: it is extended Bayes as well as equaliser. The preceding argument proves
In a linear regression model, a large number of predictors or nearly dependent columns of the design matrix can make some eigenvalues of small. The ordinary least squares estimate has covariance matrix , so these directions have large variance, even though the estimator is unbiased. Ridge regression reduces this variance by shrinking the estimate towards zero, at the cost of introducing bias. This bias-variance tradeoff can improve the mean squared error when the signal is not too large in the shrunken directions.
For the usual preprocessing with a regression intercept, separate the constant column from the predictors and leave the intercept unpenalized. Subtract the sample mean from the response and from each nonconstant predictor, then divide each centered predictor column by its positive scale, for example its Euclidean norm. Thus all predictor columns have squared norm one; using squared norm instead simply changes the convention for the penalty. Centering is performed on the slope columns, not on the constant column. A full-rank design containing an intercept retains full rank on its centered slope columns. A model without an intercept should retain its specified mean structure unless an intercept is deliberately introduced.
Let be the resulting scaled, centered slope design matrix, let be the centered response, and let denote the coefficients in these standardized coordinates. The ridge regression problem is
Here is the number of slopes; it is one less than the original number of columns when a constant column was present. The gradient of this objective is . Its Hessian matrix is a positive-definite matrix, giving the unique closed-form ridge regression estimator
The regression intercept in the original coordinates is recovered as , and the original slopes are , where is the scale used for column . This is the unpenalized intercept in ridge regression convention. For a fixed full-rank coefficient design written simply as , with response and coefficient , the same formula reads
The risk comparison below first uses the fixed coefficient coordinates in which this quadratic penalty is imposed, and then addresses reversal of the scaling.
Assume at least one penalized coefficient, zero-mean errors with covariance matrix , and . No normal distribution assumption is needed for this mean squared error calculation. Put and . The covariance and bias of a ridge regression estimator follow directly from its linear expression:
For the centered slope model, the response errors have covariance matrix , where . Since , the same coefficient covariance matrix formula still holds with .
By the spectral theorem for real symmetric matrices, write , with orthogonal and every , and put . The bias-variance decomposition of mean squared error now gives
The expression at is the ordinary least squares mean squared error. Its right derivative is
Therefore, for every fixed coefficient vector, all sufficiently small positive penalties strictly improve mean squared error.
An explicit sufficient choice follows by subtracting the ordinary least squares risk term by term:
Since , every summand is negative whenever
When , every positive penalty works. This is a pointwise result: the permitted penalty may depend on the true coefficient vector. A fixed positive penalty cannot improve risk for all arbitrarily large signals, because its squared bias grows quadratically with the signal. The same distinction appears in uniform directional risk improvement by ridge regression and unbounded directional risk of fixed ridge shrinkage. In centered coordinates the unpenalized intercept contributes the same to both coefficient risks, so it does not affect the improvement. Reversing a fixed predictor scaling measures coefficient error with a fixed positive-definite matrix instead of the identity matrix. For this weighted loss the squared bias still has derivative zero at , while the variance term has derivative
The inequality follows because . Thus sufficiently small penalties also improve the original-coordinate mean squared error, though the explicit sufficient bound above was for the unweighted coordinates. Recovering an uncentered intercept adds a fixed nonnegative quadratic form to the slope loss, and its sample-mean error is uncorrelated with the centered slope errors, so the same weighted argument applies. A model with only an unpenalized intercept gives identical estimators. If the noise variance were zero, the strict improvement assertion would fail; positive noise variance is essential.
Set and . Keeping fixed in the gamma distribution family gives and . The ratio of expected process variance to variance of hypothetical means becomes
As the prior variance decreases, increases, so the credibility factor decreases. In the limit , : the risk parameter is already essentially known from the prior, leaving little need to use the noisy sample mean. The population claim expected value remains fixed throughout this comparison.
The PDF gives an inverse-gamma distribution with shape and scale , and a gamma distribution prior with shape and rate . Write . The supplied conditional moments, together with and , give the three structural quantities of the Bühlmann model:
Here is the variance of hypothetical means and the expected process variance. The law of total covariance and conditional independence of different years imply
All these quantities are finite because .
For any coefficients , minimizing the mean squared error over the intercept first gives . Let and . Expanding the remaining mean squared error gives
Its normal equations are for every . Since , subtracting any two equations shows that all agree. The quadratic part is strictly positive for every nonzero coefficient change, so the solution is the unique global minimizer. Solving gives
A credibility estimate combines individual experience with the collective expected value, using an experience weight . In this equal-exposure setting, the Bühlmann credibility premium is
Thus the computed coefficients give exactly a credibility estimate, with a fixed credibility factor determined by known parameters and the number of observed years. This is Bühlmann credibility for inverse-gamma observations.
For the final Bayesian calculation, the likelihood function in is proportional to . Multiplication by the gamma distribution prior gives the Gamma prior for an inverse-gamma scale update
Under quadratic loss, the conditional risk of an estimate is . Its minimizer is therefore the posterior mean:
This is not a fixed-weight arithmetic-mean credibility estimate. For , the observations and have the same sample mean, but reciprocal sums and , hence different posterior means. For any , append the same positive observations to these two samples. For , the estimate is , with ; its second derivative is , so it is not affine either. Symmetry in the observations would force equal slopes in any affine representation, so these examples also exclude a general fixed-coefficient linear representation.
One can express the posterior mean as a broader data-dependent blend. With and harmonic mean , it is
This weights a harmonic-mean-based experience estimate, and the weight itself depends on the observations. It is not the credibility estimate based on and the fixed Bühlmann credibility factor derived above.
A maximum-likelihood estimator maximizes the likelihood as a function of the parameter for the observed data. Under the usual regularity conditions, a scalar maximum-likelihood estimator satisfies , where is the Fisher information in one observation.
For a Poisson distribution with , the log-likelihood is . Solving gives . Its expectation is and its variance is . If all observations are zero, the maximum over occurs at zero; over this is a boundary supremum. The one-observation score function is , so and the asymptotic variance of is .
For , let . The identity
gives , so is another unbiased estimator. However, the total score function has variance . For any regular unbiased estimator , differentiating gives , so the Cauchy-Schwarz inequality yields . The sample mean attains this Cramér-Rao bound exactly. There is no variance advantage in preferring to .
A credibility estimate blends the risk's own sample mean with a population or prior expected value. In the basic equal-exposure form it is , where the credibility factor is the weight attached to the individual experience. More data ordinarily increase that weight; greater within-risk variation relative to between-risk variation reduces it.
Write for the conditional claim expected value, keeping for the prior-level parameter. Normalization of the probability density function gives
At interior points of its finite domain, differentiation under the integral sign yields
This is an instance of the exponential-family derivative identities for natural parameter . The minus sign is present in the PDF and is lost in the converted TeX. The conditional variance is likewise .
Differentiate the log of the natural conjugate prior:
Integrate on a compact subinterval and then let its endpoints approach those of the parameter interval. The prescribed vanishing of the prior density eliminates the boundary term. Since , monotone convergence theorem justifies the limit of its expectation, and the identity gives
In particular the assumed proper prior and boundary conditions themselves establish this first-moment integrability.
For and , conditional independence makes the likelihood function proportional to . Multiplication by the prior distribution gives the Bayesian posterior
Thus this is a conjugate prior family, with updated parameters
The integration-by-parts calculation for the posterior mean also needs vanishing posterior boundary values. Here that property can be checked, rather than assumed. Let be the essential lower and upper endpoints of the claim support. Every nondegenerate tilted claim law has , so the established prior mean satisfies . Supported observations have ; hence . At a finite parameter endpoint the prior's vanishing forces , because its exponential factor has a finite positive limit; the increased power makes the posterior vanish there too. At , choose with positive base-measure mass below . Then and the unnormalized posterior is at most . At , choose with positive mass above to obtain the corresponding bound . These bounds also ensure posterior propriety at infinite endpoints. This is the endpoint control for a Laplace-family conjugate posterior.
Apply the previous score integration to the Bayesian posterior. The natural conjugate credibility identity is
Thus is the credibility factor. This is an exact posterior mean, rather than an affine approximation to one.
For the specific shape-two gamma distribution, take
Then and . The gamma rate gamma conjugacy prior is
that is, . Its normalizing constant in the notation of the question is . The gamma distribution density vanishes at both zero and infinity for . The posterior has shape and rate , so its conditional-mean posterior mean is again .
For the last calculation, gamma distribution integration gives
The second identity requires the printed . Therefore the expected process variance and variance of hypothetical means, denoted by in this question, are
Consequently , and the Bühlmann credibility factor agrees with the exact Bayesian weight:
This is the exact Bühlmann credibility for gamma claims, expressed using the reciprocal rate as the random scale. The symbols here are the process and between-risk variances, respectively; their roles should not be interchanged when comparing with other notation for the Bühlmann model.
Write , let be the identity matrix, let be the -by- all-ones matrix, and put , with one diagonal block per experimental block. The variance-covariance matrix is
Its orthogonal decomposition is obtained by first subtracting each block's sample mean, then subtracting the grand sample mean from the block means. More explicitly, writing for coordinate in block , the three invariant subspaces are
They are pairwise orthogonal, with dimensions , and , and their direct sum is . On , both and vanish. On , and . On , and . Thus the eigenvalues and corresponding invariant subspaces are
If some eigenvalues coincide, their eigenspace is the direct sum of the listed subspaces with that value. Zero-dimensional rows are omitted when or . For an admissible covariance matrix the eigenvalues on nonzero subspaces must be nonnegative; these conditions are also sufficient for positive semidefiniteness. The expectation parameters do not affect this calculation.
The orchard residual mean square in ANOVA is on the original tree-response scale: it equals 30 times the corresponding residual mean square in ANOVA for orchard means. Thus the estimated variance of one orchard's sample mean is .
Each pruning marginal sample mean averages four independent orchard means, giving variance . Two different pruning marginals use disjoint orchards, so the variance of their estimated treatment contrast is
Each spray marginal sample mean uses six orchards. Similarly,
The corresponding standard errors are and in the units of weight per tree. These compare per-tree marginal sample means, averaging equally over the other factor, even when an interaction term is fitted. Comparing orchard totals instead would multiply these variances by .