EVOLUTION-MANAGER
Edit File: kronecker.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: Kronecker Products on Arrays</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 kronecker {base}"><tr><td>kronecker {base}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Kronecker Products on Arrays</h2> <h3>Description</h3> <p>Computes the generalised kronecker product of two arrays, <code>X</code> and <code>Y</code>. </p> <h3>Usage</h3> <pre> kronecker(X, Y, FUN = "*", make.dimnames = FALSE, ...) X %x% Y </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>X</code></td> <td> <p>A vector or array.</p> </td></tr> <tr valign="top"><td><code>Y</code></td> <td> <p>A vector or array.</p> </td></tr> <tr valign="top"><td><code>FUN</code></td> <td> <p>a function; it may be a quoted string.</p> </td></tr> <tr valign="top"><td><code>make.dimnames</code></td> <td> <p>Provide dimnames that are the product of the dimnames of <code>X</code> and <code>Y</code>.</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>optional arguments to be passed to <code>FUN</code>.</p> </td></tr> </table> <h3>Details</h3> <p>If <code>X</code> and <code>Y</code> do not have the same number of dimensions, the smaller array is padded with dimensions of size one. The returned array comprises submatrices constructed by taking <code>X</code> one term at a time and expanding that term as <code>FUN(x, Y, ...)</code>. </p> <p><code>%x%</code> is an alias for <code>kronecker</code> (where <code>FUN</code> is hardwired to <code>"*"</code>). </p> <h3>Value</h3> <p>An array <code>A</code> with dimensions <code>dim(X) * dim(Y)</code>. </p> <h3>Author(s)</h3> <p>Jonathan Rougier</p> <h3>References</h3> <p>Shayle R. Searle (1982) <em>Matrix Algebra Useful for Statistics.</em> John Wiley and Sons. </p> <h3>See Also</h3> <p><code><a href="outer.html">outer</a></code>, on which <code>kronecker</code> is built and <code><a href="matmult.html">%*%</a></code> for usual matrix multiplication. </p> <h3>Examples</h3> <pre> # simple scalar multiplication ( M <- matrix(1:6, ncol = 2) ) kronecker(4, M) # Block diagonal matrix: kronecker(diag(1, 3), M) # ask for dimnames fred <- matrix(1:12, 3, 4, dimnames = list(LETTERS[1:3], LETTERS[4:7])) bill <- c("happy" = 100, "sad" = 1000) kronecker(fred, bill, make.dimnames = TRUE) bill <- outer(bill, c("cat" = 3, "dog" = 4)) kronecker(fred, bill, make.dimnames = TRUE) </pre> <hr /><div style="text-align: center;">[Package <em>base</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>