File: sparseQR-class.Rd

package info (click to toggle)
rmatrix 0.9975-6-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 4,136 kB
  • ctags: 2,162
  • sloc: ansic: 35,914; makefile: 225; fortran: 151; sh: 67
file content (107 lines) | stat: -rw-r--r-- 4,911 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
\name{sparseQR-class}
\docType{class}
\alias{sparseQR-class}
\alias{qr.coef,sparseQR,dgeMatrix-method}
\alias{qr.coef,sparseQR,matrix-method}
\alias{qr.coef,sparseQR,numeric-method}
\alias{qr.fitted,sparseQR,dgeMatrix-method}
\alias{qr.fitted,sparseQR,matrix-method}
\alias{qr.fitted,sparseQR,numeric-method}
\alias{qr.qty,sparseQR,dgeMatrix-method}
\alias{qr.qty,sparseQR,matrix-method}
\alias{qr.qty,sparseQR,numeric-method}
\alias{qr.qy,sparseQR,dgeMatrix-method}
\alias{qr.qy,sparseQR,matrix-method}
\alias{qr.qy,sparseQR,numeric-method}
\alias{qr.resid,sparseQR,dgeMatrix-method}
\alias{qr.resid,sparseQR,matrix-method}
\alias{qr.resid,sparseQR,numeric-method}
\title{Sparse QR decomposition of a sparse matrix}
\description{Objects of this class represent a QR decomposition of a
  sparse rectangular matrix.}
\section{Objects from the Class}{
  Objects can be created by calls of the form \code{new("sparseQR", ...)}
  but are more commonly created by function \code{\link[base]{qr}} applied
  to a sparse matrix such as a matrix of class
  \code{\linkS4class{dgCMatrix}}.}
}
\section{Slots}{
  \describe{
    \item{\code{V}:}{Object of class \code{"dgCMatrix"} The columns of
      \code{V} are the vectors that generate the Householder
      transformations of which the matrix Q is composed.}
    \item{\code{beta}:}{Object of class \code{"numeric"} The normalizing
      factors for the Householder transformations.}
    \item{\code{p}:}{Object of class \code{"integer"} Permutation
      applied to the rows of the original matrix.}
    \item{\code{R}:}{Object of class \code{"dgCMatrix"} An upper
      triangular matrix of dimension \ }
    \item{\code{q}:}{Object of class \code{"integer"} Permutation
      applied from the right. Can be of length 0 which implies no
      permutation.} 
  }
}
\section{Methods}{
  \describe{
    \item{qr.coef}{\code{signature(qr = "sparseQR", y = "dgeMatrix")}: ... }
    \item{qr.coef}{\code{signature(qr = "sparseQR", y = "matrix")}: ... }
    \item{qr.coef}{\code{signature(qr = "sparseQR", y = "numeric")}: ... }
    \item{qr.fitted}{\code{signature(qr = "sparseQR", y = "dgeMatrix")}: ... }
    \item{qr.fitted}{\code{signature(qr = "sparseQR", y = "matrix")}: ... }
    \item{qr.fitted}{\code{signature(qr = "sparseQR", y = "numeric")}: ... }
    \item{qr.qty}{\code{signature(qr = "sparseQR", y = "dgeMatrix")}: ... }
    \item{qr.qty}{\code{signature(qr = "sparseQR", y = "matrix")}: ... }
    \item{qr.qty}{\code{signature(qr = "sparseQR", y = "numeric")}: ... }
    \item{qr.qy}{\code{signature(qr = "sparseQR", y = "dgeMatrix")}: ... }
    \item{qr.qy}{\code{signature(qr = "sparseQR", y = "matrix")}: ... }
    \item{qr.qy}{\code{signature(qr = "sparseQR", y = "numeric")}: ... }
    \item{qr.resid}{\code{signature(qr = "sparseQR", y = "dgeMatrix")}: ... }
    \item{qr.resid}{\code{signature(qr = "sparseQR", y = "matrix")}: ... }
    \item{qr.resid}{\code{signature(qr = "sparseQR", y = "numeric")}: ... }
	 }
}

%\references{}
%\author{}
\note{The decomposition is of the form \code{A[p+1:1,] == Q \%*\% R}, if
  the \code{q} slot if of length 0 or \code{A[p+1:1,q+1:1] == Q \%*\% R} 
  where A is a sparse \eqn{m\times n}{m by n} matrix (\eqn{m\ge n}{m >= n}),
  \eqn{R} is an \eqn{m\times n}{m by n} matrix that is zero below the
 main diagonal.  The \code{p} slot is a 0-based permutation of
 \code{1:m} applied to the rows of the original matrix.  If the \code{q}
 slot has length \code{n} it is a 0-based permutation of \code{1:n}
 applied to the columns of the original matrix to reduce the amount
  of "fill-in" in the matrix \eqn{R}.

  The matrix \eqn{Q} is a "virtual matrix".  It is the product of
  \eqn{n} Householder transformations.  The information to generate
  these Householder transformations is stored in the \code{V} and
  \code{beta} slots.

 The \code{"sparseQR"} methods for the \code{qr.*} functions return
 objects of class \code{"dgeMatrix"} (see
 \code{\linkS4class{dgeMatrix}}).  Results from \code{qr.coef},
 \code{qr.resid} and \code{qr.fitted} (when \code{k == ncol(R)}) are
 well-defined and should match those from the corresponding dense matrix
 calculations.  However, because the matrix \code{Q} is not uniquely
 defined, the results of \code{qr.qy} and \code{qr.qty} do not
 necessarily match those from the corresponding dense matrix
 calculations.

 Also, the results of \code{qr.qy} and \code{qr.qty} apply to the
 permuted column order when the \code{q}  slot has length \code{n}.
}
\seealso{
  \code{\link[base]{qr}}, \code{\link[base]{qr.Q}},
  \code{\link[base]{qr.R}}, \code{\link[base]{qr.fitted}},
  \code{\link[base]{qr.resid}}, \code{\link[base]{qr.coef}},
  \code{\link[base]{qr.qty}}, \code{\link[base]{qr.qy}},
  \code{\linkS4class{dgCMatrix}}, \code{\linkS4class{dgeMatrix}}.
}
\examples{
data(KNex); mm <- KNex$mm
str(mmQR <- qr(mm))
}
\keyword{classes}
\keyword{algebra}
\keyword{array}