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

This function computes the expected cost for a given channel (as produced by the function BlahutAlgorithm) and specified cost function given by rho.fn.

1 | ```
ChannelDistortion(channel, rho.fn, ...)
``` |

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

`rho.fn` |
A cost function used to evaluate the channel distortion. This function should be defined over the input and output alphabet for the channel, and the function should accept vectorized arguments. |

`...` |
Optional arguments that are passed to the cost function. |

This function returns the distortion for the channel, i.e., a single numeric (non-negative) value.

Chris R. Sims

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

`BlahutAlgorithm`

, `FindOptimalChannel`

, `FindRate`

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ```
# 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 the channel distortion according to a different cost function
abs.cost.function <- function(x, y) {
abs(y - x)
}
ChannelDistortion(channel, abs.cost.function)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.