# Latest

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

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

**Page:** 825

---

## [How to use named parameters in objective function in Optimization.jl?](https://discourse.julialang.org/t/how-to-use-named-parameters-in-objective-function-in-optimization-jl/92360)

<div class="topic-metadata">

**Author:** [@ForceBru](https://discourse.julialang.org/u/ForceBru)\
**Replies:** 3\
**Last updated:** [December 31, 2022, 3:58pm UTC](https://discourse.julialang.org/t/how-to-use-named-parameters-in-objective-function-in-optimization-jl/92360 "2022-12-31T15:58:44Z")

</div>

I’d like to refer to my design variables (parameters) by name inside my objective function, like this: objective(params, data::AbstractVector) = sum(@. (params.a \* data + params.b)^2) What’s the recommended way of …

---

## [Lm (GLM) gives negative R2](https://discourse.julialang.org/t/lm-glm-gives-negative-r2/92346)

<div class="topic-metadata">

**Author:** [@jgr](https://discourse.julialang.org/u/jgr)\
**Replies:** 2\
**Last updated:** [December 31, 2022, 3:39pm UTC](https://discourse.julialang.org/t/lm-glm-gives-negative-r2/92346 "2022-12-31T15:39:48Z")

</div>

Hi, I’m using lm to estimate R2 for a regression. The data is not real data, and y and x are pretty much the same. I would expect a R2 close to 1, however, I got -Inf or other negative values. I’m not sure why. A replica…

---

## [Problems with posdef symmetric matrix and LinearSolve](https://discourse.julialang.org/t/problems-with-posdef-symmetric-matrix-and-linearsolve/92343)

<div class="topic-metadata">

**Author:** [@CodeLenz](https://discourse.julialang.org/u/CodeLenz)\
**Replies:** 3\
**Last updated:** [December 31, 2022, 3:04pm UTC](https://discourse.julialang.org/t/problems-with-posdef-symmetric-matrix-and-linearsolve/92343 "2022-12-31T15:04:59Z")

</div>

I am trying to move some FEM code to use the LinearSolve package. Consider the code using LinearAlgebra, SparseArrays, LinearSolve # Create a posdef symmetric matrix A = sprand(100,100,0.01); A = A + A' + 100\*I; # rhs…

---

## [How to publish a pdf with Weave](https://discourse.julialang.org/t/how-to-publish-a-pdf-with-weave/92337)

<div class="topic-metadata">

**Author:** [@ceysa75](https://discourse.julialang.org/u/ceysa75)\
**Replies:** 3\
**Last updated:** [December 31, 2022, 2:17pm UTC](https://discourse.julialang.org/t/how-to-publish-a-pdf-with-weave/92337 "2022-12-31T14:17:14Z")

</div>

Hi all, I am trying to generate a pdf document from my jmd file as follows: weave("myTest.jmd"; doctype = "md2pdf") However, for some reason it exits with an error (whereas a html can be generated without any issues). …

---

## [Github actions cache not working](https://discourse.julialang.org/t/github-actions-cache-not-working/92341)

<div class="topic-metadata">

**Author:** [@zStupan](https://discourse.julialang.org/u/zStupan)\
**Replies:** 1\
**Last updated:** [December 31, 2022, 5:19am UTC](https://discourse.julialang.org/t/github-actions-cache-not-working/92341 "2022-12-31T05:19:29Z")

</div>

Hi, I’m trying to make a simple test workflow for my project using github actions: name: CI on: pull\_request: branches: - main push: branches: - main tags: \["\*"\] jobs: test: name: Juli…

---

## [Dictionaries.jl token API](https://discourse.julialang.org/t/dictionaries-jl-token-api/92318)

<div class="topic-metadata">

**Author:** [@uniment](https://discourse.julialang.org/u/uniment)\
**Replies:** 5\
**Last updated:** [December 31, 2022, 3:26am UTC](https://discourse.julialang.org/t/dictionaries-jl-token-api/92318 "2022-12-31T03:26:51Z")

</div>

Reading the Dictionaries.jl readme, it looks like a really nice package that lot of effort went into. Very glad to have something like this. Thank you for your contribution! I’ve begun to play with it a bit to learn mor…

---

## [Secure systems: an alternate use case for PackageCompiler.jl](https://discourse.julialang.org/t/secure-systems-an-alternate-use-case-for-packagecompiler-jl/90955)

<div class="topic-metadata">

**Author:** [@Ashlin\_Harris](https://discourse.julialang.org/u/Ashlin_Harris)\
**Replies:** 4\
**Last updated:** [December 31, 2022, 2:11am UTC](https://discourse.julialang.org/t/secure-systems-an-alternate-use-case-for-packagecompiler-jl/90955 "2022-12-31T02:11:40Z")

</div>

Julia’s package manager relies on internet access, so it can be challenging to make dependencies available on secure systems. PackageCompiler.jl compiles Julia code ahead of time, primarily for improved performance in ce…

---

## [Zygote.forwardiff returns a scalar](https://discourse.julialang.org/t/zygote-forwardiff-returns-a-scalar/92329)

<div class="topic-metadata">

**Author:** [@Gattu\_Mytraya](https://discourse.julialang.org/u/Gattu_Mytraya)\
**Replies:** 1\
**Last updated:** [December 30, 2022, 11:32pm UTC](https://discourse.julialang.org/t/zygote-forwardiff-returns-a-scalar/92329 "2022-12-30T23:32:37Z")

</div>

I have a function which is built out of a large number of elementary functions, and as such reverse mode AD is much slower than forward mode. I would like to use Zygote for this problem as it has support for complex inpu…

---

## [Memory usage in Julia v1.9.0-beta2](https://discourse.julialang.org/t/memory-usage-in-julia-v1-9-0-beta2/92320)

<div class="topic-metadata">

**Author:** [@fastwave](https://discourse.julialang.org/u/fastwave)\
**Replies:** 5\
**Last updated:** [December 30, 2022, 11:22pm UTC](https://discourse.julialang.org/t/memory-usage-in-julia-v1-9-0-beta2/92320 "2022-12-30T23:22:35Z")

</div>

This caught my attention, as I had problems with the 1.8 series. However, I’ve found that 1.9 consumes about 5 x the memory for my use case, which went up from 1.7G (1.8.3) to 10.3G in 1.9.0-beta2 . In turn v1.8.3 is wor…

---

## [How to best iterate over k-dimensional collection, e.g. (n,k) matrix?](https://discourse.julialang.org/t/how-to-best-iterate-over-k-dimensional-collection-e-g-n-k-matrix/92328)

<div class="topic-metadata">

**Author:** [@Lighfe](https://discourse.julialang.org/u/Lighfe)\
**Replies:** 3\
**Last updated:** [December 30, 2022, 10:58pm UTC](https://discourse.julialang.org/t/how-to-best-iterate-over-k-dimensional-collection-e-g-n-k-matrix/92328 "2022-12-30T22:58:55Z")

</div>

I have a dataset with n rows and k columns I want to iterate over. What is the recommended way? Currently I would first create a n x k Matrix and then do two nested for-loops. I heard column wise is best for col in 1:k…

---

## [Subvector pattern matching](https://discourse.julialang.org/t/subvector-pattern-matching/92226)

<div class="topic-metadata">

**Author:** [@Adrien](https://discourse.julialang.org/u/Adrien)\
**Replies:** 12\
**Last updated:** [December 30, 2022, 10:23pm UTC](https://discourse.julialang.org/t/subvector-pattern-matching/92226 "2022-12-30T22:23:01Z")

</div>

I’m looking for a way to check whether a vector contains a sub-vector matching a certain conditional pattern. I wrote a quick and dirty macro doing this, here’s an example to illustrate what I mean: julia\> f=@match i, j…

---

## [SymPy returning Any\[\]](https://discourse.julialang.org/t/sympy-returning-any/92336)

<div class="topic-metadata">

**Author:** [@ejlongman](https://discourse.julialang.org/u/ejlongman)\
**Replies:** 1\
**Last updated:** [December 30, 2022, 9:42pm UTC](https://discourse.julialang.org/t/sympy-returning-any/92336 "2022-12-30T21:42:26Z")

</div>

I am experimenting with the SymPy module, and I wrote the following code to estimate moments 1 and 2 given moments 3 and 4. With two equations and two unknowns I should get exact answers, but the following code returns “…

---

## [Turing.jl setting different updates for arrays of variables](https://discourse.julialang.org/t/turing-jl-setting-different-updates-for-arrays-of-variables/92330)

<div class="topic-metadata">

**Author:** [@dariogasbarra](https://discourse.julialang.org/u/dariogasbarra)\
**Replies:** 2\
**Last updated:** [December 30, 2022, 8:44pm UTC](https://discourse.julialang.org/t/turing-jl-setting-different-updates-for-arrays-of-variables/92330 "2022-12-30T20:44:46Z")

</div>

Hello I have a model which has an array of discrete binary parameters J\[t\] and an array of continuous parameters X\[t\]. I want to use NUTS() or HMC() updates for the continuous variables and MH() updates for the dis…

---

## [LayeredLayouts.jl: solve\_positions crashes Julia process with malloc error](https://discourse.julialang.org/t/layeredlayouts-jl-solve-positions-crashes-julia-process-with-malloc-error/92335)

<div class="topic-metadata">

**Author:** [@roh\_codeur](https://discourse.julialang.org/u/roh_codeur)\
**Replies:** 0\
**Last updated:** [December 30, 2022, 8:34pm UTC](https://discourse.julialang.org/t/layeredlayouts-jl-solve-positions-crashes-julia-process-with-malloc-error/92335 "2022-12-30T20:34:58Z")

</div>

Hi I was using the awesome Julia package LayeredLayouts with the below code example: using LayeredLayouts, Graphs tiny\_depgraph = SimpleDiGraph(Edge.(\[ 1 =\> 2; 2 .=\> \[4, 5, 6\]; 3 .=\> \[…

---

## [Looking for advice on a guide I'm writing](https://discourse.julialang.org/t/looking-for-advice-on-a-guide-im-writing/91799)

<div class="topic-metadata">

**Author:** [@Steven\_Kell](https://discourse.julialang.org/u/Steven_Kell)\
**Replies:** 5\
**Last updated:** [December 30, 2022, 8:04pm UTC](https://discourse.julialang.org/t/looking-for-advice-on-a-guide-im-writing/91799 "2022-12-30T20:04:33Z")

</div>

Hello! So what’s up is that I am writing an overview of the REPL aimed at people who have never seen a command line before and would like to know what everyone thinks should be essential knowledge. I plan on covering mod…

---

## [How to create a RGB plot from three different TIF files?](https://discourse.julialang.org/t/how-to-create-a-rgb-plot-from-three-different-tif-files/92001)

<div class="topic-metadata">

**Author:** [@EmanuelCastanho](https://discourse.julialang.org/u/EmanuelCastanho)\
**Replies:** 17\
**Last updated:** [December 30, 2022, 4:47pm UTC](https://discourse.julialang.org/t/how-to-create-a-rgb-plot-from-three-different-tif-files/92001 "2022-12-30T16:47:47Z")

</div>

I have three TIF files that represent the Red, Green and Blue channels, they are pós-processed Sentinel-2 images. I read them with ArchGDAL and stacked them into a Float32 (554, 649, 3) matrix. How can I plot this stac…

---

## [My julia code is somehow much slower than the matlab code](https://discourse.julialang.org/t/my-julia-code-is-somehow-much-slower-than-the-matlab-code/91792)

<div class="topic-metadata">

**Author:** [@Wooheon](https://discourse.julialang.org/u/Wooheon)\
**Replies:** 54\
**Last updated:** [December 30, 2022, 4:26pm UTC](https://discourse.julialang.org/t/my-julia-code-is-somehow-much-slower-than-the-matlab-code/91792 "2022-12-30T16:26:35Z")

</div>

Hi, I’m new to Julia. So I used my existing MatLab code to make a counterpart for Julia. I heard Julia prefers the performance-demanding part inside a function, so I did it. However, still, the performance is far laggi…

---

## [Urban Planning model](https://discourse.julialang.org/t/urban-planning-model/92310)

<div class="topic-metadata">

**Author:** [@tonyhur](https://discourse.julialang.org/u/tonyhur)\
**Replies:** 2\
**Last updated:** [December 30, 2022, 4:19pm UTC](https://discourse.julialang.org/t/urban-planning-model/92310 "2022-12-30T16:19:29Z")

</div>

Sometimes ago I found a interesting Model in the Tutorial : the urban planning model. It has completely disappeared now. Why? Where can I find it? Thanks for clarification Tony

---

## [Problems installing packages - cert.pm no such file](https://discourse.julialang.org/t/problems-installing-packages-cert-pm-no-such-file/83995)

<div class="topic-metadata">

**Author:** [@jdarnold](https://discourse.julialang.org/u/jdarnold)\
**Replies:** 15\
**Last updated:** [December 30, 2022, 2:48pm UTC](https://discourse.julialang.org/t/problems-installing-packages-cert-pm-no-such-file/83995 "2022-12-30T14:48:43Z")

</div>

I am trying to use the Genie web framework and I get the following error when I try to use it on my Arch Linux: julia\> using Genie \[ Info: Precompiling Genie \[c43c736e-a2d1-11e8-161f-af95117fbd1e\] ERROR: LoadError: Init…

---

## [Logging for later analysis](https://discourse.julialang.org/t/logging-for-later-analysis/92315)

<div class="topic-metadata">

**Author:** [@Gokhan\_Kof](https://discourse.julialang.org/u/Gokhan_Kof)\
**Replies:** 2\
**Last updated:** [December 30, 2022, 2:27pm UTC](https://discourse.julialang.org/t/logging-for-later-analysis/92315 "2022-12-30T14:27:05Z")

</div>

Hi, Inside Logging documentation, it says “the logging tools allow you to attach arbitrary data to each event as a set of key–value pairs. This allows you to capture local variables and other program state for later ana…

---

## [Det() returns negative values for a correlation matrix](https://discourse.julialang.org/t/det-returns-negative-values-for-a-correlation-matrix/92316)

<div class="topic-metadata">

**Author:** [@Mind4Ness](https://discourse.julialang.org/u/Mind4Ness)\
**Replies:** 3\
**Last updated:** [December 30, 2022, 2:00pm UTC](https://discourse.julialang.org/t/det-returns-negative-values-for-a-correlation-matrix/92316 "2022-12-30T14:00:20Z")

</div>

Sometimes det() function returns a negative number for a correlation matrix (even it’s just 3x3). I’m not sure what is wrong. using Random, using Distributions Random.seed!(3) x = cor(rand(Uniform(-1,1),10,3)) 3×3 Ma…

---

## [Regression with variables in array](https://discourse.julialang.org/t/regression-with-variables-in-array/92280)

<div class="topic-metadata">

**Author:** [@Agnes\_H](https://discourse.julialang.org/u/Agnes_H)\
**Replies:** 2\
**Last updated:** [December 30, 2022, 10:51am UTC](https://discourse.julialang.org/t/regression-with-variables-in-array/92280 "2022-12-30T10:51:38Z")

</div>

I apologize for reheating this old topic, but how do I deal with this when both variables are dependent on a list? I tried using term, but was unable to. The only way I was able to receive meaningful output was by using …

---

## [Using of colorvec in computation of jacobian](https://discourse.julialang.org/t/using-of-colorvec-in-computation-of-jacobian/92240)

<div class="topic-metadata">

**Author:** [@gstein3m](https://discourse.julialang.org/u/gstein3m)\
**Replies:** 2\
**Last updated:** [December 30, 2022, 10:46am UTC](https://discourse.julialang.org/t/using-of-colorvec-in-computation-of-jacobian/92240 "2022-12-30T10:46:07Z")

</div>

I got three different matrices J: FiniteDiff\_color: \[0.0 0.0; -9.486373847239932e-9 0.0\] ForwardDiff\_color: \[1.0 0.0; 6.123233995736766e-17 0.0\] FiniteDiff: \[0.0 1.0; -9.486373847239932e-9 0.0\] The last one is correc…

---

## [JuMP slowed down in multithreading](https://discourse.julialang.org/t/jump-slowed-down-in-multithreading/92206)

<div class="topic-metadata">

**Author:** [@VPBML](https://discourse.julialang.org/u/VPBML)\
**Replies:** 2\
**Last updated:** [December 30, 2022, 10:25am UTC](https://discourse.julialang.org/t/jump-slowed-down-in-multithreading/92206 "2022-12-30T10:25:34Z")

</div>

Hi, I have a question with JuMP multithreading performance that I would like to ask for your help. I wanted to solve a specific optimization problem 4 times, and I did it in 2 ways: Solve it repeatedly 4 times on a si…

---

## ["Importing" all "exported" functionality](https://discourse.julialang.org/t/importing-all-exported-functionality/92303)

<div class="topic-metadata">

**Author:** [@tictaccat](https://discourse.julialang.org/u/tictaccat)\
**Replies:** 2\
**Last updated:** [December 30, 2022, 10:23am UTC](https://discourse.julialang.org/t/importing-all-exported-functionality/92303 "2022-12-30T10:23:48Z")

</div>

I would like to import a package without: having the package’s symbols enter the global namespace using any unexporrted functionality of the package In other words, I would like to import package A and then use its fu…

---

## [How to delete! in GLMakie](https://discourse.julialang.org/t/how-to-delete-in-glmakie/92259)

<div class="topic-metadata">

**Author:** [@dyatunin](https://discourse.julialang.org/u/dyatunin)\
**Replies:** 7\
**Last updated:** [December 30, 2022, 10:00am UTC](https://discourse.julialang.org/t/how-to-delete-in-glmakie/92259 "2022-12-30T10:00:14Z")

</div>

I am attempting to create an GUI with GLMakie, where elements can be added and removed interactively. I specifically want to remove groups of several Blocks at a time, but I can’t seem to be able to remove even a single …

---

## [How to Plot Vertical Slicing in 3D like a Slice of Cheese?](https://discourse.julialang.org/t/how-to-plot-vertical-slicing-in-3d-like-a-slice-of-cheese/92275)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 1\
**Last updated:** [December 30, 2022, 10:00am UTC](https://discourse.julialang.org/t/how-to-plot-vertical-slicing-in-3d-like-a-slice-of-cheese/92275 "2022-12-30T10:00:00Z")

</div>

Hi all, I have created the left figure of this: using Plots, LaTeXStrings, Plots.PlotMeasures gr() f(x) = 1 - (x^2)/4 plot(f,0,3, xtick=0:2:2, xlims=(0,3), ylims=(0,1.5), framestyle=:zerolines, bottom\_margin=5mm,…

---

## [Trying to Solve a 2nd Order ODE and need advice](https://discourse.julialang.org/t/trying-to-solve-a-2nd-order-ode-and-need-advice/92273)

<div class="topic-metadata">

**Author:** [@youmans](https://discourse.julialang.org/u/youmans)\
**Replies:** 5\
**Last updated:** [December 30, 2022, 8:38am UTC](https://discourse.julialang.org/t/trying-to-solve-a-2nd-order-ode-and-need-advice/92273 "2022-12-30T08:38:28Z")

</div>

Dear Community I’m new to Julia and recently trying to implement the algorithms from Direct Runge-Kutta Discretization Achieves Acceleration in which I need to solve an 2nd order ODE \\ddot x(t) + \\frac{2p+1}{t}\\dot x…

---

## [Turing.jl - How to extract AR,MA coefficients from ARiMA models](https://discourse.julialang.org/t/turing-jl-how-to-extract-ar-ma-coefficients-from-arima-models/92305)

<div class="topic-metadata">

**Author:** [@flare9x](https://discourse.julialang.org/u/flare9x)\
**Replies:** 0\
**Last updated:** [December 30, 2022, 7:37am UTC](https://discourse.julialang.org/t/turing-jl-how-to-extract-ar-ma-coefficients-from-arima-models/92305 "2022-12-30T07:37:55Z")

</div>

Using Turing.jl for an ARIMA 1,1,0 model. Is there a way to extract the AR,MA (if i used 1,1,1) coefficients from the fitted model? @model ARIMA110(x) = begin T = length(x) μ ~ Uniform(-10, 10) ϕ ~ Uniform(…

---

## [No method matching problem in optimization in nested function definition](https://discourse.julialang.org/t/no-method-matching-problem-in-optimization-in-nested-function-definition/92298)

<div class="topic-metadata">

**Author:** [@csmarra](https://discourse.julialang.org/u/csmarra)\
**Replies:** 2\
**Last updated:** [December 30, 2022, 3:58am UTC](https://discourse.julialang.org/t/no-method-matching-problem-in-optimization-in-nested-function-definition/92298 "2022-12-30T03:58:39Z")

</div>

Hello everybody, I am new to Julia and I am struggling to understand the behaviour of the following code, in which I perform the minimization of a function using the package BlackBoxOptim. function includeProof(z::Real…

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

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