UNMAKE takes a matrix and splits it column by column into a set of series. The matrix must have a number of rows equal to the number of observations in the current sample and a number of columns equal to the number of series whose names are supplied. Similarly, UNMAKE will split a vector into a set of scalars, if the number of scalars is equal to the length of the vector. UNMAKE is the reverse of MMAKE which makes a matrix from series, or a vector from scalars.
UNMAKE <matrix> <list of series> ;
or
UNMAKE <vector> <list of scalars> ;
Usage
UNMAKE's first argument is the name of the matrix to be broken up; the second a list of the names of the series where the columns of the matrix will be put. The number of series is limited only by the maximum size of the argument list (usually about 100 or more) and the space available in data storage for the new matrix.
The series named will be replaced if they already exist; if the NOREPL option is being used, observations outside the current sample will be deleted. The new series have the frequency and starting observation of the current sample.
The matrix to be unmade may be of any type; it will be expanded before UNMAKE is executed. An exception to this rule is in the case of a diagonal matrix -- if the length of the current sample is equal to the length of the diagonal, and only one series name is supplied, the diagonal of the matrix will be stored in this series.
UNMAKE can also be used to split a vector into scalars; this is useful for rearranging coefficient vectors and setting up starting value vectors. This is easier than specifying several SET statements or a tricky DOT loop.
Output
UNMAKE produces no printed output. A set of series (or scalars) are stored in data storage.
If the current sample is SMPL 1 5, and there is a 5 by 2 matrix X with the following elements:
1 9
2 8
3 7
4 6
5 5
the command
UNMAKE X X1 X2 ;
results in the following two series being stored:
|
X1 |
X2 |
|
1 |
9 |
|
2 |
8 |
|
3 |
7 |
|
4 |
6 |
|
5 |
5 |
Any submatrix within a matrix can also be obtained by unmaking the matrix under one SMPL and remaking it under another. For example, given an 8 by 8 covariance matrix, a new covariance matrix that contains only the elements corresponding to the 3rd, 4th and 5th variables can be extracted by the following commands:
SMPL 1 8 ;
UNMAKE VAR COL1-COL8 ;
SMPL 3 5 ;
MMAKE VAR35 COL3-COL5 ;
Here is an example of UNMAKE with a vector:
OLSQ Y C X1-X6;
UNMAKE @COEF B0-B6;
See also the example under MMAKE for manipulating a vector of starting values for parameters.