Transformation-class: A Transformation, i.e. a Two-Way Mapping

Description Slots Examples

Description

This class holds two mutually inverse functions for transforming data, i.e., allows us to transform data forward and backward. It should hold b@backward(b@forward(x))==x for a Transformation b and values x in the domain of the Transformation. At the same time, b@forward(b@backward(y))==y should hold for all y in the image of the Transformation.

A transformation is furthermore accompanied by a positive complexity. Only Transformation.identity has complexity 0L. All other transformations should have a larger complexity. If we simply log-scale some data (e.g., via Transformation.log) by just applying the log function, this could have complexity 1L. If we have a transformation involving n variables whose values we decide upon, then we should pick complexity n+1L: If we first move the data by 3 units and then divide it by 2, i.e., apply something like (x+3)/2, this transformation should have a complexity of 3 - we chose two values and applied them in a function.

Slots

forward

the foward transformation function

backward

the inverse of the transformation function, i.e., the backwards transformation

complexity

a measure of the transformation complexity, e.g., one plus the number of constants involved in the transformation - only the identity transformation has complexity 0

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
new("Transformation", forward=sin, backward=asin, complexity=1L)
# An object of class "Transformation"
# Slot "forward":
# function (x)  .Primitive("sin")
#
# Slot "backward":
# function (x)  .Primitive("asin")
#
# Slot "complexity":
# [1] 1

thomasWeise/dataTransformeR documentation built on May 14, 2019, 8:03 a.m.