# \#fit

**URL:** https://discourse.julialang.org/tag/fit/299.md

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

---

## [Fitting a truncated distribution](https://discourse.julialang.org/t/fitting-a-truncated-distribution/125067)

<div class="topic-metadata">

**Author:** [@johannesnauta](https://discourse.julialang.org/u/johannesnauta)\
**Replies:** 0\
**Last updated:** [January 22, 2025, 10:33am UTC](https://discourse.julialang.org/t/fitting-a-truncated-distribution/125067 "2025-01-22T10:33:22Z")

</div>

In Distributions.jl, is there no build-in functionality to fit truncated distributions? Of course I can write a small routine to do this, but either I cannot find documentation on it, or it is perhaps not implemented? If…

---

## [How to interpolate a scalar field?](https://discourse.julialang.org/t/how-to-interpolate-a-scalar-field/124499)

<div class="topic-metadata">

**Author:** [@Valery](https://discourse.julialang.org/u/Valery)\
**Replies:** 1\
**Last updated:** [January 7, 2025, 3:18pm UTC](https://discourse.julialang.org/t/how-to-interpolate-a-scalar-field/124499 "2025-01-07T15:18:20Z")

</div>

I want to get a polynomial scalar field that interpolate z as a function of x and y. # consider an integer k, # then the goal is that a called function f(x\[k\],y\[k\]) # would approximate z\[k\]. # abscissa example with dum…

---

## [Plot the confidence interval for a model fit](https://discourse.julialang.org/t/plot-the-confidence-interval-for-a-model-fit/37767)

<div class="topic-metadata">

**Author:** [@ffevotte](https://discourse.julialang.org/u/ffevotte)\
**Replies:** 20\
**Last updated:** [September 24, 2021, 12:43pm UTC](https://discourse.julialang.org/t/plot-the-confidence-interval-for-a-model-fit/37767 "2021-09-24T12:43:53Z")

</div>

I’m no data scientist, so it’s likely that my question does not make much sense… But here goes: I recently tried to do some data analysis that involved fitting models. I’m able to fit the model, compute represent a pred…

---

## [Fitting system of ODEs to already normalized data](https://discourse.julialang.org/t/fitting-system-of-odes-to-already-normalized-data/117400)

<div class="topic-metadata">

**Author:** [@Nick1](https://discourse.julialang.org/u/Nick1)\
**Replies:** 1\
**Last updated:** [July 26, 2024, 1:34pm UTC](https://discourse.julialang.org/t/fitting-system-of-odes-to-already-normalized-data/117400 "2024-07-26T13:34:27Z")

</div>

I have a system of ODEs as a model and want to calibrate it. I have data for multiple outputs of the model but they are already normalized. Since I am unfamiliar with the related packages in Julia, what would you recomme…

---

## [Distributions fit\_mle of distribution type vs distributions with parameters](https://discourse.julialang.org/t/distributions-fit-mle-of-distribution-type-vs-distributions-with-parameters/75228)

<div class="topic-metadata">

**Author:** [@dmetivie](https://discourse.julialang.org/u/dmetivie)\
**Replies:** 6\
**Last updated:** [April 4, 2023, 8:53am UTC](https://discourse.julialang.org/t/distributions-fit-mle-of-distribution-type-vs-distributions-with-parameters/75228 "2023-04-04T08:53:24Z")

</div>

I try the following, but it does not work. using Distributions p = 0.2 x = rand(Bernoulli(0.2),50) fit\_mle(Bernoulli(p), x) MethodError: no method matching fit\_mle(::Bernoulli{Float64}, ::Vector{Bool}) I know that fi…

---

## [\[ANN\] DataFitting.jl general purpose data fitting framework](https://discourse.julialang.org/t/ann-datafitting-jl-general-purpose-data-fitting-framework/8433)

<div class="topic-metadata">

**Author:** [@gcalderone](https://discourse.julialang.org/u/gcalderone)\
**Replies:** 25\
**Last updated:** [March 8, 2023, 10:40am UTC](https://discourse.julialang.org/t/ann-datafitting-jl-general-purpose-data-fitting-framework/8433 "2023-03-08T10:40:07Z")

</div>

Dear community, I’m happy to announce that the first working (and reasonably complete) version of the DataFitting.jl package is available on Github. The main purpose of DataFitting is to provide a general purpose data …

---

## [Linear regression without the intercept term](https://discourse.julialang.org/t/linear-regression-without-the-intercept-term/18063)

<div class="topic-metadata">

**Author:** [@leejm516](https://discourse.julialang.org/u/leejm516)\
**Replies:** 7\
**Last updated:** [March 8, 2023, 9:14am UTC](https://discourse.julialang.org/t/linear-regression-without-the-intercept-term/18063 "2023-03-08T09:14:32Z")

</div>

In GLM.jl, the use of DataFrame is preferred, but the lm function does support the use of vectors and matrices. In the latter case, however, I can’t do fit without the intercept term (i.e. b0 = 0). Is there a way to do t…

---

## [Multi output Gaussian Process package?](https://discourse.julialang.org/t/multi-output-gaussian-process-package/95335)

<div class="topic-metadata">

**Author:** [@lsablon](https://discourse.julialang.org/u/lsablon)\
**Replies:** 3\
**Last updated:** [February 28, 2023, 4:00pm UTC](https://discourse.julialang.org/t/multi-output-gaussian-process-package/95335 "2023-02-28T16:00:54Z")

</div>

Hello, I am attempting to predict temperatures on a grid using a small dataset. Based on my research, I believe that Gaussian Processes would be the most effective approach. However, I am having trouble finding a packag…

---

## [How to fit a polynomial with a pre-determined degree to a set of points?](https://discourse.julialang.org/t/how-to-fit-a-polynomial-with-a-pre-determined-degree-to-a-set-of-points/91981)

<div class="topic-metadata">

**Author:** [@Hugo](https://discourse.julialang.org/u/Hugo)\
**Replies:** 7\
**Last updated:** [December 27, 2022, 7:44pm UTC](https://discourse.julialang.org/t/how-to-fit-a-polynomial-with-a-pre-determined-degree-to-a-set-of-points/91981 "2022-12-27T19:44:06Z")

</div>

Hi, all I want to approximate a function to a vector v of 99 values so I can evaluate that function over other values. This can be a simple linear interpolation of the 99 values, but I’d fit a polynomial in case other v…

---

## [Python lmfit takes weights into account, but Julia LsqFit package seems not to](https://discourse.julialang.org/t/python-lmfit-takes-weights-into-account-but-julia-lsqfit-package-seems-not-to/90679)

<div class="topic-metadata">

**Author:** [@humbleclaw](https://discourse.julialang.org/u/humbleclaw)\
**Replies:** 9\
**Last updated:** [November 23, 2022, 11:26pm UTC](https://discourse.julialang.org/t/python-lmfit-takes-weights-into-account-but-julia-lsqfit-package-seems-not-to/90679 "2022-11-23T23:26:35Z")

</div>

Hello everyone. Using Python I have been able to do non-linear fits with lmfit creating a residual function for a potential mathematical function to fit, just as follows def pow\_res(pars, E, data, sig): values = p…

---

## [How do I get lower and upper bounds for a confidence band using LsqFit.jl?](https://discourse.julialang.org/t/how-do-i-get-lower-and-upper-bounds-for-a-confidence-band-using-lsqfit-jl/88519)

<div class="topic-metadata">

**Author:** [@ultrapoci](https://discourse.julialang.org/u/ultrapoci)\
**Replies:** 8\
**Last updated:** [October 11, 2022, 5:00pm UTC](https://discourse.julialang.org/t/how-do-i-get-lower-and-upper-bounds-for-a-confidence-band-using-lsqfit-jl/88519 "2022-10-11T17:00:04Z")

</div>

I’m fitting a three parameters non-linear function using LsqFit.jl. I know I can get confidence intervals using confidence\_interval(fit), but how do I actually get lower and upper bound for the confidence band? I believe…

---

## [Quadratic (paraboloid) model fitting](https://discourse.julialang.org/t/quadratic-paraboloid-model-fitting/88007)

<div class="topic-metadata">

**Author:** [@bertulli](https://discourse.julialang.org/u/bertulli)\
**Replies:** 0\
**Last updated:** [September 29, 2022, 7:37pm UTC](https://discourse.julialang.org/t/quadratic-paraboloid-model-fitting/88007 "2022-09-29T19:37:47Z")

</div>

Hi, this is a off-branch topic from this other thread of mine about multiple linear regression. This is not the solution to the original question, but I thought it’s useful, so I’m making a recap here. Turned out, linea…

---

## [How can I tell Julia what are the parameters in a linear model?](https://discourse.julialang.org/t/how-can-i-tell-julia-what-are-the-parameters-in-a-linear-model/87692)

<div class="topic-metadata">

**Author:** [@bertulli](https://discourse.julialang.org/u/bertulli)\
**Replies:** 14\
**Last updated:** [September 26, 2022, 5:24pm UTC](https://discourse.julialang.org/t/how-can-i-tell-julia-what-are-the-parameters-in-a-linear-model/87692 "2022-09-26T17:24:11Z")

</div>

Hi all! So, I’m experimenting with the linear regression ecosystem (GLM, Plots, DataFrames, StatsPlots and CSV). I understood how to produce a simple linear regression model and a multivariate one. I know that OLS work…

---

## [MWE fitting a model with a known parameter](https://discourse.julialang.org/t/mwe-fitting-a-model-with-a-known-parameter/73308)

<div class="topic-metadata">

**Author:** [@AlexisRenchon](https://discourse.julialang.org/u/AlexisRenchon)\
**Replies:** 14\
**Last updated:** [December 19, 2021, 5:02pm UTC](https://discourse.julialang.org/t/mwe-fitting-a-model-with-a-known-parameter/73308 "2021-12-19T17:02:18Z")

</div>

Hello, I have a (soil respiration) model, with soil temperature and soil moisture as input variables, and a bunch of parameters, see the code below. I am trying to figure out how to fit the model when one (or more) para…

---

## [\[ANN\] CatmullRom.jl (centripetal splines)](https://discourse.julialang.org/t/ann-catmullrom-jl-centripetal-splines/26755)

<div class="topic-metadata">

**Author:** [@JeffreySarnoff](https://discourse.julialang.org/u/JeffreySarnoff)\
**Replies:** 0\
**Last updated:** [July 24, 2019, 8:10pm UTC](https://discourse.julialang.org/t/ann-catmullrom-jl-centripetal-splines/26755 "2019-07-24T20:10:15Z")

</div>

CatmullRom.jl is an easily used approach to fast, attractive curvilinear blending. Catmull-Rom splines are a mathematical workhorse of computational graphics, animation and visualization. Applied to a sequence of points,…

---

## [How to fit functions with same parameters?](https://discourse.julialang.org/t/how-to-fit-functions-with-same-parameters/68192)

<div class="topic-metadata">

**Author:** [@y-iizawa](https://discourse.julialang.org/u/y-iizawa)\
**Replies:** 2\
**Last updated:** [September 15, 2021, 7:35am UTC](https://discourse.julialang.org/t/how-to-fit-functions-with-same-parameters/68192 "2021-09-15T07:35:22Z")

</div>

Hello. I have some functions with the same parameters and want to fit these parameters with each data. Example: p is parameters set. Now I consider two parameters p\[1\] and p\[2\] as examples. example\_1(x) = p\[1\] + p\[2\]…

---

## [MLJ fit and predict](https://discourse.julialang.org/t/mlj-fit-and-predict/66720)

<div class="topic-metadata">

**Author:** [@Vishal\_Sharma1](https://discourse.julialang.org/u/Vishal_Sharma1)\
**Replies:** 1\
**Last updated:** [August 20, 2021, 6:51pm UTC](https://discourse.julialang.org/t/mlj-fit-and-predict/66720 "2021-08-20T18:51:03Z")

</div>

Through MLJ’s fit and predict methods, we get the machine trained and then use it for test sample prediction respectively. What is the best way to get the training sample prediction? If I use predict on the training sa…

---

## [Trouble when I want to fit the model](https://discourse.julialang.org/t/trouble-when-i-want-to-fit-the-model/64406)

<div class="topic-metadata">

**Author:** [@Marbunnn09](https://discourse.julialang.org/u/Marbunnn09)\
**Replies:** 0\
**Last updated:** [July 10, 2021, 9:01am UTC](https://discourse.julialang.org/t/trouble-when-i-want-to-fit-the-model/64406 "2021-07-10T09:01:21Z")

</div>

Hi Everyone Right now, I’m building the GRU model in Julia by using PyCall with Keras Package from Python. When I want to fit the model then I got the problem issue. this is my code # The GRU architecture model\_GRU = …

---

## [How do I fit an MvNormal to a matrix with Distributions.jl?](https://discourse.julialang.org/t/how-do-i-fit-an-mvnormal-to-a-matrix-with-distributions-jl/63072)

<div class="topic-metadata">

**Author:** [@Ivan](https://discourse.julialang.org/u/Ivan)\
**Replies:** 6\
**Last updated:** [June 17, 2021, 6:26pm UTC](https://discourse.julialang.org/t/how-do-i-fit-an-mvnormal-to-a-matrix-with-distributions-jl/63072 "2021-06-17T18:26:36Z")

</div>

I have a matrix of absorbance readings (one column per item) at different wavenumbers (rows). I want to enlarge my dataset with more synthetic data, and I am trying to fit an MvNormal to my matrix -as opposed to fitting …

---

## [Param fit for ODE, starting from 0 or restarting from intermediate time points give different results](https://discourse.julialang.org/t/param-fit-for-ode-starting-from-0-or-restarting-from-intermediate-time-points-give-different-results/61781)

<div class="topic-metadata">

**Author:** [@cricci](https://discourse.julialang.org/u/cricci)\
**Replies:** 4\
**Last updated:** [June 3, 2021, 10:39am UTC](https://discourse.julialang.org/t/param-fit-for-ode-starting-from-0-or-restarting-from-intermediate-time-points-give-different-results/61781 "2021-06-03T10:39:57Z")

</div>

My problem is the following. I have an ODE with some parameters to estimate, based on some data. In this example however I will generate the data from the ode itself to make some test. I take an example from LotkaVolter…

---

## [Weighted linear regression with confidence interval fitted to error bars](https://discourse.julialang.org/t/weighted-linear-regression-with-confidence-interval-fitted-to-error-bars/60743)

<div class="topic-metadata">

**Author:** [@Okarin99](https://discourse.julialang.org/u/Okarin99)\
**Replies:** 6\
**Last updated:** [May 9, 2021, 11:01am UTC](https://discourse.julialang.org/t/weighted-linear-regression-with-confidence-interval-fitted-to-error-bars/60743 "2021-05-09T11:01:23Z")

</div>

Hi, I’m pretty new to Data Science. I have some Data with measurement errors and I want to fit a linear model. using DataFrames using GLM using StatsPlots df = DataFrame(x = \[0.0, 0.0669873, 0.25, 0.5, 0.75, 0.933013…

---

## [Hello all. I've been trying to use \`LsqFit\` to fit a hyperbolic tangent function t](https://discourse.julialang.org/t/hello-all-ive-been-trying-to-use-lsqfit-to-fit-a-hyperbolic-tangent-function-t/55649)

<div class="topic-metadata">

**Author:** [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Replies:** 2\
**Last updated:** [February 20, 2021, 7:33am UTC](https://discourse.julialang.org/t/hello-all-ive-been-trying-to-use-lsqfit-to-fit-a-hyperbolic-tangent-function-t/55649 "2021-02-20T07:33:17Z")

</div>

Hello all. I’ve been trying to use LsqFit to fit a hyperbolic tangent function to some data about terminal velocity in free fall. Using SciPy’s curve\_fit function, it seems to work fine. However, in Julia, it’s nowhere n…

---

## [What shape should data be in to perform a linear fit with GLM?](https://discourse.julialang.org/t/what-shape-should-data-be-in-to-perform-a-linear-fit-with-glm/53120)

<div class="topic-metadata">

**Author:** [@alice](https://discourse.julialang.org/u/alice)\
**Replies:** 7\
**Last updated:** [January 11, 2021, 9:22am UTC](https://discourse.julialang.org/t/what-shape-should-data-be-in-to-perform-a-linear-fit-with-glm/53120 "2021-01-11T09:22:15Z")

</div>

I am trying to fit some data with a variable number of dimensions using a linear fit. I am currently trying to use GLM, but I am happy to use any other library. I’ve been running in to a lot of trouble getting the data …

---

## [Fitting Data](https://discourse.julialang.org/t/fitting-data/50938)

<div class="topic-metadata">

**Author:** [@WEEZEERAE](https://discourse.julialang.org/u/WEEZEERAE)\
**Replies:** 1\
**Last updated:** [November 29, 2020, 3:40pm UTC](https://discourse.julialang.org/t/fitting-data/50938 "2020-11-29T15:40:13Z")

</div>

Hello Community! I would like to know about which package you would recommend me to fit data sets, i.e received from a spectral analysis. Currently I am working with GnuPlot, but I guess there is a more accurate way to …

---

## [Very basic GLM help](https://discourse.julialang.org/t/very-basic-glm-help/49832)

<div class="topic-metadata">

**Author:** [@HelgavonLichtenstein](https://discourse.julialang.org/u/HelgavonLichtenstein)\
**Replies:** 6\
**Last updated:** [November 9, 2020, 5:13pm UTC](https://discourse.julialang.org/t/very-basic-glm-help/49832 "2020-11-09T17:13:25Z")

</div>

Hello, I have been trying to learn how to use GLM.jl but I really don’t understand it. My goal is to show a linear model on a plot. I know how to create the base plot, but not the linear model or how to plot that onto th…

---

## [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…

---

## [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…

---

## [Packages to determine confidence intervals](https://discourse.julialang.org/t/packages-to-determine-confidence-intervals/41233)

<div class="topic-metadata">

**Author:** [@feanor12](https://discourse.julialang.org/u/feanor12)\
**Replies:** 1\
**Last updated:** [June 12, 2020, 11:16am UTC](https://discourse.julialang.org/t/packages-to-determine-confidence-intervals/41233 "2020-06-12T11:16:34Z")

</div>

As LsqFit.jl only calculates the standard error by using the Jacobian at the best-fit position I thought I try to write a small package for determining the confidence interval by data exploration. https://github.com/fea…

---

## [GLM: "no method matching fit"](https://discourse.julialang.org/t/glm-no-method-matching-fit/28603)

<div class="topic-metadata">

**Author:** [@felluksch](https://discourse.julialang.org/u/felluksch)\
**Replies:** 9\
**Last updated:** [September 10, 2019, 2:44pm UTC](https://discourse.julialang.org/t/glm-no-method-matching-fit/28603 "2019-09-10T14:44:20Z")

</div>

Hey, maybe a dumb question but I get the following error trying to run a linear model using the GLM package via StatsKit 0.3.0 MethodError: no method matching fit(::Type{LinearModel}, ::Array{Float64,2}, ::Array{Float…

---

## [LsqFit.jl error on ODE data fitting](https://discourse.julialang.org/t/lsqfit-jl-error-on-ode-data-fitting/21587)

<div class="topic-metadata">

**Author:** [@Andre\_Mello](https://discourse.julialang.org/u/Andre_Mello)\
**Replies:** 2\
**Last updated:** [March 8, 2019, 7:06pm UTC](https://discourse.julialang.org/t/lsqfit-jl-error-on-ode-data-fitting/21587 "2019-03-08T19:06:03Z")

</div>

Hi all, my first post here so bare with me please. I’m also new to the Julia language and enjoying it very much so far. Now to the point. I’ve been trying LsqFit and wanted to implement a simple curve fitting model us…

[Next page](https://discourse.julialang.org/tag/fit/299.md?match_all_tags=true&page=1&tags%5B%5D=fit)
