# Statistics

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

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

**Page:** 11

---

## [Implementing r's stan\_glm() in Julia](https://discourse.julialang.org/t/implementing-rs-stan-glm-in-julia/78916)

<div class="topic-metadata">

**Author:** [@charperflow](https://discourse.julialang.org/u/charperflow)\
**Replies:** 5\
**Last updated:** [April 3, 2022, 7:56pm UTC](https://discourse.julialang.org/t/implementing-rs-stan-glm-in-julia/78916 "2022-04-03T19:56:55Z")

</div>

I am working through “Regression and Other Stories” for a class. All of the examples are done in R and I have been trying to recreate them in Julia for practice. For the most part it has been no problem, however, I am h…

---

## [Turing: problem using MCMCthreads()](https://discourse.julialang.org/t/turing-problem-using-mcmcthreads/78906)

<div class="topic-metadata">

**Author:** [@mcreel](https://discourse.julialang.org/u/mcreel)\
**Replies:** 8\
**Last updated:** [April 3, 2022, 4:12pm UTC](https://discourse.julialang.org/t/turing-problem-using-mcmcthreads/78906 "2022-04-03T16:12:15Z")

</div>

I am getting an error when trying to use MCMCthreads() for sampling. The following code works fine: chain = sample(MSM(m, S, model), MH(:θt =\> AdvancedMH.RandomWalkProposal(MvNormal(zeros(size(m,1)), tuning\*Σp))), …

---

## [A few questions about my workflow for quickly investigating data!](https://discourse.julialang.org/t/a-few-questions-about-my-workflow-for-quickly-investigating-data/78913)

<div class="topic-metadata">

**Author:** [@charperflow](https://discourse.julialang.org/u/charperflow)\
**Replies:** 10\
**Last updated:** [April 3, 2022, 10:47am UTC](https://discourse.julialang.org/t/a-few-questions-about-my-workflow-for-quickly-investigating-data/78913 "2022-04-03T10:47:12Z")

</div>

I am taking an upper level stats course taught in r. I have been doing a duplicate of the assignments in Julia, which has been a lot of fun. However, I have come across a few sticking points. I’ll just stick to one in th…

---

## [Random draws of multivariate normal with positive semi-definite covariance matrix](https://discourse.julialang.org/t/random-draws-of-multivariate-normal-with-positive-semi-definite-covariance-matrix/78493)

<div class="topic-metadata">

**Author:** [@AAL](https://discourse.julialang.org/u/AAL)\
**Replies:** 4\
**Last updated:** [March 26, 2022, 3:47pm UTC](https://discourse.julialang.org/t/random-draws-of-multivariate-normal-with-positive-semi-definite-covariance-matrix/78493 "2022-03-26T15:47:52Z")

</div>

I am trying to generate random draws from a multivariate normal distribution with positive semi-definite covariance matrices. The Distributions.jl MvNormal only handles positive definite covariance matrices and throws an…

---

## [MVN CDF -- have it coded, need help getting integrating into Distributions.jl](https://discourse.julialang.org/t/mvn-cdf-have-it-coded-need-help-getting-integrating-into-distributions-jl/38631)

<div class="topic-metadata">

**Author:** [@blackeneth](https://discourse.julialang.org/u/blackeneth)\
**Replies:** 18\
**Last updated:** [March 25, 2022, 7:43pm UTC](https://discourse.julialang.org/t/mvn-cdf-have-it-coded-need-help-getting-integrating-into-distributions-jl/38631 "2022-03-25T19:43:33Z")

</div>

Summary I have written a Julia function to compute the Multivariate Normal integral. I need a partner who is an expert in Distributions.jl to properly integrate it into the code base. Introduction I have written a fu…

---

## [Fitting a binary model where the groups are on both sides](https://discourse.julialang.org/t/fitting-a-binary-model-where-the-groups-are-on-both-sides/78327)

<div class="topic-metadata">

**Author:** [@rikh](https://discourse.julialang.org/u/rikh)\
**Replies:** 0\
**Last updated:** [March 23, 2022, 10:49am UTC](https://discourse.julialang.org/t/fitting-a-binary-model-where-the-groups-are-on-both-sides/78327 "2022-03-23T10:49:19Z")

</div>

I’m trying to fit a model to predict graduation versus dropout, that is, a binary logistic regression. Theoretically and based on the data, I suspect that dropouts are more likely to be extremely slow or extremely quick,…

---

## [Turing.jl and StaticArrays](https://discourse.julialang.org/t/turing-jl-and-staticarrays/77768)

<div class="topic-metadata">

**Author:** [@Marco\_Lombardi](https://discourse.julialang.org/u/Marco_Lombardi)\
**Replies:** 1\
**Last updated:** [March 18, 2022, 8:59am UTC](https://discourse.julialang.org/t/turing-jl-and-staticarrays/77768 "2022-03-18T08:59:34Z")

</div>

I am having troubles using Turing.jl with a custom distribution using a StaticArray as internal parameter. Consider the simple code below, where the TestDistribution is effectively a simple multivariate normal 3D distrib…

---

## [Approximating a Numerically Computed Distribution](https://discourse.julialang.org/t/approximating-a-numerically-computed-distribution/77972)

<div class="topic-metadata">

**Author:** [@marcpabst](https://discourse.julialang.org/u/marcpabst)\
**Replies:** 5\
**Last updated:** [March 17, 2022, 2:13pm UTC](https://discourse.julialang.org/t/approximating-a-numerically-computed-distribution/77972 "2022-03-17T14:13:43Z")

</div>

I have a very simple, numerically computed posterior (note that I’m not randomly sampling from the posterior but actually calculate it’s (log-)densities over a given interval) that I know converges to a Normal distributi…

---

## [Hypothesis testing in Julia](https://discourse.julialang.org/t/hypothesis-testing-in-julia/77784)

<div class="topic-metadata">

**Author:** [@mihrits](https://discourse.julialang.org/u/mihrits)\
**Replies:** 4\
**Last updated:** [March 14, 2022, 8:29pm UTC](https://discourse.julialang.org/t/hypothesis-testing-in-julia/77784 "2022-03-14T20:29:18Z")

</div>

I am taking a statistical data science course that is taught using R, and I am trying to replicate all the practical things in Julia. As we are doing quite basic stuff, mostly everything has been quite straightforward an…

---

## [Is there a function for batch mean and std](https://discourse.julialang.org/t/is-there-a-function-for-batch-mean-and-std/77849)

<div class="topic-metadata">

**Author:** [@GHTaarn](https://discourse.julialang.org/u/GHTaarn)\
**Replies:** 2\
**Last updated:** [March 14, 2022, 10:10am UTC](https://discourse.julialang.org/t/is-there-a-function-for-batch-mean-and-std/77849 "2022-03-14T10:10:08Z")

</div>

Hi, Is there a package that has a function doing something similar to Batch updates for simple statistics In other words, I want to calculate std(vcat(a,b)) and know mean(a), mean(b), std(a), std(b), length(a), length(…

---

## [New Distribution Stack Overflow](https://discourse.julialang.org/t/new-distribution-stack-overflow/77128)

<div class="topic-metadata">

**Author:** [@enweg](https://discourse.julialang.org/u/enweg)\
**Replies:** 3\
**Last updated:** [March 13, 2022, 6:48pm UTC](https://discourse.julialang.org/t/new-distribution-stack-overflow/77128 "2022-03-13T18:48:40Z")

</div>

I am currently trying to implement a distribution using the Distributions.jl interface. However, when following the guidelines mentioned here for multivariate distributions (Create New Samplers and Distributions · Distri…

---

## [Generalized additive models in julia?](https://discourse.julialang.org/t/generalized-additive-models-in-julia/10041)

<div class="topic-metadata">

**Author:** [@Ken-B](https://discourse.julialang.org/u/Ken-B)\
**Replies:** 9\
**Last updated:** [March 11, 2022, 12:38pm UTC](https://discourse.julialang.org/t/generalized-additive-models-in-julia/10041 "2022-03-11T12:38:29Z")

</div>

Hi, Is anyone using generalized additive models in julia? I know I can link to pyGAM with PyCall or gam with RCall, but I find both packages don’t scale well. My current dataset is of the order 100million rows. I’m wi…

---

## [Stratified and weighted sampling in dataframes](https://discourse.julialang.org/t/stratified-and-weighted-sampling-in-dataframes/77565)

<div class="topic-metadata">

**Author:** [@George\_Githinji](https://discourse.julialang.org/u/George_Githinji)\
**Replies:** 8\
**Last updated:** [March 8, 2022, 7:11pm UTC](https://discourse.julialang.org/t/stratified-and-weighted-sampling-in-dataframes/77565 "2022-03-08T19:11:37Z")

</div>

I have a function that can take a random sample from a dataframe. However I ran into an issue when working with grouped a dataframe in which case I have grouped the data by several columns and I would like to sample with…

---

## [How to standardize arrays in Julia?](https://discourse.julialang.org/t/how-to-standardize-arrays-in-julia/54046)

<div class="topic-metadata">

**Author:** [@Shazman](https://discourse.julialang.org/u/Shazman)\
**Replies:** 7\
**Last updated:** [March 8, 2022, 7:46am UTC](https://discourse.julialang.org/t/how-to-standardize-arrays-in-julia/54046 "2022-03-08T07:46:16Z")

</div>

I have two arrays (m and n) and each has one column with 100 elements. the first array is sampled from a normal distribution with mean 0 and standard deviation 1, the second one is sampled from a normal distribution with…

---

## [How to solve regression problem with no related data each other](https://discourse.julialang.org/t/how-to-solve-regression-problem-with-no-related-data-each-other/77350)

<div class="topic-metadata">

**Author:** [@RickandMortyforever](https://discourse.julialang.org/u/RickandMortyforever)\
**Replies:** 5\
**Last updated:** [March 4, 2022, 1:21am UTC](https://discourse.julialang.org/t/how-to-solve-regression-problem-with-no-related-data-each-other/77350 "2022-03-04T01:21:01Z")

</div>

This is more of a problem solving question rather than programming. I’ll delete this post if it is not appropriate. I am trying to solve a regression problem. And I looked at scatter plot that is frustrating me. …

---

## [NaiveBayes.jl alternative?](https://discourse.julialang.org/t/naivebayes-jl-alternative/77371)

<div class="topic-metadata">

**Author:** [@compleat](https://discourse.julialang.org/u/compleat)\
**Replies:** 0\
**Last updated:** [March 3, 2022, 5:17pm UTC](https://discourse.julialang.org/t/naivebayes-jl-alternative/77371 "2022-03-03T17:17:35Z")

</div>

This looks like it was a neat package but no longer works with its own examples which haven’t been updated since 2016. Does anyone know of an alternative package that does the same thing? Thanks for any help.

---

## [GLM/FixedEffectModels Error: expansion cannot be computed](https://discourse.julialang.org/t/glm-fixedeffectmodels-error-expansion-cannot-be-computed/77030)

<div class="topic-metadata">

**Author:** [@Shresth-Garg](https://discourse.julialang.org/u/Shresth-Garg)\
**Replies:** 12\
**Last updated:** [March 2, 2022, 1:53pm UTC](https://discourse.julialang.org/t/glm-fixedeffectmodels-error-expansion-cannot-be-computed/77030 "2022-03-02T13:53:49Z")

</div>

I recently updated my Julia setup to 1.7.2, along with updating all the packages. I am getting a strange error when running a linear model under both GLM and FixedEffectModels. I get this error only on some specification…

---

## [StatsBase vs Statistics](https://discourse.julialang.org/t/statsbase-vs-statistics/15326)

<div class="topic-metadata">

**Author:** [@iwelch](https://discourse.julialang.org/u/iwelch)\
**Replies:** 11\
**Last updated:** [February 25, 2022, 3:16pm UTC](https://discourse.julialang.org/t/statsbase-vs-statistics/15326 "2022-02-25T15:16:52Z")

</div>

I am wondering whether the naming of StatsBase and Statistics is entirely logical. StatsBase, despite its name, is the “more optional” package. Statistics is included in the base. StatsBase needs to be Pkg.added. may…

---

## [How to test if values are randomly distributed in a matrix?](https://discourse.julialang.org/t/how-to-test-if-values-are-randomly-distributed-in-a-matrix/76966)

<div class="topic-metadata">

**Author:** [@Fred](https://discourse.julialang.org/u/Fred)\
**Replies:** 6\
**Last updated:** [February 24, 2022, 6:09pm UTC](https://discourse.julialang.org/t/how-to-test-if-values-are-randomly-distributed-in-a-matrix/76966 "2022-02-24T18:09:55Z")

</div>

Hi ! I build an image from a matrix with (X,Y) coordinates and intensities (I). Do you know a function to score the randomness of the intensities distribution in this matrix. In other words, is there a statistical test …

---

## [Anderson-Darling test pvalue](https://discourse.julialang.org/t/anderson-darling-test-pvalue/76929)

<div class="topic-metadata">

**Author:** [@as4831](https://discourse.julialang.org/u/as4831)\
**Replies:** 5\
**Last updated:** [February 23, 2022, 10:37pm UTC](https://discourse.julialang.org/t/anderson-darling-test-pvalue/76929 "2022-02-23T22:37:12Z")

</div>

Hi everyone, I’m using an Anderson-Darling test to check for normality and am unsure about the results. I am expecting to reject at the .01 level with a p-value around .008. The pvalue() call on the OneSampleADTest retur…

---

## [Trying to understand parallel performance in Turing](https://discourse.julialang.org/t/trying-to-understand-parallel-performance-in-turing/74963)

<div class="topic-metadata">

**Author:** [@Pablo\_Marchant](https://discourse.julialang.org/u/Pablo_Marchant)\
**Replies:** 6\
**Last updated:** [February 23, 2022, 10:00pm UTC](https://discourse.julialang.org/t/trying-to-understand-parallel-performance-in-turing/74963 "2022-02-23T22:00:44Z")

</div>

Hi! I’ve been learning Turing for the last couple of weeks and while trying to make the most out of the 8 cores in my computer, I realized performance was not scaling as I expected when sampling multiple chains with mul…

---

## [What plotting library to use for HEP](https://discourse.julialang.org/t/what-plotting-library-to-use-for-hep/76962)

<div class="topic-metadata">

**Author:** [@shoram](https://discourse.julialang.org/u/shoram)\
**Replies:** 3\
**Last updated:** [February 23, 2022, 9:08am UTC](https://discourse.julialang.org/t/what-plotting-library-to-use-for-hep/76962 "2022-02-23T09:08:07Z")

</div>

Hi all, I am starting my phd in particle physics and would love to use Julia for data analysis/visualization. Do you have any advice on what plotting library should I use which has the most ROOT (from CERN) features? Si…

---

## [Where to discuss replacement of Rmath?](https://discourse.julialang.org/t/where-to-discuss-replacement-of-rmath/9671)

<div class="topic-metadata">

**Author:** [@dmbates](https://discourse.julialang.org/u/dmbates)\
**Replies:** 26\
**Last updated:** [February 22, 2022, 10:18pm UTC](https://discourse.julialang.org/t/where-to-discuss-replacement-of-rmath/9671 "2022-02-22T22:18:34Z")

</div>

A long-standing objective related to the Distributions and StatsFuns packages is to provide native Julia versions of various pdf (probability density or mass) and cdf (cumulative distribution) functions. The Rmath packa…

---

## [ANN: Simulated Neural Moments now uses Turing](https://discourse.julialang.org/t/ann-simulated-neural-moments-now-uses-turing/76843)

<div class="topic-metadata">

**Author:** [@mcreel](https://discourse.julialang.org/u/mcreel)\
**Replies:** 0\
**Last updated:** [February 21, 2022, 2:59pm UTC](https://discourse.julialang.org/t/ann-simulated-neural-moments-now-uses-turing/76843 "2022-02-21T14:59:33Z")

</div>

Following the simple example of ABC/MSM using Turing.jl (ABC / MSM with Turing.jl), I have updated the https://github.com/mcreel/SimulatedNeuralMoments.jl package to write the likelihood using the Turing.jl PPL form. Sam…

---

## [BoundsError using fit(LassoPath, X,Y, lambda = grid)](https://discourse.julialang.org/t/boundserror-using-fit-lassopath-x-y-lambda-grid/76831)

<div class="topic-metadata">

**Author:** [@Aminath\_Shausan](https://discourse.julialang.org/u/Aminath_Shausan)\
**Replies:** 1\
**Last updated:** [February 21, 2022, 7:28am UTC](https://discourse.julialang.org/t/boundserror-using-fit-lassopath-x-y-lambda-grid/76831 "2022-02-21T07:28:44Z")

</div>

Hi, I am a beginner of Julia language. I am learning to fit a multiple regression model using lasso.jl, with fit(LassoPath, X,Y, lambda = grid) My feature matrix (X) contains 238 variables with 52 rows. The response ve…

---

## [How may I reproduce the \`Distributions.jl\` logo?](https://discourse.julialang.org/t/how-may-i-reproduce-the-distributions-jl-logo/76631)

<div class="topic-metadata">

**Author:** [@lrnv](https://discourse.julialang.org/u/lrnv)\
**Replies:** 3\
**Last updated:** [February 17, 2022, 4:33pm UTC](https://discourse.julialang.org/t/how-may-i-reproduce-the-distributions-jl-logo/76631 "2022-02-17T16:33:32Z")

</div>

Hey, I’m trying to reproduce the Distributions.jl logo. Is there somewhere a code I can use to reproduce this logo ? I cannot retrace back the logo further than this PR : https://github.com/JuliaStats/Distributions.jl/p…

---

## [PCA Output?](https://discourse.julialang.org/t/pca-output/22687)

<div class="topic-metadata">

**Author:** [@Gunter\_Faes](https://discourse.julialang.org/u/Gunter_Faes)\
**Replies:** 25\
**Last updated:** [February 17, 2022, 7:36am UTC](https://discourse.julialang.org/t/pca-output/22687 "2022-02-17T07:36:46Z")

</div>

Thanks to your support I can now estimate my PCA model and get the following output (MultivariateStats): PCA(indim = 1599, outdim = 3, principalratio = 0.99857) The methods offered by PCA seem a little rudimentary to m…

---

## [\[FixedEffectModels.jl\] Getting strange MethodError on fresh install](https://discourse.julialang.org/t/fixedeffectmodels-jl-getting-strange-methoderror-on-fresh-install/76505)

<div class="topic-metadata">

**Author:** [@sagarsxn](https://discourse.julialang.org/u/sagarsxn)\
**Replies:** 2\
**Last updated:** [February 15, 2022, 11:43pm UTC](https://discourse.julialang.org/t/fixedeffectmodels-jl-getting-strange-methoderror-on-fresh-install/76505 "2022-02-15T23:43:44Z")

</div>

Hi, I am new to Julia and trying to work with FixedEffectModels.jl but I am unable to get it to work without throwing the following error: MethodError: no method matching stderror(::FixedEffectModel) I have tried unins…

---

## [ABC / MSM with Turing.jl](https://discourse.julialang.org/t/abc-msm-with-turing-jl/76189)

<div class="topic-metadata">

**Author:** [@mcreel](https://discourse.julialang.org/u/mcreel)\
**Replies:** 4\
**Last updated:** [February 11, 2022, 3:48pm UTC](https://discourse.julialang.org/t/abc-msm-with-turing-jl/76189 "2022-02-11T15:48:49Z")

</div>

I believe that ABC (approximate Bayesian computing) and/or Bayesian MSM (method of simulated moments) are not yet well supported by Turing.jl. I have come up with a simple example that does the basic steps, and it was su…

---

## [How to calculate cross-correlation on a 2D domain](https://discourse.julialang.org/t/how-to-calculate-cross-correlation-on-a-2d-domain/75161)

<div class="topic-metadata">

**Author:** [@Frazze](https://discourse.julialang.org/u/Frazze)\
**Replies:** 18\
**Last updated:** [February 6, 2022, 8:23pm UTC](https://discourse.julialang.org/t/how-to-calculate-cross-correlation-on-a-2d-domain/75161 "2022-02-06T20:23:50Z")

</div>

Hi everyone, I’m studying a scalar field u(x,t) on a 2D box LxL, with periodic boundary conditions. What I would like to do is to calculate the cross-correlation between u(x,t1) and u(x+r,t1) at varying of r, where r i…

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

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