Read/write ELiS covariance vectors and/or ELiS covariance files; furthermore, extend covariance matrix of free parameters by zero rows/columns of fixed parameters, or delete zero rows and columns, belonging to fixed parameters.
Syntax
cvect = expcov(coeffcovar,fixpind)
[cvect,Cp] = expcov(coeffcovar,fixpind,... filename,comments,fdate)
coeffcovar = impcov(cdat)
[coeffcovar,fixpind,comments,fdate] = impcov(cdat,nofixp)
Description
expcov and impcov perform conversions of different representations of the covariance matrix of parameters. The structure of the ELiS covariance vector and the file format are described in Appendix A1.
cvect is the vector of covariances, Cp is the covariance matrix of all the parameters (both estimated and fixed ones).
coeffcovar is an n-by-n array, the covariance matrix of the coefficients. If fixpind is not given, n is equal to the number of the numerator coefficients plus the number of the denominator coefficients plus one (for the delay). If fixpind is given, coeffcovar should either not contain the rows and columns belonging to fixed coefficients, or these rows and columns should consist of zeros. fixpind contains the indices of fixed parameters in the total parameter vector, defined as [num,denom,delay]', where the coefficients are in descending order of powers of s in the s-domain, and in ascending order of the powers of z-1 in the z-domain.
If fixpind is given, and in coeffcovar there are zero rows and columns, the two notations must correspond to each other.
filename is the name of the covariance file. If filename is missing or empty, no file will be generated.
If the generation of a file is requested, the file will be created in the active subdirectory or folder. If the name has no extension, expcov extends it by '.cbn'. If the extension is .cbn, the result will be a binary file, otherwise an ASCII file. If the extension is '.cnt', no text is sent to the ASCII file, only data.
If a file is written or read, the most important values will be displayed on the screen, unless a global variable expimpmessages with value 'no' is defined.
Covariance values will be written to ASCII files by expcov in floating-point form, using 8 digits in the mantissas.
comments is a string with comments (optional), and fdate is the date (and time) string (also optional). If fdate is missing or empty, a date string will be generated.
impcov is the inverse of expcov. The data vector or the name of the file is cdat; the data vector contains the data in the same order as a *.cnt file. If nofixp is given with the value 'nofixp', the zero rows and columns in coeffcovar will be deleted. The default extension is .cbn.
Default Argument Values
nofixp = ''
Examples
coeffcovar = eye(5); expcov(coeffcovar,[],'data.cbn');
[coeffcov,fixpind] = impcov('inpchans.cbn','nofixp');
Diagnostics
expcov checks whether coeffcovar is quadratic, real, finite and symmetric. Also the validity of fixpind is checked.
If a file already exists with the same name, expcov tries to delete it. This will be unsuccessful if the file is not in the active subdirectory/folder. In this case the error message is:
Cannot delete existing file ...
impcov checks the length of the covariance vector form: if it is not valid, the error message is sent:
Number of data is not n*(n+1)/2
See Also
"Description of the Data Vector and File Formats" on page A-2
[ Previous | Help Desk | Next ]