EVOLUTION-MANAGER
Edit File: dpoMatrix-class.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Positive Semi-definite Dense (Packed | Non-packed) Numeric...</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for dpoMatrix-class {Matrix}"><tr><td>dpoMatrix-class {Matrix}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Positive Semi-definite Dense (Packed | Non-packed) Numeric Matrices</h2> <h3>Description</h3> <ul> <li><p>The <code>"dpoMatrix"</code> class is the class of positive-semidefinite symmetric matrices in nonpacked storage. </p> </li> <li><p>The <code>"dppMatrix"</code> class is the same except in packed storage. Only the upper triangle or the lower triangle is required to be available. </p> </li> <li><p>The <code>"corMatrix"</code> class of correlation matrices extends <code>"dpoMatrix"</code> with a slot <code>sd</code>, which allows to restore the original covariance matrix. </p> </li></ul> <h3>Objects from the Class</h3> <p>Objects can be created by calls of the form <code>new("dpoMatrix", ...)</code> or from <code>crossprod</code> applied to an <code>"dgeMatrix"</code> object.</p> <h3>Slots</h3> <dl> <dt><code>uplo</code>:</dt><dd><p>Object of class <code>"character"</code>. Must be either "U", for upper triangular, and "L", for lower triangular.</p> </dd> <dt><code>x</code>:</dt><dd><p>Object of class <code>"numeric"</code>. The numeric values that constitute the matrix, stored in column-major order.</p> </dd> <dt><code>Dim</code>:</dt><dd><p>Object of class <code>"integer"</code>. The dimensions of the matrix which must be a two-element vector of non-negative integers.</p> </dd> <dt><code>Dimnames</code>:</dt><dd><p>inherited from class <code>"Matrix"</code></p> </dd> <dt><code>factors</code>:</dt><dd><p>Object of class <code>"list"</code>. A named list of factorizations that have been computed for the matrix.</p> </dd> <dt><code>sd</code>:</dt><dd><p>(for <code>"corMatrix"</code>) a <code><a href="../../base/html/numeric.html">numeric</a></code> vector of length <code>n</code> containing the (original) <i>sqrt(var(.))</i> entries which allow reconstruction of a covariance matrix from the correlation matrix.</p> </dd> </dl> <h3>Extends</h3> <p>Class <code>"dsyMatrix"</code>, directly.<br /> Classes <code>"dgeMatrix"</code>, <code>"symmetricMatrix"</code>, and many more by class <code>"dsyMatrix"</code>. </p> <h3>Methods</h3> <dl> <dt>chol</dt><dd><p><code>signature(x = "dpoMatrix")</code>: Returns (and stores) the Cholesky decomposition of <code>x</code>, see <code><a href="chol.html">chol</a></code>.</p> </dd> <dt>determinant</dt><dd><p><code>signature(x = "dpoMatrix")</code>: Returns the <code><a href="../../base/html/det.html">determinant</a></code> of <code>x</code>, via <code>chol(x)</code>, see above.</p> </dd> <dt>rcond</dt><dd><p><code>signature(x = "dpoMatrix", norm = "character")</code>: Returns (and stores) the reciprocal of the condition number of <code>x</code>. The <code>norm</code> can be <code>"O"</code> for the one-norm (the default) or <code>"I"</code> for the infinity-norm. For symmetric matrices the result does not depend on the norm.</p> </dd> <dt>solve</dt><dd><p><code>signature(a = "dpoMatrix", b = "....")</code></p> </dd></dl> <p>, and </p> <dl> <dt>solve</dt><dd><p><code>signature(a = "dppMatrix", b = "....")</code></p> </dd></dl> <p>work via the Cholesky composition, see also the Matrix <code><a href="solve-methods.html">solve-methods</a></code>. </p> <dl> <dt>Arith</dt><dd><p><code>signature(e1 = "dpoMatrix", e2 = "numeric")</code> (and quite a few other signatures): The result of (“elementwise” defined) arithmetic operations is typically <em>not</em> positive-definite anymore. The only exceptions, currently, are multiplications, divisions or additions with <em>positive</em> <code>length(.) == 1</code> numbers (or <code><a href="../../base/html/logical.html">logical</a></code>s).</p> </dd> </dl> <h3>See Also</h3> <p>Classes <code><a href="dsyMatrix-class.html">dsyMatrix</a></code> and <code><a href="dgeMatrix-class.html">dgeMatrix</a></code>; further, <code><a href="Matrix.html">Matrix</a></code>, <code><a href="rcond.html">rcond</a></code>, <code><a href="../../base/html/chol.html">chol</a></code>, <code><a href="../../base/html/solve.html">solve</a></code>, <code><a href="matrix-products.html">crossprod</a></code>. </p> <h3>Examples</h3> <pre> h6 <- Hilbert(6) rcond(h6) str(h6) h6 * 27720 # is ``integer'' solve(h6) str(hp6 <- as(h6, "dppMatrix")) ### Note that as(*, "corMatrix") *scales* the matrix (ch6 <- as(h6, "corMatrix")) stopifnot(all.equal(h6 * 27720, round(27720 * h6), tolerance = 1e-14), all.equal(ch6@sd^(-2), 2*(1:6)-1, tolerance= 1e-12)) chch <- chol(ch6) stopifnot(identical(chch, ch6@factors$Cholesky), all(abs(crossprod(chch) - ch6) < 1e-10)) </pre> <hr /><div style="text-align: center;">[Package <em>Matrix</em> version 1.2-17 <a href="00Index.html">Index</a>]</div> </body></html>