degfree: Degrees of freedom extraction and replacement

View source: R/proj.r

degfreeR Documentation

Degrees of freedom extraction and replacement

Description

Extracts the degrees of freedom from or replaces them in an object of class "projector".

Usage

degfree(object)

degfree(object) <- value

Arguments

object

An object of class "projector" whose degrees of freedom are to be extracted or replaced.

value

An integer to which the degrees of freedom are to be set or an object of class "projector" or "matrix" from which the degrees of freedom are to be calulated.

Details

There is no checking of the correctness of the degrees of freedom, either already stored or as a supplied integer value. This can be done using correct.degfree.

When the degrees of freedom of the projector are to be calculated, they are obtained as the number of nonzero eigenvalues. An eigenvalue is regarded as zero if it is less than daeTolerance, which is initially set to .Machine$double.eps ^ 0.5 (about 1.5E-08). The function set.daeTolerance can be used to change daeTolerance.

Value

An object of class "projector" that consists of a square, summetric, idempotent matrix and degrees of freedom (rank) of the matrix.

Author(s)

Chris Brien

See Also

correct.degfree, projector in package dae.

projector for further information about this class.

Examples

## set up a 2 x 2 mean operator that takes the mean of a vector of 2 values
m <- matrix(rep(0.5,4), nrow=2)

## coerce to a projector
proj.m <- projector(m)

## extract its degrees of freedom
degfree(proj.m)

## create a projector based on the matrix m
proj.m <- new("projector", data=m)

## add its degrees of freedom and print the projector
degfree(proj.m) <- proj.m
print(proj.m)

dae documentation built on June 22, 2024, 9:07 a.m.