
Last chance! 50% off unlimited learning
Sale ends in
Last chance! 50% off unlimited learning
Sale ends in
"MixComp"
Generalised inner product and methods for class MixComp. The methods for MixComp provide for very convenient computing with MixAR models.
inner(x, y, star = "*", plus = .mplus)
the inner product, the type of the result depends on the arguments
the first argument.
the second argument.
function to apply to pairs of elements from x
and y
,
default is multiplication, as for the usual inner product.
function to apply to combine the results from the pairs, default is addition, as for the usual inner product.
Methods for inner product between a "MixComp"
object and a
vector are similar to a product between a matrix and a vector but
comply with the conventions of class "MixComp"
. For this reason
they are described in the help page for class
"MixComp"
, along with methods for other functions
and operators applied to "MixComp"
objects.
signature(x = "ANY", y = "ANY", star = "ANY", plus = "ANY")
This is the default method, see section Details.
signature(x = "MixComp", y = "missing", star = "missing", plus = "missing")
see "MixComp"
.
signature(x = "MixComp", y = "numeric", star = "missing", plus = "missing")
see "MixComp"
.
signature(x = "numeric", y = "MixComp", star = "missing", plus = "missing")
see "MixComp"
.
signature(x = "MixComp", y = "numeric", star = "ANY", plus = "ANY")
see "MixComp"
.
signature(x = "MixComp", y = "numeric", star = "ANY", plus = "missing")
see "MixComp"
.
inner
computes a generalised inner product x . y
, where
multiplication and summation can be replaced by other functions.
The default method of inner
applies star
to the
corresponding pairs of elements and combines them with plus
.
There is no recycling, if x
and y
have different
lengths, an error is raised. The elements of x
and y
are accessed with "[[". plus
should be an n
-ary
operation.
"MixComp"
inner(1:3, 2:4) # [1] 20
class(inner(1:3, 2:4)) # [1] "integer"
## compare to:
1:3 %*% 2:4 # 20, but (1,1)-matrix
class(1:3 %*% 2:4) # matrix
Run the code above in your browser using DataLab