ConditionalDistribution: Return the conditional output distribution for a given...

Description Usage Arguments Value Author(s) References See Also Examples

Description

For a given channel and a given input, specified either as a value or an index, this function returns a list of two values, the output alphabet, and the conditional probability distribution over that alphabet.

Usage

1
ConditionalDistribution(channel, index = NA, x = NA)

Arguments

channel

An information channel, as returned by BlahutAlgorithm, FindOptimalChannel, or FindRate.

index

The input to the channel, defined as an index into the input alphabet.

x

If an index is not specified, then the channel input may be specified as a value from its alphabet. This is slower than specifying an index.

Value

This function returns a list of two values:

y

The output alphabet for the channel

p

The conditional probability distribution over this output, for the specified input. This is a vector of probabilities that will sum to 1.

Author(s)

Chris R. Sims

References

Blahut, R. E. (1972). Computation of channel capacity and rate-distortion functions. IEEE Transactions on Information Theory, 18(4):460–473.

See Also

BlahutAlgorithm, FindOptimalChannel, FindRate

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
# Define a discretized Gaussian information source
x <- seq(from = -10, to = 10, length.out = 100)
Px <- dnorm(x, mean = 0, sd = 3)
Px <- Px / sum(Px) # Ensure that probability sums to 1
y <- x # The destination alphabet is the same as the source

# Define a quadratic cost function
cost.function <- function(x, y) {
    (y - x)^2
}

# Slope of the rate-distortion curve
s <- -1

# Compute the rate-distortion value at the given point s
channel <- BlahutAlgorithm(x, Px, y, cost.function, s)

# Compute & plot the conditional probability distribution for a particular channel input.
cpd <- ConditionalDistribution(channel, index = 50)
plot(cpd$y, cpd$p)

RateDistortion documentation built on May 1, 2019, 9:52 p.m.