| times_mfd | R Documentation |
Computes the elementwise (pointwise) product of two objects of class mfd,
returning an mfd on the same basis. If one object contains a single
replication (one observation) and the other contains multiple, the single
replication is recycled across observations before multiplication.
times_mfd(mfdobj1, mfdobj2)
## S3 method for class 'mfd'
mfdobj1 * mfdobj2
mfdobj1, mfdobj2 |
Objects of class |
Alternatively, it also compute the product of an mfd object with a numeric scalar.
Let coefficient arrays have dimensions (nbasis, nobs, nvar).
The function:
requires both inputs to be mfd objects;
requires identical basis systems (checked with identical());
requires the same number of variables;
for observations: if both nobs_1 and nobs_2 are greater
than one, they must be equal; otherwise, the object with
nobs = 1 is replicated to match the other.
Internally, coefficient arrays are converted to fd objects
and multiplied via times.fd, with basisobj set to
the common basis so that the result is re-expanded on the same basis.
An object of class mfd whose coefficients are the pointwise product
of the inputs (with recycling if needed). The basis is the common input
basis. The fdnames are inherited from the input that supplies the
observation indexing after any replication.
plus_mfd, minus_mfd,
nobs, nvar, nbasis,
times.fd, mfd
# Assuming mfdobj_a and mfdobj_b are 'mfd' objects on the same basis:
# mfdobj_a * mfdobj_b # elementwise product
# 2 * mfdobj_a # scalar multiplication
# mfdobj_a * 0.5 # scalar multiplication
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.