Skip to contents

Companion factorization of multi-companion matrices.

Usage

mc_factorize(x, mo, mo.col)
mc_leftc(x, mo, mo.col)

Arguments

x

a multi-companion matrix or its top.

mo

multi-companion order, number of structural top rows.

mo.col

number of non-trivial columns in the top of the matrix.

Details

The companion factorization of a multi-companion matrix, \(X\), of (multi-companion) order \(p\) is \(X=A_1\times\cdots\times A_p\), where \(A_i\), \(i=1,\dots,p\), are companion matrices.

mc_leftc factorises a multi-companion matrix into a product of companion times multi-companion.

mc_factorize calls mc_leftc a number of times to compute the full factorisation.

If x is not a matrix an attempt is made to convert it to matrix. If x is a vector it is converted to a matrix with 1 row.

x may be the whole matrix or its top. If mo is missing x is assumed to be the top of the matrix and the multi-companion order is set to its number of rows.

mo.col defaults to the number of columns of x. It is important to specify mo.col if there are columns of zeroes in the top of the matrix. Otherwise the factorisation usually fails with a message (from solve) that the system is exactly singular. Note however that for objects of class MultiCompanion this situation is handled automatically (unless the user overwrites the default behaviour).

Value

for mc_factorize, a matrix whose i-th row is the first row of the i-th companion factor.

for mc_leftc, a numeric vector containing the first row of the companion factor.

References

Boshnakov GN (2002). “Multi-companion matrices.” Linear Algebra Appl., 354, 53--83. ISSN 0024-3795, doi:10.1016/S0024-3795(01)00475-X .

Author

Georgi N. Boshnakov

Note

The companion factorisation does not always exist but currently this possibility is not handled. Even if it exists, it may be numerically unstable.

Also, if mo.col is smaller than the number of columns, then the factorisation is not unique, the one having mo.col non-zero entries is computed. The existence is not treated.

mc_leftc is probably the first function I wrote for multi-companion matrices. It does not do checks consistently. The MultiCompanion class can be used here.

Level

0

See also

Examples

mat2 <- make_mcmatrix(eigval = c(1), co = cbind(c(1,1,1,1), c(0,1,0,0)), dim = 4, len.block = c(2))
mat2
#>      [,1] [,2] [,3] [,4]
#> [1,]    0    1    0    0
#> [2,]   -1    2    0    0
#> [3,]    0    1    0    0
#> [4,]    0    1    0    0
eigen(mat2)
#> eigen() decomposition
#> $values
#> [1] 1 1 0 0
#> 
#> $vectors
#>      [,1] [,2] [,3] [,4]
#> [1,]  0.5 -0.5    0    0
#> [2,]  0.5 -0.5    0    0
#> [3,]  0.5 -0.5    1    0
#> [4,]  0.5 -0.5    0    1
#> 
mc_leftc(mat2, mo = 4, mo.col = 2)
#> [1] 0 1 0 0
mCompanion(mat2)
#> 4 x 4 Matrix of class "MultiCompanion"
#>      [,1] [,2] [,3] [,4]
#> [1,]    0    1    0    0
#> [2,]   -1    2    0    0
#> [3,]    0    1    0    0
#> [4,]    0    1    0    0
mCompanion(mat2, mo=4, mo.col=2)
#> 4 x 4 Matrix of class "MultiCompanion"
#>      [,1] [,2] [,3] [,4]
#> [1,]    0    1    0    0
#> [2,]   -1    2    0    0
#> [3,]    0    1    0    0
#> [4,]    0    1    0    0
mc_leftc(mCompanion(mat2), mo = 4, mo.col = 2)
#> [1] 0 1 0 0
mc_eigen(mCompanion(mat2), mo = 4, mo.col = 2)
#> eigen() decomposition
#> $values
#> [1] 1 1 0 0
#> 
#> $vectors
#>      [,1] [,2] [,3] [,4]
#> [1,]  0.5 -0.5    0    0
#> [2,]  0.5 -0.5    0    0
#> [3,]  0.5 -0.5    1    0
#> [4,]  0.5 -0.5    0    1
#> 
#> $len.block
#> [1] 1 1 1 1
#> 
mc_eigen(mCompanion(mat2, mo=4, mo.col=2), mo = 4, mo.col = 2)
#> $values
#> [1] 1 1 0 0
#> 
#> $vectors
#>           [,1]       [,2] [,3] [,4]
#> [1,] 0.7071068 -0.7071068    0    0
#> [2,] 0.7071068 -0.7071068    0    0
#> [3,] 0.7071068 -0.7071068    1    0
#> [4,] 0.7071068 -0.7071068    0    1
#> 
#> $len.block
#> [1] 1 1 1 1
#>