montgomeryDecomposition: Montgomery Decomposition for Input-Output model

View source: R/montgomeryDecomposition.R

montgomeryDecompositionR Documentation

Montgomery Decomposition for Input-Output model

Description

TO INCLUDE. A description of the Montgomery Decomposition

Usage

montgomeryDecomposition(.l, .decFormula, .output = "default")

Arguments

.l

A list with the variables from the equation to be decomposed.

.decFormula

A string that contains

.output

The desired display form of the decomposition results. Must be a character. See details for more information

Details

TO INCLUDE. The details of how the function works.

Value

The output of the function depends on the

The function output value will vary accordingly to the .output parameter.

* If .output parameter is "default" or, for shortcut, "D", the function will return a list with the contributions of each variable in a matrices with dimensions of the model output.

* If .output parameter is "aggregated" or, for shortcut, "Agg", the function will return a list with the aggregated value for each variable.

* If .output parameter is "vars" or, for shortcut, "V", the function will return a list with the contribution of each variable in the matrices in their dimensions.

* If .output parameter is "raw" or, for shortcut, "R", the funciton will return list with the contribuitions of each variable in an array with all the margins.

* If .output parameter is "all" or, for shortcut, "A", the function will return a list containg all of the cases above.

If the .output parameter is not given it will be set to "default". If one is given, but is it is none of the above, a warning will be displayed and the .output will be set to "all".

Examples

lofVars <- list("A" = list("t0" = matrix(runif(8), ncol=4), "t1" = matrix(runif(8), ncol=4)),
                "C" = list("t0" = matrix(runif(27), nrow=3), "t1" = matrix(runif(27), nrow=3)),
                "B" = list("t0" = matrix(runif(12), nrow=4), "t1" = matrix(runif(12), nrow=4)),
                "D" = list("t0" = matrix(runif(27), nrow =3), "t1"= matrix(runif(27), nrow=3)))

lofVars %>% montgomeryDecomposition("A%*%B%*%C", "all")

lofVars %>% montgomeryDecomposition("A%*%B%*%C*D", "all")



MarceloRTonon/montgomeRy documentation built on April 21, 2022, 3:57 a.m.