Learn R Programming

otsfeatures (version 1.0.0)

ordinal_location_1: Computes the standard estimated location of an ordinal time series

Description

ordinal_location_1 computes the standard estimated location of an ordinal time series

Usage

ordinal_location_1(series, states, distance = "Block", normalize = FALSE)

Value

The standard estimated location.

Arguments

series

An OTS.

states

A numerical vector containing the corresponding states.

distance

A function defining the underlying distance between states. The Hamming, block and Euclidean distances are already implemented by means of the arguments "Hamming", "Block" (default) and "Euclidean". Otherwise, a function taking as input two states must be provided.

normalize

Logical. If normalize = FALSE (default), the value of the standard estimated location is returned. Otherwise, the function returns the normalized standard estimated location.

Author

Ángel López-Oriona, José A. Vilar

Details

Given an OTS of length \(T\) with range \(\mathcal{S}=\{s_0, s_1, s_2, \ldots, s_n\}\) (\(s_0 < s_1 < s_2 < \ldots < s_n\)), \(\overline{X}_t=\{\overline{X}_1,\ldots, \overline{X}_T\}\), the function computes the standard estimated location given by \(\widehat{x}_{loc, d}=\)argmin\(_{s \in \mathcal{S}}\frac{1}{T}\sum_{t=1}^Td\big(\overline{X}_t, s\big)\), where \(d(\cdot, \cdot)\) is a distance between ordinal states.

References

weiss2019distanceotsfeatures

Examples

Run this code
estimated_location <- ordinal_location_1(series = AustrianWages$data[[100]],
states = 0 : 5) # Computing the standard location estimate
# for one series in dataset AustrianWages using the block distance

Run the code above in your browser using DataLab