The R Project SVN R

Rev

Rev 61622 | Rev 68407 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 61622 Rev 62149
Line 19... Line 19...
19
\arguments{
19
\arguments{
20
  \item{x}{an object for which a method exists.  The default method
20
  \item{x}{an object for which a method exists.  The default method
21
    applies to numeric (or logical) symmetric, positive-definite matrices.}
21
    applies to numeric (or logical) symmetric, positive-definite matrices.}
22
  \item{\dots}{arguments to be based to or from methods.}
22
  \item{\dots}{arguments to be based to or from methods.}
23
  \item{pivot}{Should pivoting be used?}
23
  \item{pivot}{Should pivoting be used?}
24
  \item{LINPACK}{logical.  Should LINPACK be used (which is deprecated)?}
24
  \item{LINPACK}{logical.  Should LINPACK be used (now ignored)?}
25
  \item{tol}{A numeric tolerance for use with \code{pivot = TRUE,
25
  \item{tol}{A numeric tolerance for use with \code{pivot = TRUE}.}
26
      LINPACK = FALSE)}.}
-
 
27
}
26
}
28
\value{
27
\value{
29
  The upper triangular factor of the Choleski decomposition, i.e., the
28
  The upper triangular factor of the Choleski decomposition, i.e., the
30
  matrix \eqn{R} such that \eqn{R'R = x} (see example).
29
  matrix \eqn{R} such that \eqn{R'R = x} (see example).
31
 
30
 
Line 51... Line 50...
51
  \code{pivot <- attr(Q, "pivot")} and \code{oo <- order(pivot)}, it
50
  \code{pivot <- attr(Q, "pivot")} and \code{oo <- order(pivot)}, it
52
  is true that \code{t(Q[, oo]) \%*\% Q[, oo]} equals \code{x},
51
  is true that \code{t(Q[, oo]) \%*\% Q[, oo]} equals \code{x},
53
  or, alternatively, \code{t(Q) \%*\% Q} equals \code{x[pivot,
52
  or, alternatively, \code{t(Q) \%*\% Q} equals \code{x[pivot,
54
    pivot]}.  See the examples.
53
    pivot]}.  See the examples.
55
  
54
  
56
  Use of \code{chol(pivot = FALSE, LINPACK = TRUE)} was deprecated in \R
-
 
57
  1.7.0.   Pivoting with LAPACK requires LAPACK >= 3.2 and was added in \R
55
  Pivoting with LAPACK requires LAPACK >= 3.2 and was added in \R 2.15.2
58
  2.15.2.  The value of \code{tol} is passed to LAPACK, with negative
56
  (it was previously available using LINPACK).  The value of \code{tol}
59
  values selecting the default tolerance of (usually) \code{nrow(x) *
57
  is passed to LAPACK, with negative values selecting the default
60
  .Machine$double.neg.eps * max(diag(x)}.  The algorithm terminates once
58
  tolerance of (usually) \code{nrow(x) * .Machine$double.neg.eps *
61
  the pivot is less than \code{tol}.
-
 
62
 
-
 
63
  The LINPACK interface is restricted to matrices \code{x} with less
59
  max(diag(x)}.  The algorithm terminates once the pivot is less than
64
  than \eqn{2^{31}}{2^31} elements.
60
  \code{tol}.
65
}
61
}
66
 
62
 
67
\section{Warning}{
63
\section{Warning}{
68
  The code does not check for symmetry.
64
  The code does not check for symmetry.
69
 
65
 
Line 73... Line 69...
73
  by construction.
69
  by construction.
74
}
70
}
75
 
71
 
76
\source{
72
\source{
77
  This is an interface to the LAPACK routines \code{DPOTRF} and
73
  This is an interface to the LAPACK routines \code{DPOTRF} and
78
  \code{DPSTRF} and the LINPACK routines \code{DPOFA} and \code{DCHDC}.
74
  \code{DPSTRF},
79
 
75
 
80
  LAPACK and LINPACK are from \url{http://www.netlib.org/lapack} and
-
 
81
  \url{http://www.netlib.org/linpack} and their guides are listed
76
  LAPACK is from \url{http://www.netlib.org/lapack} and its guide is listed
82
  in the references.
77
  in the references.
83
}
78
}
84
\references{
79
\references{
85
  Anderson. E. and ten others (1999)
80
  Anderson. E. and ten others (1999)
86
  \emph{LAPACK Users' Guide}. Third Edition. SIAM.\cr
81
  \emph{LAPACK Users' Guide}. Third Edition. SIAM.\cr
Line 88... Line 83...
88
  \url{http://www.netlib.org/lapack/lug/lapack_lug.html}.
83
  \url{http://www.netlib.org/lapack/lug/lapack_lug.html}.
89
 
84
 
90
  Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988)
85
  Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988)
91
  \emph{The New S Language}.
86
  \emph{The New S Language}.
92
  Wadsworth & Brooks/Cole.
87
  Wadsworth & Brooks/Cole.
93
 
-
 
94
  Dongarra, J. J., Bunch, J. R., Moler, C. B. and Stewart, G. W. (1978)
-
 
95
  \emph{LINPACK Users Guide.}  Philadelphia: SIAM Publications.
-
 
96
}
88
}
97
 
89
 
98
\note{
-
 
99
  \code{LINPACK = TRUE, pivot = FALSE} (for compatibility with \R <
-
 
100
  1.7.0) was formally deprecated in \R 2.15.2.
-
 
101
}
-
 
102
 
-
 
103
 
-
 
104
\seealso{
90
\seealso{
105
  \code{\link{chol2inv}} for its \emph{inverse} (without pivoting),
91
  \code{\link{chol2inv}} for its \emph{inverse} (without pivoting),
106
  \code{\link{backsolve}} for solving linear systems with upper
92
  \code{\link{backsolve}} for solving linear systems with upper
107
  triangular left sides.
93
  triangular left sides.
108
 
94