%dot% | R Documentation |
The dot product between arrays with different dimensions is computed by taking the inner product on the last dimensions of the two arrays.
x %dot% y
x |
|
y |
|
The dot product between two arrays A
and B
is computed as:
C_{i_1… i_m} = ∑_{j_1… j_n} A_{i_1… i_mj_1… j_n}B_{j_1… j_n}
array
.
Guidotti E (2022). "calculus: High-Dimensional Numerical and Symbolic Calculus in R." Journal of Statistical Software, 104(5), 1-37. doi: 10.18637/jss.v104.i05
Other basic arithmetic:
%diff%()
,
%div%()
,
%inner%()
,
%kronecker%()
,
%outer%()
,
%prod%()
,
%sum%()
### inner product x <- array(1:12, dim = c(3,4)) x %dot% x ### dot product x <- array(1:24, dim = c(3,2,4)) y <- array(letters[1:8], dim = c(2,4)) x %dot% y
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.