g02dk Method
関数リスト一覧   NagLibrary Namespaceへ  ライブラリイントロダクション  本ヘルプドキュメントのchm形式版

g02dk calculates the estimates of the parameters of a general linear regression model for given constraints from the singular value decomposition results.

Syntax

C#
public static void g02dk(
	int ip,
	int iconst,
	double[] p,
	double[,] c,
	double[] b,
	double rss,
	int idf,
	double[] se,
	double[] cov,
	out int ifail
)
Visual Basic (Declaration)
Public Shared Sub g02dk ( _
	ip As Integer, _
	iconst As Integer, _
	p As Double(), _
	c As Double(,), _
	b As Double(), _
	rss As Double, _
	idf As Integer, _
	se As Double(), _
	cov As Double(), _
	<OutAttribute> ByRef ifail As Integer _
)
Visual C++
public:
static void g02dk(
	int ip, 
	int iconst, 
	array<double>^ p, 
	array<double,2>^ c, 
	array<double>^ b, 
	double rss, 
	int idf, 
	array<double>^ se, 
	array<double>^ cov, 
	[OutAttribute] int% ifail
)
F#
static member g02dk : 
        ip:int * 
        iconst:int * 
        p:float[] * 
        c:float[,] * 
        b:float[] * 
        rss:float * 
        idf:int * 
        se:float[] * 
        cov:float[] * 
        ifail:int byref -> unit 

Parameters

ip
Type: System..::.Int32
On entry: p, the number of terms in the linear model.
Constraint: ip1.
iconst
Type: System..::.Int32
On entry: the number of constraints to be imposed on the parameters, nc.
Constraint: 0<iconst<ip.
p
Type: array< System..::.Double >[]()[]
An array of size [ip×ip+2×ip]
On entry: as returned by g02da and g02dd.
c
Type: array< System..::.Double ,2>[,](,)[,]
An array of size [ldc, iconst]
Note: ldc must satisfy the constraint: ldcip
On entry: the iconst constraints stored by column, i.e., the ith constraint is stored in the ith column of c.
b
Type: array< System..::.Double >[]()[]
An array of size [ip]
On entry: the parameter estimates computed by using the singular value decomposition, β^svd.
On exit: the parameter estimates of the parameters with the constraints imposed, β^c.
rss
Type: System..::.Double
On entry: the residual sum of squares as returned by g02da or g02dd.
Constraint: rss>0.0.
idf
Type: System..::.Int32
On entry: the degrees of freedom associated with the residual sum of squares as returned by g02da or g02dd.
Constraint: idf>0.
se
Type: array< System..::.Double >[]()[]
An array of size [ip]
On exit: the standard error of the parameter estimates in b.
cov
Type: array< System..::.Double >[]()[]
An array of size [ip×ip+1/2]
On exit: the upper triangular part of the variance-covariance matrix of the ip parameter estimates given in b. They are stored packed by column, i.e., the covariance between the parameter estimate given in b[i-1] and the parameter estimate given in b[j-1], ji, is stored in cov[j×j-1/2+i-1].
ifail
Type: System..::.Int32 %
On exit: ifail=0 unless the method detects an error (see [Error Indicators and Warnings]).

Description

g02dk computes the estimates given a set of linear constraints for a general linear regression model which is not of full rank. It is intended for use after a call to g02da or g02dd.
In the case of a model not of full rank the methods use a singular value decomposition (SVD) to find the parameter estimates, β^svd, and their variance-covariance matrix. Details of the SVD are made available in the form of the matrix P*:
P*= D-1 P1T P0T ,
as described by g02da and g02dd.
Alternative solutions can be formed by imposing constraints on the parameters. If there are p parameters and the rank of the model is k, then nc=p-k constraints will have to be imposed to obtain a unique solution.
Let C be a p by nc matrix of constraints, such that
CTβ=0
then the new parameter estimates β^c are given by
β^c =Aβ^svd; =I-P0CTP0-1β^svd,
where I is the identity matrix, and the variance-covariance matrix is given by
AP1D-2P1TAT,
provided CTP0-1 exists.

References

Error Indicators and Warnings

Accuracy

Further Comments

g02dk is intended for use in situations in which dummy (01) variables have been used such as in the analysis of designed experiments when you do not wish to change the parameters of the model to give a full rank model. The method is not intended for situations in which the relationships between the independent variables are only approximate.

Example

Data from an experiment with four treatments and three observations per treatment are read in. A model, including the mean term, is fitted by g02da and the results printed. The constraint that the sum of treatment effect is zero is then read in and the parameter estimates with this constraint imposed are computed by g02dk and printed.

Example program (C#): g02dke.cs

Example program data: g02dke.d

Example program results: g02dke.r

See Also