Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Library: nummath
See also: nmlevmarq

Quantlet: nmexpandmat
Description: expands the input matrix by zeros in places corresponding to fixed parameters

Usage: expmat = nmexpandmat(mat,fitfix{,npar,nfit})
Input:
mat nfit x nfit matrix, matrix to be expanded
fitfix npar x 1 vector, indicator of fixed vs. fitted parameters in a model; fitfix[i] = 0 means that the ith parameter remains fixed in a model, fitfix[i] <> 0 means that the ith parameter was fitted for.
npar (optional) scalar, total number of parameters in a model; default npar = rows(fitfix)
nfit (optional) scalar, number of fitted parameters in a model; default nfit = sum(fitfix <> 0)
Output:
expmat npar x npar matrix, expanded matrix

Note:

Example:
library("nummath")
mat = #(3,2)~#(2,4)
fitfix = #(1,0,0,1,0)
mat
nmexpandmat(mat,fitfix)

Result:
Contents of mat
[1,]        3        2
[2,]        2        4

Contents of expmat
[1,]        3        0        0        2        0
[2,]        0        0        0        0        0
[3,]        0        0        0        0        0
[4,]        2        0        0        4        0
[5,]        0        0        0        0        0



Author: L. Cizkova, 20030402 license MD*Tech
(C) MD*TECH Method and Data Technologies, 05.02.2006