msg_len_weighted_avg: Weighted average message length

Description Usage Arguments Value

View source: R/msg_len_weighted_avg.R

Description

This function calculates the weighted average over a vector of message lengths. It can either be uniform or non-uniform. It uses message lengths instead of probabilities to avoid computer under flow when dealing with extreme small probability multiplications.

Usage

1

Arguments

l

A vector of more than one message lengths.

w

A vector of weights, one for each model (structure). It can be a vector of uniform probabilities that indicates an uniform averaging over all models.

Value

The function outputs a weighted average message length in natural log.


kelvinyangli/mbmml documentation built on June 29, 2020, 3:12 a.m.