Saturday, June 15, 2013

Programming Puzzle: Multiply Matrixes with MongoDB

Today I want to share an idea on how to multiply matrixes using MondoDB's facilities. It's not the way you usually multiply them and more likely you never need to do this with Mongo. However the idea provided here can be applied to any MapReduce framework (for example: Hadoop). Frankly speaking it's not a clean and robust way of multiplying the matrixes, it's done just for fun, so don't take this article to seriously.

I'm going to consider two approaches, the first one - using only Mongo's MapReduce facilities and the second - MapReduce + Aggregation Framework. Intrigued? :) Continue reading then...

Wednesday, June 5, 2013

How to calculate PValue from ChiSquare in Java

Several days ago I faced a problem: I needed to calculate pValue for a given ChiSquare with a given Degrees of Freedom. I didn't have time to do the research and to implement the algorithm from the scratch. In fact I had just a couple of hours to solve the problem. So I started searching...

I was unable to find PValue calculator written in Java but was able to find one written in JavaScript there. So I converted the code into Java and want to share it to you (just call pochisq(chiSquareValue, degreesOfFreedom)):