Learn R Programming

rrcov3way (version 0.1-10)

do3Postprocess: Postprocessing: renormalization, reflection and reordering; access to some of the components of the model.

Description

The estimated model will be renormalized, reflected (change of sign) or the components will be reordered. Functions that provide access to some components of the model: coordinates, weights.

Usage

# S3 method for tucker3
do3Postprocess(x, reflectA, reflectB, reflectC, reorderA, reorderB, reorderC, ...)
    # S3 method for parafac
do3Postprocess(x, reflectA, reflectB, reflectC, reorder, ...)
    # S3 method for parafac
coordinates(x, mode = c("A", "B", "C"), type = c("normalized", "unit", "principal"), ...)
    # S3 method for tucker3
coordinates(x, mode = c("A", "B", "C"), type = c("normalized", "unit", "principal"), ...)
    # S3 method for parafac
weights(object, ...)
    # S3 method for tucker3
weights(object, mode = c("A", "B", "C"), ...)
    # S3 method for parafac
reflect(x, mode = c("A", "B", "C"), rsign = 1, ...)
    # S3 method for tucker3
reflect(x, mode = c("A", "B", "C"), rsign = 1, ...)

Arguments

x

Tucker3 or Parafac solution

object

Tucker3 or Parafac solution (alternative of x for the generic function weights())

reflectA

How to handle the signs of the components of mode A - can be a single number or a vector with length of the number of components of A

reflectB

How to handle the signs of the components of mode B - can be a single number or a vector with length of the number of components of B

reflectC

How to handle the signs of the components of mode C - can be a single number or a vector with length of the number of components of C

reorder

How to reorder the components of a Parafac solution - a vector with length of the number of components

reorderA

How to reorder the components of mode A - a vector with length of the number of components of A giving the new order

reorderB

How to reorder the components of mode B - a vector with length of the number of components of B giving the new order

reorderC

How to reorder the components of mode C - a vector with length of the number of components of C giving the new order

mode

For which mode to provide the coordinates or weights. Default is mode A

type

Which type of coordinates to provide. Default is "normalized"

rsign

How to change the sign of the components of the given mode. Can be a single number or a vector with length of the number of components of the corresponding mode.

Potential further arguments passed to lower level functions.

Value

The output value of do3Postproces() is the postprocessed solution, Parafac or Tucker3. The output of weights() and coordinates() are the respoective values.

References

REFERENCES

Examples

Run this code
# NOT RUN {
    data(elind)
    x1 <- do3Scale(elind, center=TRUE, scale=TRUE)
    cp <- Parafac(x1, ncomp=3, orth="A")
    cp$B
    cp1 <- do3Postprocess(cp, reflectB=-1)      # change the sign of all components of B
    cp$B
    weights(cp1)
    coordinates(cp1)
    coordinates(cp1, type="principal")
# }

Run the code above in your browser using DataLab