Extracts the degrees of freedom from or replaces them in an object
of class "projector
".
degfree(object)degfree(object) <- value
An object of class "projector
" that consists
of a square, summetric, idempotent matrix and degrees of freedom (rank) of the matrix.
An object of class "projector
"
whose degrees of freedom are to be extracted or replaced.
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.
Chris Brien
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
.
correct.degfree
, projector
in package dae.
projector
for further information about this class.
## 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)
Run the code above in your browser using DataLab