

   kronecker {base}                             R Documentation

   KKrroonneecckkeerr PPrroodduucctt ooff AArrrraayyss

   DDeessccrriippttiioonn::

        Computes the generalised kronecker product of two
        arrays, `X' and `Y'.  `kronecker(X, Y)' returns an
        array `A' with dimensions `dim(X) * dim(Y)'.

   UUssaaggee::

        kronecker(X, Y, FUN="*", ...)
        X %x% Y

   AArrgguummeennttss::

          X: vector or array.

          Y: vector or array.

        FUN: a function, possibly specified as character
             (string).

        ...: optional arguments to be passed to `FUN'.

   DDeettaaiillss::

        If `X' and `Y' do not have the same number of dimen-
        sions, the smaller array is padded with dimensions of
        size one.  `A' consists of submatrices constructed by
        taking `X' one term at a time and expanding that term
        as `FUN(x, Y, ...)'.

        `%x%' is an `.Alias' for `kronecker' (where `FUN' is
        hardwired to `"*"').

   AAuutthhoorr((ss))::

        Jonathan Rougier

   RReeffeerreenncceess::

        Shayle R. Searle (1982).  Matrix Algebra Useful for
        Statistics; John Wiley and Sons.

   SSeeee AAllssoo::

        `outer' on which `kronecker' is built and `matmult' for
        usual matrix multiplication.

   EExxaammpplleess::

        # simple scalar multiplication
        ( M <- matrix(1:6, ncol=2) )
        all(kronecker(4, M)==4 * M)

        ( A <- matrix(0:3, ncol=2) )
        A %x% cbind(2:3)
        # Block diagonal array:
        kronecker(diag(3), M)
        all(kronecker(diag(3), M) == diag(3) %x% M)

