# Statistics

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

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

**Page:** 16

---

## [Random number in (0,1)](https://discourse.julialang.org/t/random-number-in-0-1/51451)

<div class="topic-metadata">

**Author:** [@jherekhealy](https://discourse.julialang.org/u/jherekhealy)\
**Replies:** 9\
**Last updated:** [December 9, 2020, 10:38am UTC](https://discourse.julialang.org/t/random-number-in-0-1/51451 "2020-12-09T10:38:22Z")

</div>

In Random.jl, there is the possibility to generate a random number in the interval \[0,1) through CloseOpen01, or even in \[1,2) (I can see the reason for this for implementation, less so for a user) through CloseOpen12, …

---

## [Sample from Kernel Density Estimator](https://discourse.julialang.org/t/sample-from-kernel-density-estimator/50639)

<div class="topic-metadata">

**Author:** [@heliosdrm](https://discourse.julialang.org/u/heliosdrm)\
**Replies:** 3\
**Last updated:** [November 25, 2020, 3:59pm UTC](https://discourse.julialang.org/t/sample-from-kernel-density-estimator/50639 "2020-11-25T15:59:04Z")

</div>

From a sample of data I can create a KDE to estimate the probability density with KernelDensity.jl, e.g.: density\_estimator = kde(data) Now, is there any package or custom code that I could use to retrieve a sample fro…

---

## [A mutable struct that does not get mutated ? or does it?](https://discourse.julialang.org/t/a-mutable-struct-that-does-not-get-mutated-or-does-it/50537)

<div class="topic-metadata">

**Author:** [@lrnv](https://discourse.julialang.org/u/lrnv)\
**Replies:** 3\
**Last updated:** [November 21, 2020, 5:38pm UTC](https://discourse.julialang.org/t/a-mutable-struct-that-does-not-get-mutated-or-does-it/50537 "2020-11-21T17:38:21Z")

</div>

Hi, I’m trying to code an extension do Distributions.jl for a certain distribution (Some gamma convolutions), and implementing the Moschopoulos algorithm. I have an issue: To compute the pdf, i need to cache certain va…

---

## [Distributions.jl extension](https://discourse.julialang.org/t/distributions-jl-extension/50501)

<div class="topic-metadata">

**Author:** [@lrnv](https://discourse.julialang.org/u/lrnv)\
**Replies:** 2\
**Last updated:** [November 20, 2020, 3:34pm UTC](https://discourse.julialang.org/t/distributions-jl-extension/50501 "2020-11-20T15:34:16Z")

</div>

Hi, I’m trying to code an extension of the Distributions.jl to add my own distribution, a convolution of N gammas, for which there exists an efficient algorithm for exact pdf / cdf computations. I wrote a bunch of code…

---

## [Least Square Means or Adjusted Means](https://discourse.julialang.org/t/least-square-means-or-adjusted-means/49707)

<div class="topic-metadata">

**Author:** [@younghan-lee](https://discourse.julialang.org/u/younghan-lee)\
**Replies:** 7\
**Last updated:** [November 10, 2020, 8:22am UTC](https://discourse.julialang.org/t/least-square-means-or-adjusted-means/49707 "2020-11-10T08:22:41Z")

</div>

Hello, I am trying to get least square means or adjusted means in Julia from my dataset. I’ve been using ‘emmeans’ in R or ‘lsmean’ in SAS, equivalently. Would there be any Julia package or way to do it in Julia? Tha…

---

## [How to fit a Dirichlet Distribution using MLE in Distributions.jl?](https://discourse.julialang.org/t/how-to-fit-a-dirichlet-distribution-using-mle-in-distributions-jl/49645)

<div class="topic-metadata">

**Author:** [@stochastic\_guy](https://discourse.julialang.org/u/stochastic_guy)\
**Replies:** 6\
**Last updated:** [November 7, 2020, 9:53pm UTC](https://discourse.julialang.org/t/how-to-fit-a-dirichlet-distribution-using-mle-in-distributions-jl/49645 "2020-11-07T21:53:35Z")

</div>

I would like to fit Dirichlet Distribution to all\_patterns using MLE in the Distributions package where alpha to Dirichlet is fill(1,k) and all\_patterns is a combination array all\_patterns = (p=(a,c)-\>c\<2 ? a : \[…

---

## [Fit Poisson ditribution to histogram](https://discourse.julialang.org/t/fit-poisson-ditribution-to-histogram/48883)

<div class="topic-metadata">

**Author:** [@phlavenk](https://discourse.julialang.org/u/phlavenk)\
**Replies:** 4\
**Last updated:** [October 28, 2020, 7:43am UTC](https://discourse.julialang.org/t/fit-poisson-ditribution-to-histogram/48883 "2020-10-28T07:43:43Z")

</div>

Is there a way how to fit a Poisson distribution (determine the lambda parameter) from a histogram of an experimental process? In the experimental setup, in each event we are recording the number of detected photons and…

---

## [Principal Components Analysis on datasets with missing data](https://discourse.julialang.org/t/principal-components-analysis-on-datasets-with-missing-data/48962)

<div class="topic-metadata">

**Author:** [@clibassi](https://discourse.julialang.org/u/clibassi)\
**Replies:** 5\
**Last updated:** [October 25, 2020, 2:16pm UTC](https://discourse.julialang.org/t/principal-components-analysis-on-datasets-with-missing-data/48962 "2020-10-25T14:16:47Z")

</div>

Hey all - I’m sort of new to principal components analysis - especially in Julia, but I’ve been digging through @nassarhuda’s great Dimensionality Reduction notebook but am running into an issue because the data I’m wor…

---

## [Performance of time series packages](https://discourse.julialang.org/t/performance-of-time-series-packages/48447)

<div class="topic-metadata">

**Author:** [@Yifan\_Liu](https://discourse.julialang.org/u/Yifan_Liu)\
**Replies:** 5\
**Last updated:** [October 15, 2020, 5:25pm UTC](https://discourse.julialang.org/t/performance-of-time-series-packages/48447 "2020-10-15T17:25:38Z")

</div>

Are there performance benchmark of ARCHModels.jl vs. rugarch & rmgarch? rugarch is pretty slow, and I kind of remember a while ago someone mentioned ARCHModels has a performance issue.

---

## [How can we create a leaner ecosystem for Julia?](https://discourse.julialang.org/t/how-can-we-create-a-leaner-ecosystem-for-julia/32904)

<div class="topic-metadata">

**Author:** [@Albert\_Zevelev](https://discourse.julialang.org/u/Albert_Zevelev)\
**Replies:** 100\
**Last updated:** [October 15, 2020, 5:27pm UTC](https://discourse.julialang.org/t/how-can-we-create-a-leaner-ecosystem-for-julia/32904 "2020-10-15T17:27:17Z")

</div>

Comparisons of Julia w/ other languages often say one disadvantage of Julia is that it has fewer 3rd party packages. I tend to disagree. Julia doesn’t need more packages, it needs better packages (w/ more functionality)…

---

## [Regression: fixed effects + quantiles](https://discourse.julialang.org/t/regression-fixed-effects-quantiles/45427)

<div class="topic-metadata">

**Author:** [@danicaratelli](https://discourse.julialang.org/u/danicaratelli)\
**Replies:** 16\
**Last updated:** [October 12, 2020, 7:23pm UTC](https://discourse.julialang.org/t/regression-fixed-effects-quantiles/45427 "2020-10-12T19:23:00Z")

</div>

I am trying to run a quantile regression with fixed effects. Does anyone know if a package for this exists? Thanks!

---

## [How to simulate a random signal sequence change](https://discourse.julialang.org/t/how-to-simulate-a-random-signal-sequence-change/47964)

<div class="topic-metadata">

**Author:** [@aachener](https://discourse.julialang.org/u/aachener)\
**Replies:** 4\
**Last updated:** [October 10, 2020, 3:22am UTC](https://discourse.julialang.org/t/how-to-simulate-a-random-signal-sequence-change/47964 "2020-10-10T03:22:10Z")

</div>

I have got a simple problem to calculate Posterior after some signal disturbances. Say the input signal is a sequence of 0 and 1 with 70% of chance is 1. And somehow we know that after the transmission, the output have …

---

## [Getting strange MV Normal samples based on sparse precision matrix](https://discourse.julialang.org/t/getting-strange-mv-normal-samples-based-on-sparse-precision-matrix/48001)

<div class="topic-metadata">

**Author:** [@ElOceanografo](https://discourse.julialang.org/u/ElOceanografo)\
**Replies:** 5\
**Last updated:** [October 9, 2020, 4:02pm UTC](https://discourse.julialang.org/t/getting-strange-mv-normal-samples-based-on-sparse-precision-matrix/48001 "2020-10-09T16:02:37Z")

</div>

I’ve noticed something odd while trying to generate Gaussian Markov random fields on an irregular mesh. In this model, a spatial field is a multivariate normal variable defined on the mesh nodes. The distribution is de…

---

## [Recover MLE fit parameters in vector form](https://discourse.julialang.org/t/recover-mle-fit-parameters-in-vector-form/47972)

<div class="topic-metadata">

**Author:** [@Albert\_Zevelev](https://discourse.julialang.org/u/Albert_Zevelev)\
**Replies:** 4\
**Last updated:** [October 8, 2020, 2:53pm UTC](https://discourse.julialang.org/t/recover-mle-fit-parameters-in-vector-form/47972 "2020-10-08T14:53:38Z")

</div>

Suppose I fit some data using Distributions, Random; DGP\_True = LogNormal(0,1); Random.seed!(123); const d\_train = rand(DGP\_True, 1\_000); D1=Distributions.fit\_mle(LogNormal, d\_train) #Gives a fit distribution julia\> D1…

---

## [Find number of parameters in a distribution](https://discourse.julialang.org/t/find-number-of-parameters-in-a-distribution/47961)

<div class="topic-metadata">

**Author:** [@Albert\_Zevelev](https://discourse.julialang.org/u/Albert_Zevelev)\
**Replies:** 3\
**Last updated:** [October 8, 2020, 2:43am UTC](https://discourse.julialang.org/t/find-number-of-parameters-in-a-distribution/47961 "2020-10-08T02:43:11Z")

</div>

Suppose I’m looping over a large vector of distributions from Distributions.jl. How can I automatically find how many parameters there are in a distribution? I want a function nparams(d) where: nparams(Normal)=2 since…

---

## [\[Question\] Distributions.jl with CUDA](https://discourse.julialang.org/t/question-distributions-jl-with-cuda/47707)

<div class="topic-metadata">

**Author:** [@sheevy](https://discourse.julialang.org/u/sheevy)\
**Replies:** 0\
**Last updated:** [October 3, 2020, 9:21pm UTC](https://discourse.julialang.org/t/question-distributions-jl-with-cuda/47707 "2020-10-03T21:21:07Z")

</div>

Hi, I’m writing a program which I wish could easily work both cpu and gpu, similarly to what one can achieve in Flux with cpu and gpu functions. I was under impression that different Julia packages compose well, so I ex…

---

## [Suggestion needed: Tree like structure for adaptive binning of multidim data](https://discourse.julialang.org/t/suggestion-needed-tree-like-structure-for-adaptive-binning-of-multidim-data/47602)

<div class="topic-metadata">

**Author:** [@francesco.alemanno](https://discourse.julialang.org/u/francesco.alemanno)\
**Replies:** 6\
**Last updated:** [October 2, 2020, 9:01pm UTC](https://discourse.julialang.org/t/suggestion-needed-tree-like-structure-for-adaptive-binning-of-multidim-data/47602 "2020-10-02T21:01:52Z")

</div>

Hi everyone, i need to perform adaptive binning of multidimensional data, in an online fashion. as far as i understand i need a dynamic kd-tree, is there something in the julia ecosystem that implements a structure re…

---

## [Random number generators](https://discourse.julialang.org/t/random-number-generators/47613)

<div class="topic-metadata">

**Author:** [@caetanotc](https://discourse.julialang.org/u/caetanotc)\
**Replies:** 3\
**Last updated:** [October 2, 2020, 1:28pm UTC](https://discourse.julialang.org/t/random-number-generators/47613 "2020-10-02T13:28:41Z")

</div>

Hi, I’m new to julia and have some questions about RNG’s. If I understood well, MersenneTwister is the default method, but MersenneTwister objects are linked with the Random library and rand() function isn’t. When usin…

---

## [Fit data into a circle](https://discourse.julialang.org/t/fit-data-into-a-circle/45370)

<div class="topic-metadata">

**Author:** [@DanielS](https://discourse.julialang.org/u/DanielS)\
**Replies:** 25\
**Last updated:** [September 24, 2020, 2:08am UTC](https://discourse.julialang.org/t/fit-data-into-a-circle/45370 "2020-09-24T02:08:27Z")

</div>

Hi, I’m new to Julia. I’ve been looking for a way in Julia to fit my data into a circle. My data is a set of (x, y) coordinates, and I want to fit them into a circle to get the centre and radius etc. I know some librari…

---

## [StatsModels values(Schema) no longer works](https://discourse.julialang.org/t/statsmodels-values-schema-no-longer-works/46659)

<div class="topic-metadata">

**Author:** [@Ross\_Boylan](https://discourse.julialang.org/u/Ross_Boylan)\
**Replies:** 3\
**Last updated:** [September 17, 2020, 2:23am UTC](https://discourse.julialang.org/t/statsmodels-values-schema-no-longer-works/46659 "2020-09-17T02:23:20Z")

</div>

About a year ago, using StatsModels 0.6.5, the following code worked: function exploder(formula::FormulaTerm, df) s = schema(formula, df) function iscat(x) return isa(x, CategoricalTerm) end cats…

---

## [Recovering parameters from product of two truncated normal distributions](https://discourse.julialang.org/t/recovering-parameters-from-product-of-two-truncated-normal-distributions/46577)

<div class="topic-metadata">

**Author:** [@Libbum](https://discourse.julialang.org/u/Libbum)\
**Replies:** 2\
**Last updated:** [September 14, 2020, 10:02am UTC](https://discourse.julialang.org/t/recovering-parameters-from-product-of-two-truncated-normal-distributions/46577 "2020-09-14T10:02:09Z")

</div>

Hi all, I’ve been thrown into the deep end with some stats, and don’t know enough about the Julia ecosystem around my problem to know if I’m doing this right. For the moment, this is an example of what I’m doing: an in…

---

## [R's pairs scatter plot in Julia](https://discourse.julialang.org/t/rs-pairs-scatter-plot-in-julia/46254)

<div class="topic-metadata">

**Author:** [@maxpiot](https://discourse.julialang.org/u/maxpiot)\
**Replies:** 2\
**Last updated:** [September 11, 2020, 1:35pm UTC](https://discourse.julialang.org/t/rs-pairs-scatter-plot-in-julia/46254 "2020-09-11T13:35:29Z")

</div>

Hi all, I’m looking for a convenient way of recreating the R’s pairwise scatter plots (Scatter Plot Matrices - R Base Graphs - Easy Guides - Wiki - STHDA) in Julia. I’ve come across the corrplot function in the StatsPl…

---

## [Vertical errors for historgrams](https://discourse.julialang.org/t/vertical-errors-for-historgrams/45881)

<div class="topic-metadata">

**Author:** [@misha\_mikhasenko](https://discourse.julialang.org/u/misha_mikhasenko)\
**Replies:** 2\
**Last updated:** [September 1, 2020, 9:27am UTC](https://discourse.julialang.org/t/vertical-errors-for-historgrams/45881 "2020-09-01T09:27:06Z")

</div>

In my field of research (HEP), the vertical errors for the histograms are widely used. Usually, they are calculated assuming narrow bins and Poisson distribution for the number of entries, i.e. the error is sqrt(Nentri…

---

## [StackOverflowError trying to fit a difference equation with Turing](https://discourse.julialang.org/t/stackoverflowerror-trying-to-fit-a-difference-equation-with-turing/44349)

<div class="topic-metadata">

**Author:** [@arnaudmgh](https://discourse.julialang.org/u/arnaudmgh)\
**Replies:** 7\
**Last updated:** [August 21, 2020, 11:21pm UTC](https://discourse.julialang.org/t/stackoverflowerror-trying-to-fit-a-difference-equation-with-turing/44349 "2020-08-21T23:21:51Z")

</div>

I am trying to sample a difference equation using Turing but encounter errors. Basically, it’s a SIR model that solves fine, with a quick solver function written below (I wrote my own very simple solver to understand th…

---

## [A histogram that averages metadata instead of counts](https://discourse.julialang.org/t/a-histogram-that-averages-metadata-instead-of-counts/45257)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 6\
**Last updated:** [August 20, 2020, 12:59pm UTC](https://discourse.julialang.org/t/a-histogram-that-averages-metadata-instead-of-counts/45257 "2020-08-20T12:59:42Z")

</div>

I have a bunch of coordinates and corresponding values: n = 100 xy = \[rand(2) for \_ in 1:n\] v = rand(n) I want to 2D-bin the coordinates, and calculate the mean of all the values, v, that fall into each corresponding b…

---

## [\[Question\] Python  \`scipy.stats\`  alternative for Julia](https://discourse.julialang.org/t/question-python-scipy-stats-alternative-for-julia/45083)

<div class="topic-metadata">

**Author:** [@rakesh4real](https://discourse.julialang.org/u/rakesh4real)\
**Replies:** 2\
**Last updated:** [August 17, 2020, 8:07am UTC](https://discourse.julialang.org/t/question-python-scipy-stats-alternative-for-julia/45083 "2020-08-17T08:07:03Z")

</div>

Hi, Can I know if there is any Python scipy.stats alternative for Julia. If yes, can anyone please share the link. If not available, is there some similar project where I can get built-in implementations of different …

---

## [Inverse and backslash \\ division](https://discourse.julialang.org/t/inverse-and-backslash-division/44680)

<div class="topic-metadata">

**Author:** [@luboshanus](https://discourse.julialang.org/u/luboshanus)\
**Replies:** 5\
**Last updated:** [August 14, 2020, 8:18pm UTC](https://discourse.julialang.org/t/inverse-and-backslash-division/44680 "2020-08-14T20:18:06Z")

</div>

Hi, could anyone please explain to me how to use inv() and \\ properly to have valid results. Alse when checking with GLM package basic OLS gives different results and sometimes it is way too far. It might be caused by t…

---

## [Cross correlation with StatsBase.crosscor answer does not make sense](https://discourse.julialang.org/t/cross-correlation-with-statsbase-crosscor-answer-does-not-make-sense/44374)

<div class="topic-metadata">

**Author:** [@Ruan\_Stander](https://discourse.julialang.org/u/Ruan_Stander)\
**Replies:** 1\
**Last updated:** [August 6, 2020, 1:55am UTC](https://discourse.julialang.org/t/cross-correlation-with-statsbase-crosscor-answer-does-not-make-sense/44374 "2020-08-06T01:55:58Z")

</div>

Using StatsBase.crosscor and finding unexpected answers Example below: answer below is 0.66666 and I think it should be 1 since crosscor calculates the correlation of numone with the 1 lag correlation of numtwo which i…

---

## [GLMM - Cholesky factorization failed](https://discourse.julialang.org/t/glmm-cholesky-factorization-failed/43925)

<div class="topic-metadata">

**Author:** [@laut](https://discourse.julialang.org/u/laut)\
**Replies:** 9\
**Last updated:** [August 5, 2020, 5:59pm UTC](https://discourse.julialang.org/t/glmm-cholesky-factorization-failed/43925 "2020-08-05T17:59:35Z")

</div>

I’m not sure what I’m doing wrong here to fit a Generalized Linear Mixed Model (@dmbates): using CSV, DataFrames, Statsbase, MixedModels orange = DataFrame(CSV.read(download(“https://raw.githubusercontent.com/timothys…

---

## [How to create MixtureModel using distributions from different families](https://discourse.julialang.org/t/how-to-create-mixturemodel-using-distributions-from-different-families/43874)

<div class="topic-metadata">

**Author:** [@vkv](https://discourse.julialang.org/u/vkv)\
**Replies:** 1\
**Last updated:** [July 30, 2020, 8:25am UTC](https://discourse.julialang.org/t/how-to-create-mixturemodel-using-distributions-from-different-families/43874 "2020-07-30T08:25:16Z")

</div>

I want to create a MixtureModel from Distributions.jl using Normal distribution and Uniform distribution. Is there a way to do this?

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

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