---
title: "Terminology"
output: rmarkdown::html_vignette
vignette: >
  %\VignetteIndexEntry{Terminology}
  %\VignetteEncoding{UTF-8}
  %\VignetteEngine{knitr::rmarkdown}
---

```{r setupvignette, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
options(scipen = 999)
```

## Introduction

This vignette reviews the terminology used in input–output analysis, with reference to the *Eurostat Manual of Supply, Use and Input–Output Tables* (Beutel, 2008).

This vignette is therefore descriptive, documenting how the `iotables` package uses *Eurostat-style terminology* consistent with ESA 2010 and the System of National Accounts (SNA 2008).

```{r setup}
library(iotables)
```

Retrieve the demo dataset, the Germany 1995 Symmetric Input-Output Table:

```{r germany}
germany_siot <- iotable_get()
```

## Structure of input–output tables

An *input–output table (IOT)* describes the flow of products and services in an economy, linking industries (producers) with their inputs, outputs, and final uses. In a *symmetric input–output table (SIOT***)**, both rows and columns represent either products or industries.

Eurostat distinguishes four *quadrants* of a SIOT:

| Quadrant | Description | ESA 2010 / SNA 2008 Category |
|------------------------|------------------------|------------------------|
| **I** | Intermediate consumption — flows between industries or products | *Intermediate use* |
| **II** | Final demand — purchases by households, government, investment, exports | *Final use* |
| **III** | Primary inputs — compensation of employees, net taxes, gross operating surplus | *Primary inputs* |
| **IV** | Output totals — column sums at basic prices | *Output (P.1)* |

Quadrants I–III correspond to the *rows* of the table, while the column totals in Quadrant IV represent the total output of each industry or product.

## Core matrices and notation

Input–output analysis is built on a small set of matrices and vectors.\
The `iotables` package follows the same notation used in Beutel (2008).

