# Statistics

**URL:** https://discourse.julialang.org/c/domain/stats/12.md?page=23

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

**Page:** 24

---

## [Histogram fit error](https://discourse.julialang.org/t/histogram-fit-error/6900)

<div class="topic-metadata">

**Author:** [@SebastianM-C](https://discourse.julialang.org/u/SebastianM-C)\
**Replies:** 3\
**Last updated:** [November 6, 2017, 1:34pm UTC](https://discourse.julialang.org/t/histogram-fit-error/6900 "2017-11-06T13:34:58Z")

</div>

Hello, I sometimes get an InexactError() when using fit(Histogram, data, ws, 0:0.25:4, closed=:left). The issue is very strange because it doesn’t always happen. The same code sometimes runs fine, but sometimes I get …

---

## [NaN from multinomial distribution at p=1](https://discourse.julialang.org/t/nan-from-multinomial-distribution-at-p-1/6573)

<div class="topic-metadata">

**Author:** [@improbable22](https://discourse.julialang.org/u/improbable22)\
**Replies:** 4\
**Last updated:** [October 21, 2017, 10:13pm UTC](https://discourse.julialang.org/t/nan-from-multinomial-distribution-at-p-1/6573 "2017-10-21T22:13:22Z")

</div>

I’m getting NaN from a multinomial distribution, where I expected 1. Is this a bug or am I doing something wrong? using Distributions dist = Multinomial(2, \[0.999,0.001\]) pdf(dist,\[2,0\]) ## 0.998, ok dist = Multinomi…

---

## [Error running mamba](https://discourse.julialang.org/t/error-running-mamba/6530)

<div class="topic-metadata">

**Author:** [@Enzo\_Hernandez](https://discourse.julialang.org/u/Enzo_Hernandez)\
**Replies:** 1\
**Last updated:** [October 19, 2017, 8:31am UTC](https://discourse.julialang.org/t/error-running-mamba/6530 "2017-10-19T08:31:56Z")

</div>

hey guys i’m getting this error while running my model in mamba: ‘LoadError: ArgumentError: matrix is not symmetric/Hermitian. This error can be avoided by calling cholfact(Hermitian(A)) which will ignore either the upp…

---

## [Get siginificance of main fixed category effects in mixed linear model with MixedModels.jl](https://discourse.julialang.org/t/get-siginificance-of-main-fixed-category-effects-in-mixed-linear-model-with-mixedmodels-jl/6268)

<div class="topic-metadata">

**Author:** [@ksmet1977](https://discourse.julialang.org/u/ksmet1977)\
**Replies:** 7\
**Last updated:** [October 10, 2017, 12:31pm UTC](https://discourse.julialang.org/t/get-siginificance-of-main-fixed-category-effects-in-mixed-linear-model-with-mixedmodels-jl/6268 "2017-10-10T12:31:54Z")

</div>

Hi group, I have a dataframe of \>10000 rows of repeated measurements on 25 subjects (OB) on 3 categorical factors (QF,B,PA) and 1 continuous (CCT) factor. The first few lines look like this: │ Row │ OB │ QF │ BG │ …

---

## [Does an epidemiology package exist?](https://discourse.julialang.org/t/does-an-epidemiology-package-exist/6063)

<div class="topic-metadata">

**Author:** [@malavv](https://discourse.julialang.org/u/malavv)\
**Replies:** 3\
**Last updated:** [September 26, 2017, 1:11pm UTC](https://discourse.julialang.org/t/does-an-epidemiology-package-exist/6063 "2017-09-26T13:11:16Z")

</div>

Hi! I am a PhD student in Epidemiology and since I saw Julia, I always wanted to try it out as a “new R”. As an epidemiologist, Epidemiology packages in R that provides support for contingency tables, risk ratios, and o…

---

## [How to save random number generator state?](https://discourse.julialang.org/t/how-to-save-random-number-generator-state/6034)

<div class="topic-metadata">

**Author:** [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Replies:** 4\
**Last updated:** [September 22, 2017, 6:18pm UTC](https://discourse.julialang.org/t/how-to-save-random-number-generator-state/6034 "2017-09-22T18:18:10Z")

</div>

Suppose I have a loop where I generate samples with a stochastic function: srand(2017) for i=1:1000 sample = stochastic\_function(deterministic\_parameters...) end I need to save the state in order to be able to do so…

---

## [How do I deal with Random Number generation when multithreading](https://discourse.julialang.org/t/how-do-i-deal-with-random-number-generation-when-multithreading/5636)

<div class="topic-metadata">

**Author:** [@vgdev](https://discourse.julialang.org/u/vgdev)\
**Replies:** 6\
**Last updated:** [August 31, 2017, 12:34pm UTC](https://discourse.julialang.org/t/how-do-i-deal-with-random-number-generation-when-multithreading/5636 "2017-08-31T12:34:43Z")

</div>

If I am using Threads.@threads to run my Monte Carlo simulation in paralell, how do I set up Mersenne Twister RNGs for each thread so that I am both able to set a seed, in order to be able to reproduce the results, but …

---

## [Conditional logit models for paired data](https://discourse.julialang.org/t/conditional-logit-models-for-paired-data/5790)

<div class="topic-metadata">

**Author:** [@mwsohn](https://discourse.julialang.org/u/mwsohn)\
**Replies:** 2\
**Last updated:** [September 9, 2017, 2:40am UTC](https://discourse.julialang.org/t/conditional-logit-models-for-paired-data/5790 "2017-09-09T02:40:33Z")

</div>

Can MixedModels fit conditional logistic regression models for paired data? If so, I would appreciate a sample syntax.

---

## [Proposal: Using a "mask" for DataFrames and ModelMatrices](https://discourse.julialang.org/t/proposal-using-a-mask-for-dataframes-and-modelmatrices/5779)

<div class="topic-metadata">

**Author:** [@jeffwong](https://discourse.julialang.org/u/jeffwong)\
**Replies:** 3\
**Last updated:** [September 8, 2017, 11:46pm UTC](https://discourse.julialang.org/t/proposal-using-a-mask-for-dataframes-and-modelmatrices/5779 "2017-09-08T23:46:00Z")

</div>

In data science we always have a need to split data into a training set and a test set. Sometimes we will do this multiple times like in k fold cross validation, or leave one out cross validations. In R: the typical par…

---

## [Entropy calculation from data - comparison with matlab](https://discourse.julialang.org/t/entropy-calculation-from-data-comparison-with-matlab/5495)

<div class="topic-metadata">

**Author:** [@v-i-s-h](https://discourse.julialang.org/u/v-i-s-h)\
**Replies:** 2\
**Last updated:** [August 22, 2017, 9:47am UTC](https://discourse.julialang.org/t/entropy-calculation-from-data-comparison-with-matlab/5495 "2017-08-22T09:47:04Z")

</div>

I want to calculate the entropy of a continuous random variable from a set of observations. First I wrote the following code in Julia: using Distributions using StatsBase using PyPlot function calc\_entropy( x::Vector{…

---

## [Calculating Entropy from data](https://discourse.julialang.org/t/calculating-entropy-from-data/5480)

<div class="topic-metadata">

**Author:** [@v-i-s-h](https://discourse.julialang.org/u/v-i-s-h)\
**Replies:** 2\
**Last updated:** [August 22, 2017, 2:38am UTC](https://discourse.julialang.org/t/calculating-entropy-from-data/5480 "2017-08-22T02:38:45Z")

</div>

I have a vector of data sampled from a random process and want to calculate the entropy of the random variable. I wrote this code using Distributions using StatsBase function calc\_entropy1( x::Vector{Float64} ) N …

---

## [Is there any way to choose a referent other than the lowest value in a regression?](https://discourse.julialang.org/t/is-there-any-way-to-choose-a-referent-other-than-the-lowest-value-in-a-regression/5464)

<div class="topic-metadata">

**Author:** [@mwsohn](https://discourse.julialang.org/u/mwsohn)\
**Replies:** 0\
**Last updated:** [August 19, 2017, 4:53pm UTC](https://discourse.julialang.org/t/is-there-any-way-to-choose-a-referent-other-than-the-lowest-value-in-a-regression/5464 "2017-08-19T16:53:08Z")

</div>

I have a dependent variable with three levels with values 1, 2, and 3. Is there a simple way to use 2 as the omitted (reference) category instead of 1 in a GLM model, perhaps in a @formula macro?

---

## [MixedModels and Random Interactions](https://discourse.julialang.org/t/mixedmodels-and-random-interactions/5315)

<div class="topic-metadata">

**Author:** [@kei](https://discourse.julialang.org/u/kei)\
**Replies:** 6\
**Last updated:** [August 17, 2017, 5:31am UTC](https://discourse.julialang.org/t/mixedmodels-and-random-interactions/5315 "2017-08-17T05:31:11Z")

</div>

Hello, everyone. I am attempting to use MixedModels to produce a model that would (in R using lme4) otherwise look like this: (Edited formula): model = lmer( y ~ x \* cond1 \* cond2 + (1+x \* cond1 \* cond2 | region ) …

---

## [Logistic Regression Problem](https://discourse.julialang.org/t/logistic-regression-problem/5417)

<div class="topic-metadata">

**Author:** [@Antonio\_Loureiro](https://discourse.julialang.org/u/Antonio_Loureiro)\
**Replies:** 3\
**Last updated:** [August 16, 2017, 9:59pm UTC](https://discourse.julialang.org/t/logistic-regression-problem/5417 "2017-08-16T21:59:27Z")

</div>

I’m trying to use a Logistic Regression algorithm to find a classification model, but i get stuck with an error “failure to converge after 30 iterations” i have changed the maxIter arg to an higher value, but the error o…

---

## [Generating \`Array\` of random values from \`Array\` of Distributions](https://discourse.julialang.org/t/generating-array-of-random-values-from-array-of-distributions/5310)

<div class="topic-metadata">

**Author:** [@jacobcvt12](https://discourse.julialang.org/u/jacobcvt12)\
**Replies:** 1\
**Last updated:** [August 9, 2017, 11:45pm UTC](https://discourse.julialang.org/t/generating-array-of-random-values-from-array-of-distributions/5310 "2017-08-09T23:45:30Z")

</div>

I have an Array (of arbitary size) containing the parameters corresponding to the parameters of a distribution. In this example, the Array has size (4, 3, 2) but could e.g. be size (3, 2) or (5, 2, 3, 2), etc. For examp…

---

## [Distributions.jl using a custom random number generator](https://discourse.julialang.org/t/distributions-jl-using-a-custom-random-number-generator/5106)

<div class="topic-metadata">

**Author:** [@bernhard](https://discourse.julialang.org/u/bernhard)\
**Replies:** 2\
**Last updated:** [July 29, 2017, 6:12am UTC](https://discourse.julialang.org/t/distributions-jl-using-a-custom-random-number-generator/5106 "2017-07-29T06:12:22Z")

</div>

Is there any way to use a distribution from Distributions.jl with a custom RNG? I know how to sample in a reproducible manner from a uniform distribution (see x1 and x2 in the code below). But Distrubutions.jl seems to…

---

## [Announcement: GeoStats.jl](https://discourse.julialang.org/t/announcement-geostats-jl/4098)

<div class="topic-metadata">

**Author:** [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Replies:** 7\
**Last updated:** [July 19, 2017, 6:44pm UTC](https://discourse.julialang.org/t/announcement-geostats-jl/4098 "2017-07-19T18:44:20Z")

</div>

Dear all, I am happy to announce GeoStats.jl, a package with high-performance implementations of geostatistical algorithms for the Julia programming language. It is in its initial development, and currently only contain…

---

## [Dirichlet Process Mixture Models (DPGMM)](https://discourse.julialang.org/t/dirichlet-process-mixture-models-dpgmm/4902)

<div class="topic-metadata">

**Author:** [@grero](https://discourse.julialang.org/u/grero)\
**Replies:** 1\
**Last updated:** [July 17, 2017, 1:43pm UTC](https://discourse.julialang.org/t/dirichlet-process-mixture-models-dpgmm/4902 "2017-07-17T13:43:32Z")

</div>

I wanted to try out DPGMM as a way to cluster some data I’m working on, and I came across this package: https://github.com/sbos/DirichletProcessMixtures.jl. I’m not sure if anyone is still maintaining that package, thou…

---

## [Memory-cheap way to calculate 1D-formated, non-zero only histogram of sparse data?](https://discourse.julialang.org/t/memory-cheap-way-to-calculate-1d-formated-non-zero-only-histogram-of-sparse-data/4885)

<div class="topic-metadata">

**Author:** [@Datseris](https://discourse.julialang.org/u/Datseris)\
**Replies:** 5\
**Last updated:** [July 17, 2017, 8:50am UTC](https://discourse.julialang.org/t/memory-cheap-way-to-calculate-1d-formated-non-zero-only-histogram-of-sparse-data/4885 "2017-07-17T08:50:03Z")

</div>

Halo, I’ve noticed that I run out of memory extremely quickly when calculating a high-resolution histogram of three dimensional data (using StatsBase). I guess the reason is that the size of the output is proportional t…

---

## [Usage of different types of weights](https://discourse.julialang.org/t/usage-of-different-types-of-weights/4780)

<div class="topic-metadata">

**Author:** [@jeffwong](https://discourse.julialang.org/u/jeffwong)\
**Replies:** 12\
**Last updated:** [July 12, 2017, 4:54pm UTC](https://discourse.julialang.org/t/usage-of-different-types-of-weights/4780 "2017-07-12T16:54:44Z")

</div>

The weights.jl file describes three types of weights: frequency weights, probability weights, and analytic weights. This is an amazing feature to Julia, as only commercial software like STATA and SAS understand the diff…

---

## [CSPRNG functions](https://discourse.julialang.org/t/csprng-functions/3977)

<div class="topic-metadata">

**Author:** [@acad2](https://discourse.julialang.org/u/acad2)\
**Replies:** 6\
**Last updated:** [June 9, 2017, 9:21am UTC](https://discourse.julialang.org/t/csprng-functions/3977 "2017-06-09T09:21:24Z")

</div>

Generally in cryptography, we need to use Cryptographically Secure Pseudo-Random Number Generator. But I could not find anything like that in Julia. Python has CSPRNG which I could use (based on this example): julia\> u…

---

## [Updating parameters in Distribution](https://discourse.julialang.org/t/updating-parameters-in-distribution/4140)

<div class="topic-metadata">

**Author:** [@jacobcvt12](https://discourse.julialang.org/u/jacobcvt12)\
**Replies:** 2\
**Last updated:** [June 7, 2017, 4:36pm UTC](https://discourse.julialang.org/t/updating-parameters-in-distribution/4140 "2017-06-07T16:36:49Z")

</div>

I’d like to be able to modify the parameters in a Distribution using a tuple. For example, something like this using Distributions x=Normal(1.0, 3.0) # doesn't work params(x) = (2.0, 4.0) Is it possible to do somethi…

---

## [Correlation coefficient](https://discourse.julialang.org/t/correlation-coefficient/3966)

<div class="topic-metadata">

**Author:** [@acad2](https://discourse.julialang.org/u/acad2)\
**Replies:** 1\
**Last updated:** [May 29, 2017, 4:01am UTC](https://discourse.julialang.org/t/correlation-coefficient/3966 "2017-05-29T04:01:08Z")

</div>

The function for Pearson correlation coefficient is cor. Isn’t it a good idea to make it (something like) correlation? Otherwise, it looks like cryptic function names in Matlab.

---

## [TimeArray -\> {Regular,Irregular}TimeArray](https://discourse.julialang.org/t/timearray-regular-irregular-timearray/3919)

<div class="topic-metadata">

**Author:** [@JeffreySarnoff](https://discourse.julialang.org/u/JeffreySarnoff)\
**Replies:** 0\
**Last updated:** [May 25, 2017, 6:50am UTC](https://discourse.julialang.org/t/timearray-regular-irregular-timearray/3919 "2017-05-25T06:50:05Z")

</div>

TimeArray is the type underlying JuliaStats/TimeSeries. I need a slightly finer distinction and the ability to dispatch over each, RegularTimeArray (where deltaTime is constant) and IrregularTimeArray (where deltaTime i…

---

## [Generating strongly correlated data for numerical experiments](https://discourse.julialang.org/t/generating-strongly-correlated-data-for-numerical-experiments/3842)

<div class="topic-metadata">

**Author:** [@varun7rs](https://discourse.julialang.org/u/varun7rs)\
**Replies:** 4\
**Last updated:** [May 22, 2017, 11:10am UTC](https://discourse.julialang.org/t/generating-strongly-correlated-data-for-numerical-experiments/3842 "2017-05-22T11:10:38Z")

</div>

Since real-life traffic traces are not readily available, for my simulations, I generate traffic traces as follows: trace = \[\] nom = sample(collect(0.5:0.2,0.9), WeightVec(\[0.3,0.4,0.3\])) for i=1:100 push!(trace, nom …

---

## [Sample random matrix](https://discourse.julialang.org/t/sample-random-matrix/3789)

<div class="topic-metadata">

**Author:** [@jacobcvt12](https://discourse.julialang.org/u/jacobcvt12)\
**Replies:** 3\
**Last updated:** [May 18, 2017, 3:29pm UTC](https://discourse.julialang.org/t/sample-random-matrix/3789 "2017-05-18T15:29:18Z")

</div>

Hi all, I’m trying to sample a random matrix, where each element is independent. For example, if I have a matrix of means M = \[1. 10.; 100. 1000.\] and I want to generate data, where each element is sampled as an expon…

---

## ["multivariate curve resolution"... a NMF using ALS?](https://discourse.julialang.org/t/multivariate-curve-resolution-a-nmf-using-als/3274)

<div class="topic-metadata">

**Author:** [@charlesll](https://discourse.julialang.org/u/charlesll)\
**Replies:** 1\
**Last updated:** [May 18, 2017, 7:02am UTC](https://discourse.julialang.org/t/multivariate-curve-resolution-a-nmf-using-als/3274 "2017-05-18T07:02:06Z")

</div>

Dear all, I am using Julia and the JuliaStats ecosystem together with SciKit-learn (thanks PyCall) to perform component analysis and blind-source separation in various Raman and also XAFS spectra of glasses with varying…

---

## ["online" statistics?](https://discourse.julialang.org/t/online-statistics/3536)

<div class="topic-metadata">

**Author:** [@ndbecker](https://discourse.julialang.org/u/ndbecker)\
**Replies:** 1\
**Last updated:** [May 5, 2017, 1:03pm UTC](https://discourse.julialang.org/t/online-statistics/3536 "2017-05-05T13:03:42Z")

</div>

I often need to compute running statistics, also called “online”. For example, consider a long-running process which generates a vector of results every 30 seconds. I might want 2nd-order stats, or a histogram. I don…

---

## [LoadError: SystemError: No such file or directory while loading](https://discourse.julialang.org/t/loaderror-systemerror-no-such-file-or-directory-while-loading/3422)

<div class="topic-metadata">

**Author:** [@Wael\_Sboui](https://discourse.julialang.org/u/Wael_Sboui)\
**Replies:** 2\
**Last updated:** [May 1, 2017, 1:35pm UTC](https://discourse.julialang.org/t/loaderror-systemerror-no-such-file-or-directory-while-loading/3422 "2017-05-01T13:35:26Z")

</div>

LoadError: SystemError: opening file Intervals.csv: No such file or directory while loading C:\\Users\\Wael Sboui 22987392\\Desktop\\Airplane-V5.9\\Airplane-V5.9\\AirplaneRealStats6.1.jl, in expression starting on line 379

---

## [Recommended packages to contribute to for newcomers?](https://discourse.julialang.org/t/recommended-packages-to-contribute-to-for-newcomers/3416)

<div class="topic-metadata">

**Author:** [@ajkeith](https://discourse.julialang.org/u/ajkeith)\
**Replies:** 2\
**Last updated:** [April 28, 2017, 1:03pm UTC](https://discourse.julialang.org/t/recommended-packages-to-contribute-to-for-newcomers/3416 "2017-04-28T13:03:34Z")

</div>

Hello! I’ve been using Julia for homework and I’m interested in getting more involved in package development. In the near term I’d like to contribute to some stats packages to get a feel for how packages work, with a lon…

[Previous page](https://discourse.julialang.org/c/domain/stats/12.md?page=22)

[Next page](https://discourse.julialang.org/c/domain/stats/12.md?page=24)
