Fork me on GitHub

Anyone here know how to do fitdistr in clojure?


@base698 that depends on the method you want to use to fit it - so basically a philosophical question simple_smile. I'm doing some bayesian stuff, so I created the whole lib whose main purpose is exactly to find the posterior distribution from data (and prior). But, you are probably looking for a function to do MLE? Or literally for the matching alternative to R's fitdistr?


anyone know how to do a relational style join based on keys with 2 core.matrix.dataset types?


just wondering if I need to convert or if it can be done. join-rows doesn't seem to do what I want


@blueberry: I'm not really sure, i'm trying to adapt some old code that was in R. it uses fitdistr to get the estimate then does this: Which I'm not really sure is actually the log normal mean.

(defn log-normal-mean 
   [fitm m2]
  (let [fitsd (/ (Math/sqrt m2) 10.0)]
  (Math/pow Math/E (+ fitm (/ (* fitsd fitsd) 2.0)))))
I'm doing it incrementally with the online-variance algorithm so I don't have to keep the raw data in memory.


I basically discovered by accident that m2 value is the same as fitsd in R


at least by a factor of 10


that 10 looks suspicious to me.


yeah it was, I figured it out.


(defn log-normal-mean 
  [fitm fitsd]
  (Math/pow Math/E (+ fitm (/ (* fitsd fitsd) 2.0))))