components.TRMF: Access TRMF factors

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/Methods.R

Description

This function returns the factors (Xm, Fm) from a trained TRMF object

Usage

1
2
## S3 method for class 'TRMF'
components(object, XorF = c("Xm","Fm"), ...)

Arguments

object

trained TRMF object

XorF

which factor to return

...

ignored

Details

Returns the matrix factors. Could also use object$Factors$Xm, object$Factors$Fm . If matrix normalization was used in create_TRMF, Xm%*%Fm could look much different than the input data matrix.

Value

A matrix.

Author(s)

Chad Hammerquist

See Also

create_TRMF, TRMF_columns, TRMF_trend

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# create test data
xm = poly(x = (-10:10)/10,degree=4)
fm = matrix(rnorm(40),4,10)
Am = xm%*%fm+rnorm(210,0,.2)

# create model
obj = create_TRMF(Am)
out = train(obj)
plot(out)
components(out,"Xm")

TRMF documentation built on Aug. 16, 2021, 5:06 p.m.