# Statistics

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

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

**Page:** 22

---

## [How to sample vector of independent Bernoulli variables efficiently?](https://discourse.julialang.org/t/how-to-sample-vector-of-independent-bernoulli-variables-efficiently/19563)

<div class="topic-metadata">

**Author:** [@Gregstrq](https://discourse.julialang.org/u/Gregstrq)\
**Replies:** 4\
**Last updated:** [January 12, 2019, 11:10pm UTC](https://discourse.julialang.org/t/how-to-sample-vector-of-independent-bernoulli-variables-efficiently/19563 "2019-01-12T23:10:06Z")

</div>

Hi, everyone. I am trying to perform disorder averaging over different realizations of a lattice with some of the nodes randomly thrown away. Specifically, consider the following model: we have a lattice (graph) with N…

---

## [How to calculate a weighted mean with missing observations](https://discourse.julialang.org/t/how-to-calculate-a-weighted-mean-with-missing-observations/19281)

<div class="topic-metadata">

**Author:** [@pdeffebach](https://discourse.julialang.org/u/pdeffebach)\
**Replies:** 17\
**Last updated:** [January 5, 2019, 6:18pm UTC](https://discourse.julialang.org/t/how-to-calculate-a-weighted-mean-with-missing-observations/19281 "2019-01-05T18:18:12Z")

</div>

In my work not in Julia I often want to find weighted means when i have lots of missing data: both the vector of values contains missing values and the weights have missing values. using StatsBase, DataFrames df = DataF…

---

## [Probabilistic programming repositories](https://discourse.julialang.org/t/probabilistic-programming-repositories/19125)

<div class="topic-metadata">

**Author:** [@cscherrer](https://discourse.julialang.org/u/cscherrer)\
**Replies:** 8\
**Last updated:** [December 31, 2018, 6:47pm UTC](https://discourse.julialang.org/t/probabilistic-programming-repositories/19125 "2018-12-31T18:47:44Z")

</div>

There seem to be quite a few Julia repositories related to probabilistic programming. Here are the ones I’m aware of that have been updated in 2018 - anything I’m missing? Any experiences using these or comparing/contra…

---

## [Shrinkage prior in MixedModels](https://discourse.julialang.org/t/shrinkage-prior-in-mixedmodels/18801)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 1\
**Last updated:** [December 19, 2018, 10:36pm UTC](https://discourse.julialang.org/t/shrinkage-prior-in-mixedmodels/18801 "2018-12-19T22:36:18Z")

</div>

I would like to fit a hierarchical model Y \\sim X\\alpha + Z\\beta + \\epsilon\\\\ \\epsilon \\sim N(0,\\sigma^2\_\\epsilon) \\text{ iid}\\\\ \\alpha\_i \\sim N(\\mu\_\\alpha, \\sigma^2\_\\alpha)\\\\ \\beta\_i \\sim N(\\mu\_\\beta, \\sigma^2\_\\beta) …

---

## [Poll: Do we Julians want ANOVAs?](https://discourse.julialang.org/t/poll-do-we-julians-want-anovas/3757)

<div class="topic-metadata">

**Author:** [@LewisHein](https://discourse.julialang.org/u/LewisHein)\
**Replies:** 14\
**Last updated:** [December 18, 2018, 4:59pm UTC](https://discourse.julialang.org/t/poll-do-we-julians-want-anovas/3757 "2018-12-18T16:59:43Z")

</div>

Hi everyone, I’m a scientist on a crusade. My crusade is to bring a really good ANOVA system to julia, probably by merging https://github.com/JuliaStats/GLM.jl/pull/70. I want to do this because Julia is awesome and I …

---

## [Fail to do multiple linear regression using GLM](https://discourse.julialang.org/t/fail-to-do-multiple-linear-regression-using-glm/18780)

<div class="topic-metadata">

**Author:** [@leejm516](https://discourse.julialang.org/u/leejm516)\
**Replies:** 7\
**Last updated:** [December 18, 2018, 8:13am UTC](https://discourse.julialang.org/t/fail-to-do-multiple-linear-regression-using-glm/18780 "2018-12-18T08:13:15Z")

</div>

Hello, everybody. I have encountered doing multiple regression using GLM. Here’s my dataset data (originally come from Optimization of critical medium components using response surface methodology for ethanol productio…

---

## [GLM with weights](https://discourse.julialang.org/t/glm-with-weights/18603)

<div class="topic-metadata">

**Author:** [@davidzentlermunro](https://discourse.julialang.org/u/davidzentlermunro)\
**Replies:** 6\
**Last updated:** [December 14, 2018, 11:16am UTC](https://discourse.julialang.org/t/glm-with-weights/18603 "2018-12-14T11:16:30Z")

</div>

I’m getting the following error when trying to run GLM with a weight vector for my data: Julia Client – Internal Error DomainError(-1.867506166794264e-7, "sqrt will only return a complex result if called with a complex …

---

## [Different parametrizations of probability distributions in Distributions.jl](https://discourse.julialang.org/t/different-parametrizations-of-probability-distributions-in-distributions-jl/18435)

<div class="topic-metadata">

**Author:** [@alejandromerchan](https://discourse.julialang.org/u/alejandromerchan)\
**Replies:** 5\
**Last updated:** [December 10, 2018, 5:23pm UTC](https://discourse.julialang.org/t/different-parametrizations-of-probability-distributions-in-distributions-jl/18435 "2018-12-10T17:23:21Z")

</div>

In R there are several probability distributions that allow keywords for different parametrizations of the same distribution. For example, I use the Negative Binomial distribution a lot in my simulations of some biologic…

---

## [Fitting multilevel generalized linear models](https://discourse.julialang.org/t/fitting-multilevel-generalized-linear-models/18350)

<div class="topic-metadata">

**Author:** [@jbrea](https://discourse.julialang.org/u/jbrea)\
**Replies:** 3\
**Last updated:** [December 6, 2018, 1:56pm UTC](https://discourse.julialang.org/t/fitting-multilevel-generalized-linear-models/18350 "2018-12-06T13:56:55Z")

</div>

Is there already a julia package to fit multilevel models, e.g. for repeated measures?

---

## [How does one use empirical distributions?](https://discourse.julialang.org/t/how-does-one-use-empirical-distributions/18360)

<div class="topic-metadata">

**Author:** [@iwelch](https://discourse.julialang.org/u/iwelch)\
**Replies:** 1\
**Last updated:** [December 6, 2018, 4:41am UTC](https://discourse.julialang.org/t/how-does-one-use-empirical-distributions/18360 "2018-12-06T04:41:04Z")

</div>

dear stats experts—the following used to work. julia\> using Random, Distributions; Random.seed!(0); julia\> x= max.(randn(10000), (rand(10000) .- 0.5)); julia\> empcdfun= EmpiricalUnivariateDistribution( x ); julia\> c…

---

## [Hessian matrix for standard errors using Optim.jl example](https://discourse.julialang.org/t/hessian-matrix-for-standard-errors-using-optim-jl-example/17996)

<div class="topic-metadata">

**Author:** [@oizin](https://discourse.julialang.org/u/oizin)\
**Replies:** 1\
**Last updated:** [November 27, 2018, 4:52am UTC](https://discourse.julialang.org/t/hessian-matrix-for-standard-errors-using-optim-jl-example/17996 "2018-11-27T04:52:28Z")

</div>

I’m looking at the maximum likelihood example on the Optim.jl page and trying it on a different likelihood function (truncated normal). I’m running into an issue where the covariance matrix returned using the Optim examp…

---

## [Multivariate normality tests](https://discourse.julialang.org/t/multivariate-normality-tests/8384)

<div class="topic-metadata">

**Author:** [@anriseth](https://discourse.julialang.org/u/anriseth)\
**Replies:** 4\
**Last updated:** [November 26, 2018, 10:04am UTC](https://discourse.julialang.org/t/multivariate-normality-tests/8384 "2018-11-26T10:04:13Z")

</div>

Are there any packages for running multivariate normality tests on data in the Juliaverse? I am looking for something along the lines of the R package MVN

---

## [Transform vector of parameters with TransformVariables.jl](https://discourse.julialang.org/t/transform-vector-of-parameters-with-transformvariables-jl/17923)

<div class="topic-metadata">

**Author:** [@jkbest2](https://discourse.julialang.org/u/jkbest2)\
**Replies:** 3\
**Last updated:** [November 24, 2018, 11:01am UTC](https://discourse.julialang.org/t/transform-vector-of-parameters-with-transformvariables-jl/17923 "2018-11-24T11:01:04Z")

</div>

I am trying to set up a log-posterior for MCMC sampling using DynamicHMC.jl. I have two unconstrained parameters, and then a vector of parameters that must be negative. Using TransformVariables.jl, I declare problem\_tra…

---

## [Any Julia's equivalent to R's packages mcgv or mixed-effects models larger than memory?](https://discourse.julialang.org/t/any-julias-equivalent-to-rs-packages-mcgv-or-mixed-effects-models-larger-than-memory/11865)

<div class="topic-metadata">

**Author:** [@Juan](https://discourse.julialang.org/u/Juan)\
**Replies:** 9\
**Last updated:** [November 19, 2018, 4:41pm UTC](https://discourse.julialang.org/t/any-julias-equivalent-to-rs-packages-mcgv-or-mixed-effects-models-larger-than-memory/11865 "2018-11-19T16:41:28Z")

</div>

Hello. I’m interested in fitting mixed effects models with large dataset that don’t fit on memory. R’s lme4 it’s too slow and doesn’t work if the dataset is large (a fraction of your RAM). speedglm and mgcv are a litt…

---

## [Multivariate logistic regression with interaction terms in Julia language](https://discourse.julialang.org/t/multivariate-logistic-regression-with-interaction-terms-in-julia-language/17611)

<div class="topic-metadata">

**Author:** [@haley](https://discourse.julialang.org/u/haley)\
**Replies:** 1\
**Last updated:** [November 16, 2018, 9:04pm UTC](https://discourse.julialang.org/t/multivariate-logistic-regression-with-interaction-terms-in-julia-language/17611 "2018-11-16T21:04:22Z")

</div>

Hello, I cannot find the answer to this question: Is is possible to learn logistic regression models of the form log(P / 1 - P) = a0 + a1 x1 + a2 x2 + a3 x3 + a12 x1 x2 + a13 x1 x3 + a23 x2 x3 + a123 x1 x2 x3? Thanks …

---

## [Odd slight perturbation in HypothesisTests](https://discourse.julialang.org/t/odd-slight-perturbation-in-hypothesistests/17582)

<div class="topic-metadata">

**Author:** [@iwelch](https://discourse.julialang.org/u/iwelch)\
**Replies:** 5\
**Last updated:** [November 16, 2018, 3:42pm UTC](https://discourse.julialang.org/t/odd-slight-perturbation-in-hypothesistests/17582 "2018-11-16T15:42:22Z")

</div>

julia\> using HypothesisTests, Random; julia\> Random.seed!(0); x= randn(100); y= randn(100); julia\> OneSampleTTest(x,y) the point estimate is slightly unstable. it may output one of the two: point estimate: …

---

## [Is there a GLMM package?](https://discourse.julialang.org/t/is-there-a-glmm-package/8655)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 9\
**Last updated:** [November 12, 2018, 2:40pm UTC](https://discourse.julialang.org/t/is-there-a-glmm-package/8655 "2018-11-12T14:40:58Z")

</div>

There is a mixed-effects model package and a generalized linear model package. But is there a package for Generalized linear mixed model (something like R’s glmm package)?

---

## [CovarianceMatrices stderr()](https://discourse.julialang.org/t/covariancematrices-stderr/17216)

<div class="topic-metadata">

**Author:** [@iwelch](https://discourse.julialang.org/u/iwelch)\
**Replies:** 2\
**Last updated:** [November 6, 2018, 7:09pm UTC](https://discourse.julialang.org/t/covariancematrices-stderr/17216 "2018-11-06T19:09:33Z")

</div>

this is a minor headscratcher: julia\> using GLM, CovarianceMatrices julia\> yb= \[1.0:10.0;\]; df= DataFrame( y=yb, x1= yb.^2, x2= yb.^3 ); julia\> mylm= glm( @formula(y~x1+x2), df, Normal(), IdentityLink()); julia\> vcov…

---

## [Censored regression and IV models?](https://discourse.julialang.org/t/censored-regression-and-iv-models/17150)

<div class="topic-metadata">

**Author:** [@iwelch](https://discourse.julialang.org/u/iwelch)\
**Replies:** 6\
**Last updated:** [November 5, 2018, 3:57pm UTC](https://discourse.julialang.org/t/censored-regression-and-iv-models/17150 "2018-11-05T15:57:51Z")

</div>

Does julia already have a package suited to censored regression models, as in Tobit model - Wikipedia ? (PS: InstrumentalVariables? Giuseppe Ragusa’s package is no longer working—and it is not in the repository, either…

---

## [Use of StatsModels?](https://discourse.julialang.org/t/use-of-statsmodels/16979)

<div class="topic-metadata">

**Author:** [@mcreel](https://discourse.julialang.org/u/mcreel)\
**Replies:** 7\
**Last updated:** [October 31, 2018, 12:44pm UTC](https://discourse.julialang.org/t/use-of-statsmodels/16979 "2018-10-31T12:44:05Z")

</div>

I’m interested in making some of my modeling functions accept dataframes and fomulae as inputs, using the StatsModels package. Is the following the proper way to achieve this? My plan would be to do something like usin…

---

## [Multivariate Normal with Positive Semi-Definite Covariance Matrix](https://discourse.julialang.org/t/multivariate-normal-with-positive-semi-definite-covariance-matrix/3029)

<div class="topic-metadata">

**Author:** [@jacobcvt12](https://discourse.julialang.org/u/jacobcvt12)\
**Replies:** 19\
**Last updated:** [October 25, 2018, 3:35pm UTC](https://discourse.julialang.org/t/multivariate-normal-with-positive-semi-definite-covariance-matrix/3029 "2018-10-25T15:35:55Z")

</div>

Hi All, I’m using julia to sample from a gaussian process with squared exponential kernel. using Distributions, Distances x\_star = -5:0.1:5 K = exp(-0.5 \* pairwise(SqEuclidean(), x\_star')) f\_star = rand(MvNormal(K), 1…

---

## [Is there someone working on a port of R margins?](https://discourse.julialang.org/t/is-there-someone-working-on-a-port-of-r-margins/16469)

<div class="topic-metadata">

**Author:** [@mwsohn](https://discourse.julialang.org/u/mwsohn)\
**Replies:** 0\
**Last updated:** [October 17, 2018, 10:50pm UTC](https://discourse.julialang.org/t/is-there-someone-working-on-a-port-of-r-margins/16469 "2018-10-17T22:50:21Z")

</div>

This will be a very useful package to port.

---

## [Learning Bayesian data analysis using Julia](https://discourse.julialang.org/t/learning-bayesian-data-analysis-using-julia/5370)

<div class="topic-metadata">

**Author:** [@EricChameroy](https://discourse.julialang.org/u/EricChameroy)\
**Replies:** 22\
**Last updated:** [October 16, 2018, 1:38pm UTC](https://discourse.julialang.org/t/learning-bayesian-data-analysis-using-julia/5370 "2018-10-16T13:38:49Z")

</div>

Hi everyone, I’m trying to teach myself Bayesian data analysis (and Julia) by working through Statistical Rethinking by Richard McElreath. Has anyone, familiar with the book, tried working through the code examples usin…

---

## [Fast sampling from discrete distributions](https://discourse.julialang.org/t/fast-sampling-from-discrete-distributions/16372)

<div class="topic-metadata">

**Author:** [@vancleve](https://discourse.julialang.org/u/vancleve)\
**Replies:** 0\
**Last updated:** [October 15, 2018, 11:40pm UTC](https://discourse.julialang.org/t/fast-sampling-from-discrete-distributions/16372 "2018-10-15T23:40:45Z")

</div>

I’m writing some population simulations that make heavy use of categorical/multinomial sampling. I can see from the code that the categorical and multinomial samplers use the alias table method. In this multinomial, the…

---

## [Observation is sum of random variables in Turing](https://discourse.julialang.org/t/observation-is-sum-of-random-variables-in-turing/15963)

<div class="topic-metadata">

**Author:** [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)\
**Replies:** 1\
**Last updated:** [October 6, 2018, 9:54pm UTC](https://discourse.julialang.org/t/observation-is-sum-of-random-variables-in-turing/15963 "2018-10-06T21:54:58Z")

</div>

I’m playing around with Turing.jl for the first time and am trying to infer my weight from a sequence of noisy observations. The reason I’m looking at MCMC is I want to experiment with different noise models and not only…

---

## [Nobs() -\> Float or Int?](https://discourse.julialang.org/t/nobs-float-or-int/15485)

<div class="topic-metadata">

**Author:** [@iwelch](https://discourse.julialang.org/u/iwelch)\
**Replies:** 5\
**Last updated:** [September 27, 2018, 4:28pm UTC](https://discourse.julialang.org/t/nobs-float-or-int/15485 "2018-09-27T16:28:26Z")

</div>

minor question: shouldn’t nobs() return an integer for a GLM lm model? julia\> y= \[1:10;\] ; X= hcat( fill(1,10), y.^2, y.^3 ); julia\> nobs( GLM.lm(X,y) ) 10.0 are there cases where this can become a fraction?

---

## [Missing or NaN Data in GLM (e.g., in DataFrame, @formula)](https://discourse.julialang.org/t/missing-or-nan-data-in-glm-e-g-in-dataframe-formula/14783)

<div class="topic-metadata">

**Author:** [@iwelch](https://discourse.julialang.org/u/iwelch)\
**Replies:** 10\
**Last updated:** [September 12, 2018, 2:26pm UTC](https://discourse.julialang.org/t/missing-or-nan-data-in-glm-e-g-in-dataframe-formula/14783 "2018-09-12T14:26:29Z")

</div>

If a series contains missing or NaN values, R will ignore the missing observations in its lm command. This is convenient when one runs different models, which have different observations due to variations in whether the…

---

## [Is there a package implementing the Box and Cox (1964) method for transforming data?](https://discourse.julialang.org/t/is-there-a-package-implementing-the-box-and-cox-1964-method-for-transforming-data/14024)

<div class="topic-metadata">

**Author:** [@jjlynch](https://discourse.julialang.org/u/jjlynch)\
**Replies:** 5\
**Last updated:** [September 9, 2018, 6:33pm UTC](https://discourse.julialang.org/t/is-there-a-package-implementing-the-box-and-cox-1964-method-for-transforming-data/14024 "2018-09-09T18:33:09Z")

</div>

HI, I’m new to Julia and looking to convert some of my workflow. I was wondering if there is an implementation of the maximum likelihood-like approach of Box and Cox (1964)?

---

## [Publication & DOI on JuliaStats package](https://discourse.julialang.org/t/publication-doi-on-juliastats-package/14479)

<div class="topic-metadata">

**Author:** [@mbesancon](https://discourse.julialang.org/u/mbesancon)\
**Replies:** 9\
**Last updated:** [September 5, 2018, 9:22pm UTC](https://discourse.julialang.org/t/publication-doi-on-juliastats-package/14479 "2018-09-05T21:22:47Z")

</div>

Unlike other Julia ecosystems, there is no publication associated to packages of the JuliaStats ecosystem. It would be nice to have the software citable For packages which would not be considered worth a paper, a DOI th…

---

## [Logistic regression with GLM : not working with Categorical Arrays?](https://discourse.julialang.org/t/logistic-regression-with-glm-not-working-with-categorical-arrays/14411)

<div class="topic-metadata">

**Author:** [@kirtsar](https://discourse.julialang.org/u/kirtsar)\
**Replies:** 1\
**Last updated:** [September 2, 2018, 3:08am UTC](https://discourse.julialang.org/t/logistic-regression-with-glm-not-working-with-categorical-arrays/14411 "2018-09-02T03:08:49Z")

</div>

Hello there! I’m trying to do logistic regression using GLM Package. My Y-variable is of type categorical array, the predictor is the usual Float64-array. When I’m trying to make a model with @formula(Y ~ X), I’ve got a…

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

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