R: Class "bdsmatrix"

bdsmatrix-class {bdsmatrix} | R Documentation

## Class "bdsmatrix"

### Description

Representation for a Block Diagonal Sparse matrix

### Objects from the Class

Objects of this class are usually created using the `bdsmatrix`, `bdsI` or `bdsBlock` functions. The result is a symmetrix matrix whose upper left portion is block-diagonal, with an optional border on the right and bottom that is dense. The matrices were originally created to represent familial correlation structures, which have a block for each family but no connection between families.

### Slots

`blocksize`:

  An integer vector containing the sizes of the diagonal blocks

`blocks`:

  A numeric vector containing the contents of the block portion. Only the lower triangle of each block is stored.

`rmat`:

  An optional numeric matrix containing the dense portion

`offdiag`:

  A single numeric element, default zero, which is the value for elements off the block-diagonal

`Dim`:

  The dimension of the matrix, an integer vector of length 2

`Dimnames`:

  The dimnames of the matrix, a list with 2 elements

### Methods

%*%

  `signature(x = "matrix", y = "bdsmatrix")`: the result will be an ordinary matrix

%*%

  `signature(x = "numeric", y = "bdsmatrix")`: the result will be a vector

%*%

  `signature(x = "bdsmatrix", y = "matrix")`: the result will be an ordinary matrix

%*%

  `signature(x = "bdsmatrix", y = "numeric")`: the result will be a vector

Math2

  `signature(x = "bdsmatrix")`:

Math

  `signature(x = "bdsmatrix")`:

Ops

  `signature(e1 = "bdsmatrix", e2 = "numeric")`:

Ops

  `signature(e1 = "bdsmatrix", e2 = "bdsmatrix")`:

Ops

  `signature(e1 = "bdsmatrix", e2 = "matrix")`:

Ops

  `signature(e1 = "numeric", e2 = "bdsmatrix")`:

Ops

  `signature(e1 = "matrix", e2 = "bdsmatrix")`:

[

  `signature(x = "bdsmatrix")`: if the subscripts are a set of increasing integers, and the row and column subscripts are identical, then the result is aslo a bdsmatrix. This is useful for example to create the kinship matrix for all females from an overall kinship matrix. If the subscripts do not match, then an ordinary matrix is created

all

  `signature(x = "bdsmatrix")`: ...

any

  `signature(x = "bdsmatrix")`: ...

coerce

  `signature(from = "bdsmatrix", to = "matrix")`: ...

coerce

  `signature(from = "bdsmatrix", to = "vector")`: ...

diag

  `signature(x = "bdsmatrix")`: retrieve the diagonal of the matrix

diag<-

  `signature(x = "bdsmatrix")`: set the diagonal of the matrix to a given value

dim

  `signature(x = "bdsmatrix")`: dimension of the matrix

dimnames

  `signature(x = "bdsmatrix")`: dimnames of the matrix

dimnames<-

  `signature(x = "bdsmatrix")`: set the dimnames of the matrix

gchol

  `signature(x = "bdsmatrix")`: generalized cholesky decomposition of the matrix

max

  `signature(x = "bdsmatrix")`: maximum of the matrix

min

  `signature(x = "bdsmatrix")`: minimum of the matrix

prod

  `signature(x = "bdsmatrix")`:

range

  `signature(x = "bdsmatrix")`:

show

  `signature(object = "bdsmatrix")`: print out the matrix

sum

  `signature(x = "bdsmatrix")`:

### Note

Many of the actions above will result in conversion to an ordinary matrix object, including `print`, addition to an ordinary matrix, etc. This can easily create objects that are too large for system memory. By default the value of options('bdsmatrixsize') is consulted first, and if the resulting object would be have a length greater than this option the conversion an error is generated and conversion is not attempted. The default value for the option is 1000.

### Author(s)

Terry Therneau

### See Also

`gchol`

### Examples

    showClass("bdsmatrix")

[Package bdsmatrix version 1.3-2 Index]