Re: [Haskell-cafe] Thoughts about redesigning "Num" type class

Dominique Devriese comments my remark :
Could you mention, please, a system whose measures are for sure positive reals, infinity included? here: I think he's talking about the mathematical notion of measure: https://en.wikipedia.org/wiki/Measure_(mathematics) Gosh, I should have read Olaf Klinke somewhat slower... But I was a physicist too long. Sorry!
On the other hand, I would like to see where, in what kind of computations, the Rig type class would be useful (and how to squeeze infinity into it). I spent some time doing some computations using probabilistic measures and very standard programming standards, and I am conservatist. Of course, as Macchiavelli said in "Prince" (more or less): "the innovator makes enemies of all those who have done well under the old conditions". I am doubtful whether I "did well", but I wait for the innovators to show me their "new conditions". A good example, where a new Prelude with Rigs, Rngs, etc., permit to solve better some concrete, useful computational problems. Thanks in advance. Jerzy Karczmarczuk

On Sat, Sep 12, 2015 at 3:15 PM, Jerzy Karczmarczuk
On the other hand, I would like to see where, in what kind of computations, the Rig type class would be useful
For a simple example, consider solving a sequence tagging problem with
a hidden Markov model. That is, an HMM is a pair of (1) a "transition
table" which gives the probability of moving from one state to
another, and (2) an "emission/generation/observation table" which
gives the probability of making an observation given that we're in a
particular state. The sequence tagging problem says, for some
particular HMM, if we're given a sequence of observations we want to
learn something about the sequence of states which would've generated
those observations. Of course the question is what exactly is this
"something" we want to learn? Things we could want to learn:
* what is the total (over all state sequences) probability of
generating the observed sequence?
* what is the probability of the most likely state sequence given the
observed sequence?
* what is the most likely state sequence (itself) given the observed sequence?
* what are the top N most likely states sequences...
...
We can implement a single algorithm that answers all of these
questions, the only difference is which semiring the algorithm uses
when doing stuff. For example, to get the total probability we use the
<+,*> semiring. To get the probability of the single most-likely
sequence we use the
(and how to squeeze infinity into it).
Whether your semiring has infinity or not doesn't matter (unless infinity just so happens to be serving the role of the zero or unit). So, no squeezing in to be done. (If you're interested in *-semirings, then having infinities might matter; but for that, see the blog post I mentioned previously.) -- Live well, ~wren
participants (2)
-
Jerzy Karczmarczuk
-
wren romano