The IMSL_HYPOTH_PARTIAL function constructs an equivalent completely testable multivariate general linear hypothesis HβU = G from a partially testable hypothesis HpβU = Gp.

Once a general linear model y = Xβ + ε is fitted, particular hypothesis tests are frequently of interest. If the matrix of regressors X is not full rank (as evidenced by the fact that some diagonal elements of the R matrix output from the fit are equal to zero), methods that use the results of the fitted model to compute the hypothesis sum of squares (see IMSL_HYPOTH_SCPH) require specification in the hypothesis of only linear combinations of the regression parameters that are estimable. A linear combination of regression parameters cTβ is estimable if there exists some vector a such that cT = aTX, i.e., cT is in the space spanned by the rows of X. For a further discussion of estimable functions, see Maindonald (1984, pp. 1661168) and Searle (1971, pp. 1802188). The IMSL_HYPOTH_PARTIAL function is only useful in the case of non-full rank regression models, i.e., when the problem of estimability arises.

Peixoto (1986) noted that the customary definition of testable hypothesis in the context of a general linear hypothesis test Hβ = g is overly restrictive. He extended the notion of a testable hypothesis (a hypothesis composed of estimable functions of the regression parameters) to include partially testable and completely testable hypothesis. A hypothesis Hβ = g is partially testable if the intersection of the row space H (denoted by ℜ(H) and the row space of X (ℜ(X)) is not essentially empty and is a proper subset of ℜ(H) , i.e., {0} ⊂ ℜ(H) ∩ ℜ(X) ⊂ ℜ(H) . A hypothesis Hβ = g is completely testable if {0} ⊂ ℜ(H) ∩ ℜ(H) ⊂ ℜ(X) .

Peixoto also demonstrated a method for converting a partially testable hypothesis to one that is completely testable so that the usual method for obtaining sums of squares for the hypothesis from the results of the fitted model can be used. The method replaces Hp in the partially testable hypothesis Hpβ = gp by a matrix H whose rows are a basis for the intersection of the row space of Hp and the row space of X.

A corresponding conversion of the null hypothesis values from gp to g is also made. A sum of squares for the completely testable hypothesis can then be computed (see IMSL_HYPOTH_SCPH). The sum of squares that is computed for the hypothesis Hβ = g equals the difference in the error sums of squares from two fitted models; the restricted model with the partially testable hypothesis Hpβ = gp and the unrestricted model.

For the general case of the multivariate model Y = Xβ + ε with possible linear equality restrictions on the regression parameters, IMSL_HYPOTH_PARTIAL converts the partially testable hypothesis Hpβ = gp to a completely testable hypothesis HβU = G. For the case of the linear model with linear equality restrictions, the definitions of the estimable functions, nontestable hypothesis, partially testable hypothesis, and completely testable hypothesis are similar to those previously given for the unrestricted model with the exception that ℜ(X) is replaced by ℜ(R) where R is the upper triangular matrix based on the linear equality restrictions. The nonzero rows of R form a basis for the rowspace of the matrix (XT, AT)T. The rows of H form an orthonormal basis for the intersection of two subspaces; the subspace spanned by the rows of Hp and the subspace spanned by the rows of R. The algorithm used for computing the intersection of these two subspaces is based on an algorithm for computing angles between linear subspaces due to Björk and Golub (1973). (See also Golub and Van Loan 1983, pp. 429430). The method is closely related to a canonical correlation analysis discussed by Kennedy and Gentle (1980, pp. 561565). The algorithm is as follows:

1. Compute a QR factorization of:

with column permutations so that:

Here, P1 is the associated permutation matrix that is also an orthogonal matrix. Determine the rank of Hp as the number of nonzero diagonal elements of R1, for example n1. Partition Q1 = (Q11, Q12) so that Q11 is the first n1 column of Q1. Set RANK_HP = n.

2. Compute a QR factorization of the transpose of the R matrix (input through Info_v) with column permutations so that:

3. Determine the rank of R from the number of nonzero diagonal elements of R, for example n2. Partition Q2 = (Q21, Q22) so that Q21 is the first n2 columns of Q2.
4. Form:

5. Compute the singular values of A:

and the left singular vectors W of the singular value decomposition of A so that:

If σ1 < 1, then the dimension of the intersection of the two subspaces is s = 0. Otherwise, assume the dimension of the intersection to be s if σs = 1 > σs+1. Set nh = s.

6. Let W1 be the first s columns of W. Set H = (Q1W1)T.
7. Assume R11 to be a nhp by nhp matrix related to R1 as follows: If nhp < n_parameters, R11 equals the first nhp rows of R1. Otherwise, R11 contains R1 in its first n_parameters rows and zeros in the remaining rows. Compute a solution Z to the linear system:

If this linear system is declared inconsistent, an error message with error code equal to 2 is issued.

8. Partition:

so that Z1 is the first n1 rows of Z. Set:

The degrees of freedom (nh) classify the hypothesis HpβU =Gp as nontestable (nh = 0), partially testable (0 < nh < RANK_HP), or completely testable (0 < nh= RANK_HP).

For further details concerning the algorithm, see Sallas and Lionti (1988).

## Example

A one-way analysis-of-variance model discussed by Peixoto (1986) is fitted to data. The model is:

yii = µ + αi + εii..(i, j) = (1, 1) (2, 1) (2, 2)

The model is fitted using IMSL_MULTIREGRESS. The partially testable hypothesis:

is converted to a completely testable hypothesis.

`nrows	=	3`
`n_indep	 =	1`
`n_dep	=	1`
`n_param	 =	3`
`n_class	 =	1`
`n_cont		=	 0`
`nhp	=		2`
`z	=	[1, 2, 2]`
`y	=	[17.3, 24.1, 26.3]`
`gp	=	[5, 3]`
`hp	=	TRANSPOSE([[0, 1, 0], [0, 0, 1]])`
`x	=	IMSL_REGRESSORS(z, n_class, n_cont)`
`size_x	=	SIZE(x)`
`nreg	=	size_x(2)`
`coefs	=	IMSL_MULTIREGRESS(x, y, Predict_Info = info_v)`

IDL prints:

`% IMSL_MULTIREGRESS: Warning: STAT_RANK_DEFICIENT`
`The model is not full rank.	There is not a unique least squares solution. The rank of the matrix of regressors is 2.`

Continue:

`nh	=	IMSL_HYPOTH_PARTIAL(info_v,	hp, Gp	=	gp, \$`
`  G_Matrix = g_matrix, H_Matrix = h_matrix, Rank_Hp = rank_hp)`
`IF (nh EQ 0) THEN PRINT, 'Nontestable Hypothesis' \$`
`  ELSE IF (nh LT rank_hp) THEN \$`
`    PRINT,	'Partially Testable Hypothesis' \$ `
`  ELSE PRINT, 'Completely Testable Hypothesis'`

IDL prints:

`Partially Testable Hypothesis`

Continue:

`PM,	h_matrix,	title	=	'H Matrix'`
`PM,	g_matrix,	title	=	'G'`

IDL prints:

`H Matrix`
`    0.00000	0.707107	-0.707107`
`G`
`    1.41421`

## Errors

### Warning Errors

STAT_HYP_NOT_CONSISTENT: The hypothesis is inconsistent within the computed tolerance.

## Syntax

Result = IMSL_HYPOTH_PARTIAL(Info_v, Hp [, /DOUBLE] [, G_MATRIX=variable] [, GP=array] [, H_MATRIX=variable] [, RANK_HP=variable])

## Return Value

Number of rows in the completely testable hypothesis, nh. This value is also the degrees of freedom for the hypothesis. The value nh classifies the hypothesis HpβU = Gp as nontestable (nh = 0), partially testable (0 < nh < RANK_HP) or completely testable (0 < nh = RANK_HP), where RANK_HP is the rank of Hp.

## Arguments

### Info_v

One-dimensional array of type BYTE containing information about the regression fit. See IMSL_MULTIREGRESS.

### Hp

The Hp array of size nhp by n_coefficients with each row corresponding to a row in the hypothesis and containing the constants that specify a linear combination of the regression coefficients. Here, n_coefficients is the number of coefficients in the fitted regression model.

## Keywords

### DOUBLE (optional)

If present and nonzero, double precision is used.

### G_MATRIX (optional)

Named variable in the form of a one-dimensional array of length nu containing the G matrix. The elements of the matrix contain the null hypothesis values for the completely testable hypothesis.

### GP (optional)

Two-dimensional array of size nhp by nu containing the Gp matrix, the null hypothesis values. By default, each value of Gp is equal to 0.

### H_MATRIX (optional)

Named variable in the form of a two-dimensional array of size nh by n_parameters containing the H matrix. Each row of H_MATRIX corresponds to a row in the completely testable hypothesis and contains the constants that specify an estimable linear combination of the regression coefficients.

### RANK_HP (optional)

Named variable containing the rank of Hp.

## Version History

 6.4 Introduced