Element-wise Subtraction for Hybrid Data Objects
dot-hd.Rd
Performs element-wise subtraction of two objects of class hdClass
, fdClass
, rdClass
, or imgClass
,
assuming they have identical dimensions. This operator is useful for iterative model fitting, residual computation, or
gradient-based updates in hybrid data decomposition.
Details
The dimensions of the two input objects must match exactly. Attributes from obj1
are preserved.
Examples
fd1 <- fdClass(matrix(1:9, 3, 3))
fd2 <- fdClass(matrix(1, 3, 3))
fd_diff <- fd1 - fd2
print(fd_diff)
#> Functional Data (fdClass) Object
#> -----------------------------------
#> Dimensions: 3 x 3
#> Smoothing Parameter: 0
#> Sparsity Parameter: 0
#> GridPoints_v: 0.3333333 0.6666667 1
#> -----------------------------------
#> First few rows and columns of the data:
#> V1 V2 V3
#> [1,] 0 3 6
#> [2,] 1 4 7
#> [3,] 2 5 8