| Symbol | Meaning | Definition | Function in `iotables` |
|------------------|------------------|------------------|------------------|
| **Z** | Intermediate-consumption matrix | Flows of products between industries | `iotable_get()` |
| **A** | Input (technical) coefficient matrix | $A_{ij} = Z_{ij} / X_{j}$` | `input_coefficient_matrix_create()` |
| **(I − A)** | Leontief matrix | Identity minus A | `leontief_matrix_create()` |
| **L = (I − A)⁻¹** | Leontief inverse | Total (direct + indirect) requirements | `leontief_inverse_create()` |
| **f** | Final-demand vector | Exogenous demand by category | retrieved from IOT |
| **x = Lf** | Total output vector | Fundamental Leontief equation | – |

**Eurostat equation references:**

-   $a_ij$ = $x_ij$ / $x_j$ — technical coefficient (19), (43) identical formulations for SIOTs

-   $x$ = $(I − A)⁻¹$ — total output

## Input and output coefficients

### Input coefficients (technical coefficients)

Each element of the **input coefficient matrix** A shows the share of input *i* used in producing one unit of output of industry *j*: 

$$
a_{ij} = \frac{x_{ij}}{x_j}
$$

where\
- $a_{ij}$ = input coefficient for domestic goods and services\
- $x_{ij}$ = flow of product *i* to industry *j* (a cell in Quadrant I)\
- $x_j$ = total output of industry *j*

These coefficients are sometimes called **direct requirements** or **technical coefficients**.

hey are computed in `iotables` by:

```{r inputcoeff}
input_coefficient_matrix_create(
  data_table = iotable_get(source = "germany_1995"),
  digits = 4
)
```

### Output coefficients

The output coefficient matrix (Ghosh-type) expresses how the output of industry i is distributed across purchasing sectors j:

$$o_{ij} = \frac{x_{ij}}{x_i}$$

where

-   $o_{ij}$ = output coefficient (distribution ratio)

-   $x_{ij}$ = flow of product *i* to industry *j*

-   $x_{i}$ = total output of product *i*

These ratios describe the supply-side distribution structure and are computed by `output_coefficient_matrix_create()`.

## Linkages between industries (inter-industry analysis)

Two types of linkages are typically analysed:

-   **Backward linkage** – measures the strength of a sector’s demand on its suppliers.\
    It is given by the **column sum** of input coefficients or, when based on the Leontief inverse, includes all indirect effects through the supply chain.

-   **Forward linkage** – measures the influence of a sector as a supplier to others. It is given by the **row sum** of output coefficients, describing how the sector’s output feeds into other industries.

## Indicators and multipliers

### Direct indicators

An **input indicator** represents a specific row of the coefficient matrix A,\
for example value added (GVA), labour, or emissions per unit of output.

```{r inputindicatr}
input_indicator_create(
  data_table = iotable_get(), input_row = "gva"
)
```

### Multipliers

The income, product, employment, or emission multipliers are calculated with the following generic formula: 


$$
(63) Z = B(I-A)^{1}
$$
- $B$ = matrix of input coefficients for primary input (income, employment, product, or pollutant)
- $I$ = unit matrix
- $A$ = matrix of input coefficients for intermediates
- $Y$ = Diagonal matrix for final demand by product
- $Z$ = matrix with results for direct and indirect requirements for primary inputs[^multipliers].

[^multipliers]: In the *Eurostat Manual*, the calculations are shown with (63) wages, (64) employment, (65) capital. 

**Embodied emissions in final demand**:\
 
$$
(66) Z = B(I-A)^{1}Y
$$

- $B$ = matrix of input coefficients for primary input
- $I$ = unit matrix
- $A$ = matrix of input coefficients for intermediates
- $Y$ = Diagonal matrix for final demand by product
- $Z$ = matrix with results for direct and indirect requirements for primary inputs

See  *Eurostat Manual of Supply, Use and Input–Output Tables* (Beutel, 2008, pp.503-506.)

### Output coefficients

The output coefficients are ratios derived from quadrant I (intermediates) and quadrant II (final demand) of a sector.

The `output_coefficient_matrix_create()` function creates these coefficients based on equation (5) in the Eurostat Manual.

(5) $o_{ij}$ = $x_{ij}$ / $x_i$

$o_{ij}$ = output coefficient for domestic goods and services (i = 1, ..., 6; j = 1, ..., 6) $x_{ij}$ = flow of commodity i to sector j $x_j$ = output of sector i

## Summary of key equations

| No.        | Formula                     | Description                      |
|:---------------|:-------------------------|:-----------------------------|
| (5)        | $o_{ij}$ = $x_{ij}$ / $x_i$ | Output coefficient (Ghosh model) |
| (9)        | $a_{ij}$ = $x_{ij}$ / $x_j$ | Input (technical) coefficient    |
| (19), (43) | –                           | Identical to (9) for SIOTs       |
| (47)       | $x$ = $(I - A)^{-1}$        | Leontief model for total output  |
| (L)        | $L$ = $(I - A)^{-1}$        | Leontief inverse                 |
| (m)        | $m$ = $a \times L$          | Multiplier equation              |

## Validation summary (Eurostat Manual, Beutel 2008)

All analytical functions of `iotables` reproduce the benchmark examples from Beutel (2008), *Eurostat Manual of Supply, Use and Input–Output Tables.*

| Function | Concept | Beutel Table | Page |
|:-----------------|:-----------------|:-----------------|:----------------:|
| `input_coefficient_matrix_create()` | Direct requirements (A) | 15.6 | 485 |
| `leontief_matrix_create()` | Leontief matrix $(I − A)$ | 15.9 | 487 |
| `leontief_inverse_create()` | Total requirements ($L$ = $(I − A)^{1}$) | 15.10 | 488 |
| `supplementary_add()` | Environmental extension (CO₂, CH₄) | 15.13 | 494 |
| `input_indicator_create()` | Input indicators (GVA, Compensation) | 15.14 | 498 |
| `multiplier_create()` | Total multipliers (GVA, Employment) | 15.16 | 503–504 |

## References

-   **Beutel, J.** (2008). *Eurostat Manual of Supply, Use and Input–Output Tables.*\
    Luxembourg: Office for Official Publications of the European Communities.
-   **United Nations** (2018). *Handbook on Supply and Use Tables and Input–Output Tables with Extensions and Applications*, Rev. 1.\
    New York: United Nations.
-   **OECD** (2021). *Inter-Country Input–Output (ICIO) Manual.* Paris: OECD Publishing.
-   **United Nations** (2012). *System of Environmental-Economic Accounting 2012: Central Framework.*\
    New York: United Nations.
