# Latest

**URL:** https://discourse.julialang.org/latest.md?page=698

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

**Page:** 699

---

## [How to compute/calculate a Confidence Interval (CI)?](https://discourse.julialang.org/t/how-to-compute-calculate-a-confidence-interval-ci/74794)

<div class="topic-metadata">

**Author:** [@TheLateKronos](https://discourse.julialang.org/u/TheLateKronos)\
**Replies:** 4\
**Last updated:** [May 16, 2023, 10:54am UTC](https://discourse.julialang.org/t/how-to-compute-calculate-a-confidence-interval-ci/74794 "2023-05-16T10:54:59Z")

</div>

How can I calculate a confidence interval for a given distribution?

---

## [How to implement a lookup-table in ModellingToolkit](https://discourse.julialang.org/t/how-to-implement-a-lookup-table-in-modellingtoolkit/98912)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 3\
**Last updated:** [May 16, 2023, 10:24am UTC](https://discourse.julialang.org/t/how-to-implement-a-lookup-table-in-modellingtoolkit/98912 "2023-05-16T10:24:05Z")

</div>

Hello, I want to implement a wind turbine model using ModelingToolkit. The core model consists of only three differential equations, but it includes a lookup-table for the power coefficient. What is the best way to i…

---

## [What are the basis of this warning: \[DynamicPPL\] attempt to link a linked vi?](https://discourse.julialang.org/t/what-are-the-basis-of-this-warning-dynamicppl-attempt-to-link-a-linked-vi/98919)

<div class="topic-metadata">

**Author:** [@Sahil\_Khan](https://discourse.julialang.org/u/Sahil_Khan)\
**Replies:** 2\
**Last updated:** [May 16, 2023, 10:22am UTC](https://discourse.julialang.org/t/what-are-the-basis-of-this-warning-dynamicppl-attempt-to-link-a-linked-vi/98919 "2023-05-16T10:22:58Z")

</div>

I’m stuck because of this warning for several days now. I don’t see any obvious issue in my code. I have been through posts, one of recommendation was to use Turing.setadbackend(:zygote) though it didn’t work for me. I’…

---

## [Why Julia is giving a different answer than r?](https://discourse.julialang.org/t/why-julia-is-giving-a-different-answer-than-r/98918)

<div class="topic-metadata">

**Author:** [@Sahil\_Khan](https://discourse.julialang.org/u/Sahil_Khan)\
**Replies:** 5\
**Last updated:** [May 16, 2023, 9:30am UTC](https://discourse.julialang.org/t/why-julia-is-giving-a-different-answer-than-r/98918 "2023-05-16T09:30:19Z")

</div>

i have a simple equation as given below (julia code). I’m getting different answer as compare to r. Am I missing something? x=100 y=0 d = 20 h = -2 c = \[0, 1, 2, 3, 4, 5\] A = x .+ ((y - x) / (1 .+ (c / d).^h)) answer i…

---

## [Plotting parameters and variables on the same plot for Differential Equation solution](https://discourse.julialang.org/t/plotting-parameters-and-variables-on-the-same-plot-for-differential-equation-solution/98745)

<div class="topic-metadata">

**Author:** [@GertEhlers27](https://discourse.julialang.org/u/GertEhlers27)\
**Replies:** 10\
**Last updated:** [May 16, 2023, 8:10am UTC](https://discourse.julialang.org/t/plotting-parameters-and-variables-on-the-same-plot-for-differential-equation-solution/98745 "2023-05-16T08:10:17Z")

</div>

Hi Everyone, I am using DifferentialEquations.jl to solve an ODE. After solving it, I plot the different variables. The problem is: I want to add a parameter (p) to the same plot. Is it possible? I only see different …

---

## [Callback in Optimization.jl](https://discourse.julialang.org/t/callback-in-optimization-jl/98551)

<div class="topic-metadata">

**Author:** [@Avec](https://discourse.julialang.org/u/Avec)\
**Replies:** 2\
**Last updated:** [May 16, 2023, 3:40am UTC](https://discourse.julialang.org/t/callback-in-optimization-jl/98551 "2023-05-16T03:40:42Z")

</div>

Hi all, I am trying to use Optimization.jl package together with GCMAES.jl. The solve function of Optimization.jl should accept a callback function, but I am not able to make it work. Here is a MWE using Optimization, O…

---

## [Function whose parameter type is defined in another module](https://discourse.julialang.org/t/function-whose-parameter-type-is-defined-in-another-module/98600)

<div class="topic-metadata">

**Author:** [@zapiano](https://discourse.julialang.org/u/zapiano)\
**Replies:** 3\
**Last updated:** [May 16, 2023, 2:47am UTC](https://discourse.julialang.org/t/function-whose-parameter-type-is-defined-in-another-module/98600 "2023-05-16T02:47:16Z")

</div>

I have a custom module called Utilities, where I define the struct Utility # utilities.jl module Utilities export Utility mutable struct Utility # etc... end # ..etc end and another module called SimplexTools whe…

---

## [Cannot run Julia after trying to install packages](https://discourse.julialang.org/t/cannot-run-julia-after-trying-to-install-packages/62840)

<div class="topic-metadata">

**Author:** [@cesquivea](https://discourse.julialang.org/u/cesquivea)\
**Replies:** 11\
**Last updated:** [May 16, 2023, 12:34am UTC](https://discourse.julialang.org/t/cannot-run-julia-after-trying-to-install-packages/62840 "2023-05-16T00:34:15Z")

</div>

I am working on a university desktop computer which runs on Windows 10 Enterprise. I am set as administrator. I can download, install and run Julia after installation. When I attempt to install any package, the process…

---

## [How to calculate confidence interval?](https://discourse.julialang.org/t/how-to-calculate-confidence-interval/98876)

<div class="topic-metadata">

**Author:** [@Ashu](https://discourse.julialang.org/u/Ashu)\
**Replies:** 5\
**Last updated:** [May 16, 2023, 12:16am UTC](https://discourse.julialang.org/t/how-to-calculate-confidence-interval/98876 "2023-05-16T00:16:11Z")

</div>

Dear All, I have a random sample, let’s say, smpl = {1, 4, 2, 6, 10, 18, 3, 5, 20}. I wish to calculate a 99% confidence interval on \[minimum(smpl), maximum(smpl)\]=\[1, 20\]. I am able to calculate a 99% confidence interv…

---

## [How to use Wasserstein distance in OptimalTransport.jl](https://discourse.julialang.org/t/how-to-use-wasserstein-distance-in-optimaltransport-jl/98898)

<div class="topic-metadata">

**Author:** [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Replies:** 1\
**Last updated:** [May 15, 2023, 11:23pm UTC](https://discourse.julialang.org/t/how-to-use-wasserstein-distance-in-optimaltransport-jl/98898 "2023-05-15T23:23:44Z")

</div>

Hi all, I was hoping to compare probability distributions using Wasserstein distance. As a starting point, I was hoping to compare two discrete probability distributions, say \[.25.,25.,25.,25\] and \[0,.5,.2,.3\]. I found …

---

## [SciML demos](https://discourse.julialang.org/t/sciml-demos/98893)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 3\
**Last updated:** [May 15, 2023, 10:47pm UTC](https://discourse.julialang.org/t/sciml-demos/98893 "2023-05-15T22:47:12Z")

</div>

I am going over some demos in SciML. Consider the code fragment found at https://docs.sciml.ai/Overview/stable/showcase/missing\_physics/#autocomplete function predict(θ, X = Xₙ\[:, 1\], T = t) \_prob = remake(prob\_nn,…

---

## [Gradient for Cholesky decomposition with CuArrays with Zygote.jl](https://discourse.julialang.org/t/gradient-for-cholesky-decomposition-with-cuarrays-with-zygote-jl/98900)

<div class="topic-metadata">

**Author:** [@guixien](https://discourse.julialang.org/u/guixien)\
**Replies:** 0\
**Last updated:** [May 15, 2023, 9:47pm UTC](https://discourse.julialang.org/t/gradient-for-cholesky-decomposition-with-cuarrays-with-zygote-jl/98900 "2023-05-15T21:47:48Z")

</div>

Here’s a minimal example: using Zygote, CUDA, LinearAlgebra CUDA.allowscalar(false) C = cu(rand(5,5)) f(x) = sum(cholesky(x’ \* x).L) Zygote.gradient(f, C) While the CPU version works fine, this will throw the sca…

---

## [Creating three dimensional variable using JuMP](https://discourse.julialang.org/t/creating-three-dimensional-variable-using-jump/98870)

<div class="topic-metadata">

**Author:** [@Gagan\_Meena](https://discourse.julialang.org/u/Gagan_Meena)\
**Replies:** 6\
**Last updated:** [May 15, 2023, 9:26pm UTC](https://discourse.julialang.org/t/creating-three-dimensional-variable-using-jump/98870 "2023-05-15T21:26:13Z")

</div>

I have created a two dimensional variable using the following code. fnew = Vector{Vector{VariableRef}}(undef, c) eta = Vector{Vector{VariableRef}}(undef, c) for i = 1:c newlines = nm\_new\[i\] if newline…

---

## [Possible bug with dispatch on parametric abstract type](https://discourse.julialang.org/t/possible-bug-with-dispatch-on-parametric-abstract-type/98852)

<div class="topic-metadata">

**Author:** [@bgroenks](https://discourse.julialang.org/u/bgroenks)\
**Replies:** 9\
**Last updated:** [May 15, 2023, 8:31pm UTC](https://discourse.julialang.org/t/possible-bug-with-dispatch-on-parametric-abstract-type/98852 "2023-05-15T20:31:08Z")

</div>

Hi all, I think I may have encountered a possible bug in Julia’s method dispatch. But I would like to post this here first in case anyone can spot something that I have missed. I was able to reproduce the problem in a s…

---

## [Animation sine wave](https://discourse.julialang.org/t/animation-sine-wave/22797)

<div class="topic-metadata">

**Author:** [@PeterB1](https://discourse.julialang.org/u/PeterB1)\
**Replies:** 1\
**Last updated:** [May 15, 2023, 8:41pm UTC](https://discourse.julialang.org/t/animation-sine-wave/22797 "2023-05-15T20:41:14Z")

</div>

I try to do a simple animation of a travelling sine wave. My code is using Pkg Pkg.add(“Plots”) using Plots plotly() p =zeros(1) plot(p) #println(p) n=10 @gif for i=0:n push!(p, sin(i/5)) plot!(p) #println(i…

---

## [Simplify a nonlinear expression](https://discourse.julialang.org/t/simplify-a-nonlinear-expression/98772)

<div class="topic-metadata">

**Author:** [@VPBML](https://discourse.julialang.org/u/VPBML)\
**Replies:** 6\
**Last updated:** [May 15, 2023, 5:35pm UTC](https://discourse.julialang.org/t/simplify-a-nonlinear-expression/98772 "2023-05-15T17:35:51Z")

</div>

Hi, Is there any way we can simplify a nonlinear expression automatically in JuMP. For example, if we have: using JuMP, MadNLP model = Model(MadNLP.Optimizer) @variable(model, CA) @variable(model, CB) expr\_str = :($(CA…

---

## [PGFPlotsX invalid pgf key error](https://discourse.julialang.org/t/pgfplotsx-invalid-pgf-key-error/98839)

<div class="topic-metadata">

**Author:** [@keynescoefen](https://discourse.julialang.org/u/keynescoefen)\
**Replies:** 3\
**Last updated:** [May 15, 2023, 5:20pm UTC](https://discourse.julialang.org/t/pgfplotsx-invalid-pgf-key-error/98839 "2023-05-15T17:20:53Z")

</div>

Hello! When running Version 1.9.0 (2023-05-07) with the latest PGFPlotsX the following snippet gives me this error message. When using the generic plotting functions like so, I get the error message further below. usi…

---

## [Distributed for loop with timeout](https://discourse.julialang.org/t/distributed-for-loop-with-timeout/98854)

<div class="topic-metadata">

**Author:** [@psterzinger](https://discourse.julialang.org/u/psterzinger)\
**Replies:** 1\
**Last updated:** [May 15, 2023, 5:16pm UTC](https://discourse.julialang.org/t/distributed-for-loop-with-timeout/98854 "2023-05-15T17:16:05Z")

</div>

I’m trying to run a function, which consists of a nested for loop, in which each iteration writes to a SharedArray, and where the runtime between iterations varies unpredictably, with a timeout such that upon termination…

---

## [Package precompile fail with Distributed](https://discourse.julialang.org/t/package-precompile-fail-with-distributed/98887)

<div class="topic-metadata">

**Author:** [@Gabriel\_Kreindler](https://discourse.julialang.org/u/Gabriel_Kreindler)\
**Replies:** 0\
**Last updated:** [May 15, 2023, 5:06pm UTC](https://discourse.julialang.org/t/package-precompile-fail-with-distributed/98887 "2023-05-15T17:06:49Z")

</div>

I get a persistent error with the following code: git\_julia\_proj\_path = "SOME\_PATH" using Distributed n\_procs = 2 rmprocs(workers()) addprocs(2) # local first using Pkg Pkg.activate(git\_julia\_proj\_path) Pkg.precomp…

---

## [Help Interpolating Data (4D data cube)](https://discourse.julialang.org/t/help-interpolating-data-4d-data-cube/98868)

<div class="topic-metadata">

**Author:** [@HNormanW](https://discourse.julialang.org/u/HNormanW)\
**Replies:** 1\
**Last updated:** [May 15, 2023, 4:59pm UTC](https://discourse.julialang.org/t/help-interpolating-data-4d-data-cube/98868 "2023-05-15T16:59:21Z")

</div>

Hi, I got a few question on how to interpolate some models of mine. My goal is to interpolate the full data cube made from each of my diffraction grating models then, given some initial requirements, retrieve a simple l…

---

## [Is there a way to access a value of a variable in the previous steptime?](https://discourse.julialang.org/t/is-there-a-way-to-access-a-value-of-a-variable-in-the-previous-steptime/98867)

<div class="topic-metadata">

**Author:** [@HamzaKh99](https://discourse.julialang.org/u/HamzaKh99)\
**Replies:** 1\
**Last updated:** [May 15, 2023, 3:38pm UTC](https://discourse.julialang.org/t/is-there-a-way-to-access-a-value-of-a-variable-in-the-previous-steptime/98867 "2023-05-15T15:38:40Z")

</div>

Hello! I’m trying to access the value of a variable in the previous step time to use it afterward, I’m using discrete\_events() for that, but is there a simple way to do it?

---

## [Is it possible to make precompilation portable (for docker images built with a different CPU)?](https://discourse.julialang.org/t/is-it-possible-to-make-precompilation-portable-for-docker-images-built-with-a-different-cpu/95913)

<div class="topic-metadata">

**Author:** [@robsmith11](https://discourse.julialang.org/u/robsmith11)\
**Replies:** 1\
**Last updated:** [May 15, 2023, 3:11pm UTC](https://discourse.julialang.org/t/is-it-possible-to-make-precompilation-portable-for-docker-images-built-with-a-different-cpu/95913 "2023-05-15T15:11:21Z")

</div>

I recently realized why my docker images were taking ages to restart on production servers, but were much faster on dev servers (which happen to have the same CPU as the build servers). Precompilation is being done and …

---

## [Trying to understand how lazy computation works](https://discourse.julialang.org/t/trying-to-understand-how-lazy-computation-works/98871)

<div class="topic-metadata">

**Author:** [@rocco\_sprmnt21](https://discourse.julialang.org/u/rocco_sprmnt21)\
**Replies:** 6\
**Last updated:** [May 15, 2023, 2:34pm UTC](https://discourse.julialang.org/t/trying-to-understand-how-lazy-computation-works/98871 "2023-05-15T14:34:57Z")

</div>

Trying to understand the following argument A zero-argument anonymous function is written as ()-\>3. The idea of a function with no arguments may seem strange, but is useful for “delaying” a computation. In this usage, …

---

## [Parameter estimation DefaultOptimizationCache not defined (DiffEqFlux)](https://discourse.julialang.org/t/parameter-estimation-defaultoptimizationcache-not-defined-diffeqflux/98635)

<div class="topic-metadata">

**Author:** [@ANasc](https://discourse.julialang.org/u/ANasc)\
**Replies:** 5\
**Last updated:** [May 15, 2023, 2:25pm UTC](https://discourse.julialang.org/t/parameter-estimation-defaultoptimizationcache-not-defined-diffeqflux/98635 "2023-05-15T14:25:58Z")

</div>

Hi, I’m trying to learn the basics of parameter estimation with DiffEqFlux by adapting the first example from here https://docs.juliahub.com/DiffEqFlux/BdO4p/1.9.0/ to my own problem. However, I keep getting the followi…

---

## [\`peek\` seems to consume iterator elements?](https://discourse.julialang.org/t/peek-seems-to-consume-iterator-elements/98878)

<div class="topic-metadata">

**Author:** [@frylock](https://discourse.julialang.org/u/frylock)\
**Replies:** 4\
**Last updated:** [May 15, 2023, 2:09pm UTC](https://discourse.julialang.org/t/peek-seems-to-consume-iterator-elements/98878 "2023-05-15T14:09:11Z")

</div>

using Base.Iterators a = collect("abbcccddddeeeee") b = Base.Iterators.Stateful(a) while !isempty(b) c = peek(b) println(collect(takewhile(x -\> x == c, b))) end I’m trying to learn about Julia stateful iterato…

---

## [UndefVarError: \`execute\_msg\` not defined](https://discourse.julialang.org/t/undefvarerror-execute-msg-not-defined/98643)

<div class="topic-metadata">

**Author:** [@StranoArtista](https://discourse.julialang.org/u/StranoArtista)\
**Replies:** 3\
**Last updated:** [May 15, 2023, 1:28pm UTC](https://discourse.julialang.org/t/undefvarerror-execute-msg-not-defined/98643 "2023-05-15T13:28:23Z")

</div>

Hello there, I have a question. I am new at Julia. I am using JupyterNotebook with VSCode. I try execute readline() command in Jupyter but its not working. I got an error: UndefVarError: execute\_msg not defined But…

---

## [Function types](https://discourse.julialang.org/t/function-types/98445)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 4\
**Last updated:** [May 8, 2023, 9:51am UTC](https://discourse.julialang.org/t/function-types/98445 "2023-05-08T09:51:49Z")

</div>

Why don’t the two functions: a = t -\> cos b = t -\> 0. have the same type? As a result, one cannot do the following: fct = \[a, a\] fct\[1\] = b since the list is of the same type of a. On the other hand, fct = Any\[a,a\] …

---

## [Any way to speed up loading large precompiled packages?](https://discourse.julialang.org/t/any-way-to-speed-up-loading-large-precompiled-packages/98762)

<div class="topic-metadata">

**Author:** [@moble](https://discourse.julialang.org/u/moble)\
**Replies:** 35\
**Last updated:** [May 15, 2023, 12:54pm UTC](https://discourse.julialang.org/t/any-way-to-speed-up-loading-large-precompiled-packages/98762 "2023-05-15T12:54:05Z")

</div>

I have a package that my collaborators want to use like a script. Specifically, they want it to load quickly. Once it’s compiled, my part of the code is fast — around 0.01s, compared to the several seconds taken by my …

---

## [Creating a struct with symbolic (Symbolics package) functions and variables](https://discourse.julialang.org/t/creating-a-struct-with-symbolic-symbolics-package-functions-and-variables/98851)

<div class="topic-metadata">

**Author:** [@brombo](https://discourse.julialang.org/u/brombo)\
**Replies:** 4\
**Last updated:** [May 15, 2023, 12:49pm UTC](https://discourse.julialang.org/t/creating-a-struct-with-symbolic-symbolics-package-functions-and-variables/98851 "2023-05-15T12:49:56Z")

</div>

I am trying to write a struct with members to manipulate symbolic variables. I am a newbie to Julia. I have programmed in python using sympy for symbolic algebra. Here is the code I have so far - using Symbolics, Sym…

---

## [Interpreting profiling flame charts: function runs dramatically faster after calling unrelated function](https://discourse.julialang.org/t/interpreting-profiling-flame-charts-function-runs-dramatically-faster-after-calling-unrelated-function/98836)

<div class="topic-metadata">

**Author:** [@PatrickMcFarlane](https://discourse.julialang.org/u/PatrickMcFarlane)\
**Replies:** 4\
**Last updated:** [May 15, 2023, 12:42pm UTC](https://discourse.julialang.org/t/interpreting-profiling-flame-charts-function-runs-dramatically-faster-after-calling-unrelated-function/98836 "2023-05-15T12:42:36Z")

</div>

I am working on a code base to solve a large dynamic economic model with heterogeneous agents. I coded up two different iterative algorithms for solving the model. These are wrapped in functions that I’ll call f1 and f…

[Previous page](https://discourse.julialang.org/latest.md?page=697)

[Next page](https://discourse.julialang.org/latest.md?page=699)
