calculateEle314151: Calculate Elements 31, 41, and 51

Description Usage Arguments Details Value

Description

This function computes elements 31, 41, and 51 according to the AUPUS logic. The rules are as follows:

Usage

1
calculateEle314151(aupusParam, data)

Arguments

aupusParam

A list of running parameters to be used in pulling the data. Typically, this is generated from getAupusParameter (see that function for a description of the required elements).

data

The AUPUS node dataset, typically as produced by buildNodes.

Details

If exactly one of the three elements is missing, then that element is computed from the others using the relationship 51 = 31 * 41 / divisionFactor (i.e. "balancing").

If none of the three elements are missing, then any computed or trended values are recomputed. This is done by first attempting to balance: if only one value needs to be recomputed, it is done so by balancing. If more than one value needs to be recomputed, we first "trend" element 31 (see ?trendOnce). With element 31 recomputed, we now attempt to balance again. If we still cannot balance (i.e. 41 and 51 are still missing) we trend element 41. Now, as element 51 is the only missing value, it is computed via balancing.

Note that in one dataset, all of these different cases are possible (given different configurations for different years/countries). This function takes that into account and performs the appropriate approach for each case.

Value

This function returns a list (of length two) of integer vectors containing the row numbers of observations which were updated (first by updating missing values, second by retrending). However, it also has a side effect: rows within the passed data.table ("data") have element 31/41/51's value(s) and symbol(s) updated.


SWS-Methodology/faoswsAupus documentation built on May 9, 2019, 11:45 a.m.