| plus_mfd | R Documentation |
Adds two objects of class mfd (elementwise on their coefficient arrays).
The two objects must share the same basis system and number of variables.
If one object contains a single replication (i.e., one observation) and the
other contains multiple, the single replication is replicated across
observations before addition.
plus_mfd(mfdobj1, mfdobj2)
## S3 method for class 'mfd'
mfdobj1 + mfdobj2
mfdobj1, mfdobj2 |
Objects of class |
If mfdobj2 is missing, the function returns mfdobj1 unchanged
(i.e., unary plus).
Let the coefficient arrays have dimensions (nbasis, nobs, nvar).
The following checks/rules are enforced:
Both inputs must be mfd objects; otherwise an error is thrown.
The basis systems must be identical (checked via identical()).
The number of variables must match.
For the number of 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.
An object of class mfd with coefficients equal to the (possibly
replicated) sum of the inputs. The fdnames are taken from the input
providing the observation indexing after replication (if any), otherwise
from mfdobj1.
nobs, nbasis, nvar, mfd
# Assuming mfdobj_a and mfdobj_b are 'mfd' objects on the same basis:
# mfdobj_a + mfdobj_b
# plus_mfd(mfdobj_a, mfdobj_b)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.