lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] Group quotes, part deux


From: Vadim Zeitlin
Subject: Re: [lmi] Group quotes, part deux
Date: Thu, 19 May 2016 23:24:33 +0200

On Thu, 19 May 2016 20:50:18 +0000 Greg Chicares <address@hidden> wrote:

GC> On 2016-05-08 22:16, Greg Chicares wrote:
GC> [...]
GC> > In this case, though, we have at most three averages, one for each
GC> > "premium" column. The averages are to go in a row of their own below
GC> > the totals, to be labelled "Average Cost per $1000". The averages are
GC> >   1000 * premium / face_amount
GC> > for these {premium, face_amount} pairs:
GC> >   "Basic", "Basic"
GC> >   "Additional", "Supplemental" [a real problem-domain distinction]
GC> >   "Total", "Total"
GC> 
GC> I specified that ambiguously. The code calculates averages thus:
GC>   average = (1000/N) * Σ(prem[i] / face[i]), i ∈ (1,N)
GC> which is one correct reading of the specification I wrote. However,
GC> the desired calculation is a different reading:
GC>   average = 1000 * Σ(prem[i]) / Σ(face[i])
GC> Thus, each column average is 1000 * the ratio of two values in the
GC> "Totals" row: the ratio of the sums, not the mean of the ratios.
GC> 
GC> Vadim, would you mind fixing my mistake, as it seems to call for a
GC> structural change?

 Yes, sure, the structural change amounts to just reverting most of the
unnecessary code I wrote and replacing it with a couple of lines doing the
desired thing, so here it is:

        https://github.com/vadz/lmi/pull/34

I'm really sorry about this problem, especially because I did think about
whether the former or the latter interpretation should have been
implemented, but decided that it certainly couldn't be something as simple
as the latter and that there was no need to bother you with the questions
about this. Trust me to overcomplicate things while being certain of doing
the right thing :-(

GC> (And it would have harmed our reputation if Kim had not caught this
GC> before release into production.)

 Indeed, thanks a lot to Kim for finding this. Out of curiosity, how did
you do it? The difference is relatively small (although far from
insignificant, of course), so how did you manage to not miss it?

 Anyhow, thanks again and sorry for the misunderstanding,
VZ


reply via email to

[Prev in Thread] Current Thread [Next in Thread]