<!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: Tensor product for penalty matrices</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="https://rpkg.net/assets/examples.css" />
</head><body>

<table width="100%" summary="page for tensor.prod.S"><tr><td>tensor.prod.S</td><td style="text-align: right;">R Documentation</td></tr></table>

<h2>Tensor product for penalty matrices</h2>

<h3>Description</h3>

<p>Computes the penalty matrices of a tensor product smooth from the marginal penalty matrices. The code is from
function <code>tensor.prod.penalties</code> in <code>mgcv</code> package.
</p>


<h3>Usage</h3>

<pre>
tensor.prod.S(S)
</pre>


<h3>Arguments</h3>

<table summary="R argblock">
<tr valign="top"><td><code>S</code></td>
<td>
<p>list of m marginal penalty matrices</p>
</td></tr>
</table>


<h3>Value</h3>

<table summary="R valueblock">
<tr valign="top"><td><code>TS</code></td>
<td>
<p>List of the penalty matrices associated with the tensor product smooth</p>
</td></tr>
</table>


<h3>Examples</h3>

<pre>

library(survPen)

# tensor product between three penalty matrices
set.seed(15)

S1 &lt;- matrix(rnorm(3*3),nrow=3,ncol=3)
S2 &lt;- matrix(rnorm(2*2),nrow=2,ncol=2)

S1 &lt;- 0.5*(S1 + t(S1) ) ; S2 &lt;- 0.5*(S2 + t(S2) )

tensor.prod.S(list(S1,S2))

</pre>


</body></html>
