tindex: Calculating theoretical (expected) values of the unweighted...

View source: R/f_bilateral_indices.R

tindexR Documentation

Calculating theoretical (expected) values of the unweighted price index

Description

This function calculates the theoretical value of the unweighted price index for lognormally distributed prices.

Usage

tindex(pmi = c(), psigma = c(), start, ratio = TRUE)

Arguments

pmi

A numeric vector indicating mi parameters for lognormally distributed prices from the subsequent months.

psigma

A numeric vector indicating sigma parameters for lognormally distributed prices from the subsequent months.

start

The first period in the generated data frame (as character) limited to the year and month, e.g. '2019-12'.

ratio

A logical parameter indicating how we define the theoretical unweighted price index. If it is set to TRUE, then the resulting value is a ratio of expected price values from compared months; otherwise the resulting value is the expected value of the ratio of prices from compared months.

Value

This function calculates the theoretical value of the unweighted price index for lognormally distributed prices (the month defined by start parameter plays a role of the fixed base period). The characteristics for these lognormal distributions are set by pmi and sigma parameters. The ratio parameter allows to control the definition of resulting theoretical price index values. The function provides a data frame consisting of dates and corresponding expected values of the theoretical unweighted price index. The generated dataset is ready for further price index calculations.

Examples

tindex(pmi=c(1,1.2,1.3),psigma=c(0.1,0.2,0.15),start="2020-01")
tindex(pmi=c(1,1.2,1.3),psigma=c(0.1,0.2,0.15),start="2020-01",ratio=FALSE)

PriceIndices documentation built on July 9, 2023, 6:20 p.m.