Welcome to the Harris Geospatial product documentation center. Here you will find reference guides, help documents, and product libraries.


  >  Docs Center  >  IDL Reference  >  Advanced Math and Stats  >  IMSL_HYPOTH_PARTIAL

IMSL_HYPOTH_PARTIAL

IMSL_HYPOTH_PARTIAL

The IMSL_HYPOTH_PARTIAL function constructs an equivalent completely testable multivariate general linear hypothesis HbU = G from a partially testable hypothesis HpbU = Gp.



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 HpbU = 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 (see keyword Rank_Hp).

Arguments


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.

info_v

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

Keywords


DOUBLE

If present and nonzero, double precision is used.

G_MATRIX

Named variable into which a one-dimensional array of length nu containing the G matrix is stored. The elements of G_Matrix contain the null hypothesis values for the completely testable hypothesis.

GP

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

Named variable into which a two-dimensional array of size nh by n_parameters containing the H matrix is stored. 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

Named variable into which the rank of Hp is stored.

Discussion


Once a general linear model y = Xb + e 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 cTb 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 Hb = 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 Hb = g is partially testable if the intersection of the row space H (denoted by ) and the row space of X () is not essentially empty and is a proper subset of , i.e., . A hypothesis Hb = g is completely testable if . 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 Hpb = 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 Hb = g equals the difference in the error sums of squares from two fitted models—the restricted model with the partially testable hypothesis Hpb = gp and the unrestricted model.

For the general case of the multivariate model Y = Xb + e with possible linear equality restrictions on the regression parameters, IMSL_HYPOTH_PARTIAL converts the partially testable hypothesis Hpb = gp to a completely testable hypothesis HbU = 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 is replaced by 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:

  2.  

    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.

     

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

  4.  

    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.

     

  5. Form:

  6.  

  7. Compute the singular values of A:
  8.  

     

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

     

     

    If s1 < 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 ss = 1 > ss+1. Set nh = s.

     

  9. Let W1 be the first s columns of W. Set H = (Q1W1)T.
  10.  

  11. 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:

  12.  

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

     

  13. Partition

  14.  

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

     

    The degrees of freedom (nh) classify the hypothesis HpbU =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 = m + ai + eii..(i, j) = (1, 1) (2, 1) (2, 2)

The model is fitted using the 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)
% 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.
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'
Partially Testable Hypothesis
PM, h_matrix, title = ';H Matrix'
H Matrix
0.00000 0.707107 -0.707107
PM, g_matrix, title = ';G'
G
1.41421

Errors


Warning Errors

STAT_HYP_NOT_CONSISTENT—The hypothesis is inconsistent within the computed tolerance.

Version History


6.4
Introduced



© 2018 Harris Geospatial Solutions, Inc. |  Legal
My Account    |    Store    |    Contact Us