You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<pclass="p5"><spanclass="s5"><b>Returns the result of matrix multiplication</b> of </span><spanclass="s6">x</span><spanclass="s5"> with </span><spanclass="s6">y</span><spanclass="s5">.<spanclass="Apple-converted-space"></span>In Eidos (as in R), with two matrices </span><spanclass="s6">A</span><spanclass="s5"> and </span><spanclass="s6">B</span><spanclass="s5"> the simple product </span><spanclass="s6">A * B</span><spanclass="s5"> multiplies the corresponding elements of the matrices; in other words, if </span><spanclass="s6">X</span><spanclass="s5"> is the result of </span><spanclass="s6">A * B</span><spanclass="s5">, then </span><spanclass="s6">X</span><spanclass="s21"><i><sub>ij</sub></i></span><spanclass="s5"> = </span><spanclass="s6">A</span><spanclass="s21"><i><sub>ij</sub></i></span><spanclass="s5"> * </span><spanclass="s6">B</span><spanclass="s21"><i><sub>ij</sub></i></span><spanclass="s5">.<spanclass="Apple-converted-space"></span>This is parallel to the definition of other operators; A + B adds the corresponding elements of the matrices (</span><spanclass="s6">X</span><spanclass="s21"><i><sub>ij</sub></i></span><spanclass="s5"> = </span><spanclass="s6">A</span><spanclass="s21"><i><sub>ij</sub></i></span><spanclass="s5"> + </span><spanclass="s6">B</span><spanclass="s21"><i><sub>ij</sub></i></span><spanclass="s5">), etc.<spanclass="Apple-converted-space"></span>In R, true matrix multiplication is achieved with a special operator, </span><spanclass="s6">%*%</span><spanclass="s5">; in Eidos, the </span><spanclass="s6">matrixMult()</span><spanclass="s5"> function is used instead.</span></p>
380
380
<pclass="p5"><spanclass="s5">Both </span><spanclass="s6">x</span><spanclass="s5"> and </span><spanclass="s6">y</span><spanclass="s5"> must be matrices, and must be conformable according to the standard definition of matrix multiplication (i.e., if </span><spanclass="s6">x</span><spanclass="s5"> is an <i>n</i> × <i>m</i> matrix then </span><spanclass="s6">y</span><spanclass="s5"> must be a <i>m</i> × <i>p</i> matrix, and the result will be a <i>n</i> × <i>p</i> matrix).<spanclass="Apple-converted-space"></span>Vectors will not be promoted to matrices by this function, even if such promotion would lead to a conformable matrix.</span></p>
<pclass="p5"><b>Returns the result of raising matrix </b><spanclass="s2"><b>x</b></span><b> to an </b><spanclass="s2"><b>integer</b></span><b></b><spanclass="s2"><b>power</b></span><b>.</b><spanclass="Apple-converted-space"></span>The parameter x must be a square matrix (or an error will be raised).<spanclass="Apple-converted-space"></span>This operation is performed by repeated matrix multiplication with <spanclass="s2">matrixMult()</span>, and uses <spanclass="s2">inverse()</span> to compute the inverse of the matrix if <spanclass="s2">power</span> is negative.</p>
381
383
<pclass="p2">(integer$)nrow(* x)</p>
382
384
<pclass="p5"><spanclass="s5"><b>Returns the number of rows</b> in matrix or array </span><spanclass="s6">x</span><spanclass="s5">.<spanclass="Apple-converted-space"></span>For vector </span><spanclass="s6">x</span><spanclass="s5">, </span><spanclass="s6">nrow()</span><spanclass="s5"> returns </span><spanclass="s6">NULL</span><spanclass="s5">; </span><spanclass="s6">size()</span><spanclass="s5"> should be used.<spanclass="Apple-converted-space"></span>An equivalent of R’s </span><spanclass="s6">NROW()</span><spanclass="s5"> function, which treats vectors as </span><spanclass="s6">1</span><spanclass="s5">-column matrices, is not provided but would be trivial to implement as a user-defined function.</span></p>
0 commit comments