Learn R Programming

lfl (version 2.2.0)

sobocinski: Modify algebra's way of computing with NA values.

Description

By default, the objects created with the algebra() function represent a mathematical algebra capable to work on the \([0,1]\) interval. If NA appears as a value instead, it is propagated to the result. That is, any operation with NA results in NA, by default. This scheme of handling missing values is also known as Bochvar's. To change this default behavior, the following functions may be applied.

Usage

sobocinski(algebra)

kleene(algebra)

dragonfly(algebra)

nelson(algebra)

lowerEst(algebra)

Value

A list of function of the same structure as is the list returned from the algebra() function

Arguments

algebra

the underlying algebra object to be modified -- see the algebra() function

Author

Michal Burda

Details

The sobocinski(), kleene(), nelson(), lowerEst() and dragonfly() functions modify the algebra to handle the NA in a different way than is the default. Sobocinski's algebra simply ignores NA values whereas Kleene's algebra treats NA as "unknown value". Dragonfly approach is a combination of Sobocinski's and Bochvar's approach, which preserves the ordering 0 <= NA <= 1 to obtain from compositions (see compose()) the lower-estimate in the presence of missing values.

In detail, the behavior of the algebra modifiers is defined as follows:

Sobocinski's negation for n being the underlying algebra:

an(a)
NA0

Sobocinski's operation for op being one of t, pt, c, pc, i, pi, s, ps from the underlying algebra:

bNA
aop(a, b)a
NAbNA

Sobocinski's operation for r from the underlying algebra:

bNA
ar(a, b)n(a)
NAbNA

Kleene's negation is identical to n from the underlying algebra.

Kleene's operation for op being one of t, pt, i, pi from the underlying algebra:

bNA0
aop(a, b)NA0
NANANA0
0000

Kleene's operation for op being one of c, pc, s, ps from the underlying algebra:

bNA1
aop(a, b)NA1
NANANA1
1111

Kleene's operation for r from the underlying algebra:

bNA1
ar(a, b)NA1
NANANA1
0111

Dragonfly negation is identical to n from the underlying algebra.

Dragonfly operation for op being one of t, pt, i, pi from the underlying algebra:

bNA01
aop(a, b)NA0a
NANANA0NA
00000
1bNA01

Dragonfly operation for op being one of c, pc, s, ps from the underlying algebra:

bNA01
aop(a, b)aa1
NAbNANA1
0bNA01
11111

Dragonfly operation for r from the underlying algebra:

bNA01
ar(a, b)NAn(a)1
NAb1NA1
01111
1bNA01

Examples

Run this code
a <- algebra('lukas')
b <- sobocinski(a)

a$t(0.3, NA)  # NA
b$t(0.3, NA)  # 0.3

Run the code above in your browser using DataLab