Fork me on GitHub
#data-science
<
2016-03-30
>
base69801:03:46

Anyone here know how to do fitdistr in clojure?

blueberry08:03:02

@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?

otfrom12:03:52

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

otfrom12:03:10

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

base69815:03:41

@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.

base69815:03:23

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

base69815:03:32

at least by a factor of 10

blueberry21:03:33

that 10 looks suspicious to me.

base69823:03:58

yeah it was, I figured it out.

base69823:03:17

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