Learn R Programming

rrcov3way (version 0.5-0)

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, ...)

Value

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

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.

Author

Valentin Todorov valentin.todorov@chello.at and Maria Anna Di Palma madipalma@unior.it and Michele Gallo mgallo@unior.it

References

Kroonenberg (2008). Applied multiway data analysis. Wiley series in probability and statistics. Hoboken NJ, Wiley.

Examples

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

    ## Same as above - the centering and scaling is done inside the Parafac procedure
    (cp1 <- Parafac(elind, ncomp=3, const=c("orth", "none", "none"), 
        center=TRUE, scale=TRUE))

    ## Robust estimation with robust scaling with median and mad
    (cp1 <- Parafac(elind, ncomp=3, const=c("orth", "none", "none"), 
        center=median, scale=mad, robust=TRUE))

    ## Robust estimation with robust scaling with median and Qn (Rousseeuw and Croux, 1993)
    require(robustbase)
    (cp1 <- Parafac(elind, ncomp=3, const=c("orth", "none", "none"), 
        center=median, scale=Qn, robust=TRUE))

Run the code above in your browser using DataLab