Skip to contents

These functions use Recca::chop_R() and Recca::chop_Y() internally to calculate new ECCs for each column in the R matrix and for each row and column for the Y matrix.

Usage

chop_R_eccs(
  .psut_data,
  countries,
  years,
  do_chops,
  method = "SVD",
  tol_invert = .Machine$double.eps
)

chop_Y_eccs(
  .psut_data,
  countries,
  years,
  do_chops,
  method = "SVD",
  tol_invert = .Machine$double.eps
)

Arguments

.psut_data

A data frame of PSUT matrices. It should be wide by matrices.

countries

The countries to analyze.

years

The years to analyze.

do_chops

A boolean that tells whether to do the R and Y chops.

method

Tells how to invert matrices. Default is "SVD". See details.

tol_invert

The tolerance for detecting linear dependencies in the columns of matrices to be inverted. Default is .Machine$double.eps.

Value

A data frame of chopped R or Y matrix ECCs.

Details

Chopping in the R and Y matrices and calculating a new ECC involves a matrix inversion step. The method argument specifies which method should be used for calculating the inverse. See matsbyname::invert_byname() for additional details.

Both tol_invert and method should be a single values and apply to all matrices being inverted.

When do_chops is FALSE, a data frame is returned with no rows and the same columns as .psut_data.