components.TRMF {TRMF}R Documentation

Access TRMF factors

Description

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

Usage

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

Arguments

object

trained TRMF object

XorF

which factor to return

...

ignored

Details

Returns the matrix factors. If matrix normalization was used in create_TRMF, Xm%*%diag(Z)%*%Fm could look much different than the input data matrix. If external regressor were included in the model and XorF = "F_each" then a returns a list with Fm split up by parts.

Value

A matrix or vector, or a possibly a list if XorF = "F_each".

Author(s)

Chad Hammerquist

See Also

create_TRMF, TRMF_columns, TRMF_trend

Examples

# 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")


[Package TRMF version 0.2.1 Index]