Opened 7 years ago

Closed 7 years ago

#802 closed specification (fixed)

AveragerWeighted::n(void) returns NaN for empty object

Reported by: Peter Owned by: Peter
Priority: minor Milestone: yat 0.13
Component: statistics Version: 0.11.2
Keywords: Cc:

Description

AveragerWeighted::n is documented to return weighted version of number of data points, and is implemented as:

double AveragerWeighted::n(void) const
{
  return sum_w()*sum_w()/sum_ww();
}

which is not well defined when the object is empty (0/0). This different from the unweighted version in which ::n(void) returns 0 when object is empty. Was there a reason for this choice or was it not a choice, but a special case that was not thought of when implementing the function?

Change History (3)

comment:1 Changed 7 years ago by Peter

Milestone: yat 0.x+yat 0.13

comment:2 Changed 7 years ago by Peter

Status: newassigned

comment:3 Changed 7 years ago by Peter

Resolution: fixed
Status: assignedclosed

(In [3266]) fixes #802

Note: See TracTickets for help on using tickets.