Week 10 Check-in

joaosferreira
Published: 08/11/2020

What did you do this week?

This week I started a new PR that adds multimethods for statistical functions. The multimethods added are the following:

Order statistics

  • percentile
  • nanpercentile
  • quantile
  • nanquantile

Averages and variances

  • median
  • average
  • mean
  • nanmedian
  • nanmean
  • nanstd
  • nanvar

Correlating

  • corrcoef
  • correlate
  • cov

Histograms

  • histogram
  • histogram2d
  • histogramdd
  • bincount
  • histogram_bin_edges
  • digitize

As of now these new additions have the essential parts of a multimethod, both an argument extractor and replacer but are missing default implementations. I've also modified some of the argument replacers to support the out keyword making them more general purpose thus removing the need for some of the other more specific argument replacers.

What is coming up next?

I'll continue the PR started this week by working on default implementations for the simpler multimethods like median and mean. I will also start a new PR that adds multimethods for NumPy's random module that picks up on an older PR left off by one of my mentors. I've been wanting to work on these multimethods for a while but wasn't able to because of other project commitments. After discussing with my mentors we decided to change the work expected for the following week from the JAX backend implementation to the random module since this has a higher priority.

Did you get stuck anywhere?

Yes, working on the default implementation for median. Although this might be one of the easiest defaults from the multimethods in the current PR it has proven to be a bit of a challenge. The idea is to transverse the array along the given axes and apply a reduction function. Because of the array manipulations necessary to accomplish this and since I can't use item assignment the default is being more complicated than initial thought. More recently one of my mentors provided a general template for implementing it which might help me unblock. If I can do this other reduction multimethods' defaults should easily follow.

1000 characters left