# \#curve-fitting

**URL:** https://discourse.julialang.org/tag/curve-fitting/314.md?match_all_tags=true&page=1&tags%5B%5D=curve-fitting

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

**Page:** 2

---

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

---

## [Forcing data points containing one sinusoidal signal to be symetric around zero and multithreading](https://discourse.julialang.org/t/forcing-data-points-containing-one-sinusoidal-signal-to-be-symetric-around-zero-and-multithreading/87139)

<div class="topic-metadata">

**Author:** [@ellocco](https://discourse.julialang.org/u/ellocco)\
**Replies:** 4\
**Last updated:** [September 12, 2022, 3:27pm UTC](https://discourse.julialang.org/t/forcing-data-points-containing-one-sinusoidal-signal-to-be-symetric-around-zero-and-multithreading/87139 "2022-09-12T15:27:49Z")

</div>

Starting point are real world measurements containing one unique sinusoidal signal. For signal processing purposes it might be beneficial to reduce the offset around zero before evaluating the signal either with fft() o…

---

## [Fitting Sinusoidal Signal with LsqFit](https://discourse.julialang.org/t/fitting-sinusoidal-signal-with-lsqfit/84777)

<div class="topic-metadata">

**Author:** [@WC1991](https://discourse.julialang.org/u/WC1991)\
**Replies:** 5\
**Last updated:** [August 16, 2022, 3:24pm UTC](https://discourse.julialang.org/t/fitting-sinusoidal-signal-with-lsqfit/84777 "2022-08-16T15:24:45Z")

</div>

Hi everyone, I have problems with fitting a sinusoidal signal with 4 parameters. Everything works just fine, if the Signal Frequency is under 800Hz. Above that Frequency the fitting is very bad (except for 802Hz and 804H…

---

## [Curve Fitting With Error In Variables](https://discourse.julialang.org/t/curve-fitting-with-error-in-variables/82614)

<div class="topic-metadata">

**Author:** [@vini-fda](https://discourse.julialang.org/u/vini-fda)\
**Replies:** 5\
**Last updated:** [September 4, 2022, 4:27am UTC](https://discourse.julialang.org/t/curve-fitting-with-error-in-variables/82614 "2022-09-04T04:27:19Z")

</div>

I’m looking for a way to do curve fitting where the data has error both on x and y. I’ve read up on physics forums about errors-in-variables fitting, but I’d like to know if there are already any functionalities that ju…

---

## [Linear Fit](https://discourse.julialang.org/t/linear-fit/84847)

<div class="topic-metadata">

**Author:** [@Yangheng\_Jizhe](https://discourse.julialang.org/u/Yangheng_Jizhe)\
**Replies:** 8\
**Last updated:** [August 3, 2022, 9:12am UTC](https://discourse.julialang.org/t/linear-fit/84847 "2022-08-03T09:12:42Z")

</div>

Hi! I’m a newbie to Julia and I’ve been trying to fit some scatter points ( coordinates in arrays ) to a line that goes through the origin. Anyone has any recommended functions and packages? I tried LinearLeastSquares p…

---

## [Nonlinear curve fitting in Julia](https://discourse.julialang.org/t/nonlinear-curve-fitting-in-julia/84999)

<div class="topic-metadata">

**Author:** [@Jian\_ZUO](https://discourse.julialang.org/u/Jian_ZUO)\
**Replies:** 4\
**Last updated:** [July 29, 2022, 9:20pm UTC](https://discourse.julialang.org/t/nonlinear-curve-fitting-in-julia/84999 "2022-07-29T21:20:33Z")

</div>

Hi all, My question is to do a nonlinear curve fitting task (bounded) for estimating 10 parameters from several give data points, presented as follows: using Optim # my data points I = \[100.254, 94.261, 88.224, 82.193,…

---

## [Scipy.optimize.curve\_fit(): "ValueError("\`x0\` is infeasible.")"](https://discourse.julialang.org/t/scipy-optimize-curve-fit-valueerror-x0-is-infeasible/84958)

<div class="topic-metadata">

**Author:** [@ellocco](https://discourse.julialang.org/u/ellocco)\
**Replies:** 0\
**Last updated:** [July 29, 2022, 6:19am UTC](https://discourse.julialang.org/t/scipy-optimize-curve-fit-valueerror-x0-is-infeasible/84958 "2022-07-29T06:19:52Z")

</div>

Yesterday I struggled with the error message: "ValueError("x0 is infeasible.")" of the function scipy.optimize.curve\_fit(), this is my contribution for others that start to work with this well tested method. If you wor…

---

## [Fitting parameters of the model against data](https://discourse.julialang.org/t/fitting-parameters-of-the-model-against-data/84530)

<div class="topic-metadata">

**Author:** [@Curio\_math](https://discourse.julialang.org/u/Curio_math)\
**Replies:** 3\
**Last updated:** [July 22, 2022, 2:30pm UTC](https://discourse.julialang.org/t/fitting-parameters-of-the-model-against-data/84530 "2022-07-22T14:30:04Z")

</div>

Hi, I have to fit parameters of my model against the data I have. My model equation is of the form, z = ax / (by - c) where a, b, c are the parameters and x, y, z forms variables. Is that possible to fit the optimal …

---

## [LsqFit x axis samples vs data](https://discourse.julialang.org/t/lsqfit-x-axis-samples-vs-data/80141)

<div class="topic-metadata">

**Author:** [@youcann](https://discourse.julialang.org/u/youcann)\
**Replies:** 0\
**Last updated:** [April 27, 2022, 2:23pm UTC](https://discourse.julialang.org/t/lsqfit-x-axis-samples-vs-data/80141 "2022-04-27T14:23:31Z")

</div>

Hey, i’ve tried to fit a Gaussian pulse to some experimental data. When i use x=range(), the result looks resonable, with x equals the actual data, the fit does not work. Any help is appreciated. (Can i include Pluto…

---

## [How to plot a best fit curve in Julia when the data is a time series?](https://discourse.julialang.org/t/how-to-plot-a-best-fit-curve-in-julia-when-the-data-is-a-time-series/79317)

<div class="topic-metadata">

**Author:** [@wu-lee](https://discourse.julialang.org/u/wu-lee)\
**Replies:** 2\
**Last updated:** [April 15, 2022, 4:57pm UTC](https://discourse.julialang.org/t/how-to-plot-a-best-fit-curve-in-julia-when-the-data-is-a-time-series/79317 "2022-04-15T16:57:54Z")

</div>

This is a copy of my question here on Stack Overflow (unanswered at the time of writing). I’m trying to plot some measurements over time with a best-fit curve, using Julia’s plotting tools. There’s already a fairly good…

---

## [Nonlinear curve fitting with weights with LsqFit](https://discourse.julialang.org/t/nonlinear-curve-fitting-with-weights-with-lsqfit/78478)

<div class="topic-metadata">

**Author:** [@achjaj](https://discourse.julialang.org/u/achjaj)\
**Replies:** 10\
**Last updated:** [March 26, 2022, 12:22pm UTC](https://discourse.julialang.org/t/nonlinear-curve-fitting-with-weights-with-lsqfit/78478 "2022-03-26T12:22:52Z")

</div>

Hello, I need to fit the exponential decay law to some data with weights. I tried to use LsqFit.jl, however the standard\_errors function returns too low values. I discovered it by comparing my results with my friend and…

---

## [Plot fitted curves](https://discourse.julialang.org/t/plot-fitted-curves/78181)

<div class="topic-metadata">

**Author:** [@Mahmoud](https://discourse.julialang.org/u/Mahmoud)\
**Replies:** 6\
**Last updated:** [March 21, 2022, 7:20pm UTC](https://discourse.julialang.org/t/plot-fitted-curves/78181 "2022-03-21T19:20:38Z")

</div>

Is there anyway in Julia to fit these data represented in the attached figure? I want to make them smooth curves (may be exponential fit). p1=plot!(dayss,numberofhealthyy,legend=false,color = :blue) p2=plot!(dayss,nu…

---

## [Problems fitting a model using \`LsqFit.jl\`](https://discourse.julialang.org/t/problems-fitting-a-model-using-lsqfit-jl/77003)

<div class="topic-metadata">

**Author:** [@bhaveshshrimali](https://discourse.julialang.org/u/bhaveshshrimali)\
**Replies:** 2\
**Last updated:** [February 24, 2022, 6:35pm UTC](https://discourse.julialang.org/t/problems-fitting-a-model-using-lsqfit-jl/77003 "2022-02-24T18:35:39Z")

</div>

Hi everyone, It’s a long shot as the problem is quite niche, but I would still appreciate any help/comments from the community. Problem Description To put it briefly, I am interested in fitting a nonlinear model S(\\la…

---

## [\[ANN\] LinearFitXYerrors.jl : least squares ﬁtting of straight lines with correlated errors](https://discourse.julialang.org/t/ann-linearfitxyerrors-jl-least-squares-tting-of-straight-lines-with-correlated-errors/68112)

<div class="topic-metadata">

**Author:** [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Replies:** 0\
**Last updated:** [September 13, 2021, 6:34pm UTC](https://discourse.julialang.org/t/ann-linearfitxyerrors-jl-least-squares-tting-of-straight-lines-with-correlated-errors/68112 "2021-09-13T18:34:55Z")

</div>

LinearFitXYerrors.jl is a small Julia package, based on York et al. (2004) with a few additions, to perform 1D linear fitting of experimental data with errors in both X and Y variables. The README.md file provides detai…

---

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

---

## [Least squares fitting that accounts for covariance matrix of all input parameters](https://discourse.julialang.org/t/least-squares-fitting-that-accounts-for-covariance-matrix-of-all-input-parameters/64775)

<div class="topic-metadata">

**Author:** [@nluetts](https://discourse.julialang.org/u/nluetts)\
**Replies:** 22\
**Last updated:** [August 4, 2021, 10:24am UTC](https://discourse.julialang.org/t/least-squares-fitting-that-accounts-for-covariance-matrix-of-all-input-parameters/64775 "2021-08-04T10:24:39Z")

</div>

Hi, I am thinking about writing a package that implements a generalized least squares fitting method or perhaps seek to contribute somewhere where it might fit. Before I write more than my prototype, I wanted to double …

---

## [How to do weighted least squares fit with LsqFit.jl](https://discourse.julialang.org/t/how-to-do-weighted-least-squares-fit-with-lsqfit-jl/61136)

<div class="topic-metadata">

**Author:** [@TheLateKronos](https://discourse.julialang.org/u/TheLateKronos)\
**Replies:** 2\
**Last updated:** [May 14, 2021, 10:54am UTC](https://discourse.julialang.org/t/how-to-do-weighted-least-squares-fit-with-lsqfit-jl/61136 "2021-05-14T10:54:15Z")

</div>

I want to preform a weigted least squares fit with LsqFit.jl The documentation ( Tutorial · LsqFit.jl (julianlsolvers.github.io)) does have a section on it, but no example of curve\_fit() actually being called with a wei…

---

## [Smoothing Splines with Optimized Unequal Knot Spacing](https://discourse.julialang.org/t/smoothing-splines-with-optimized-unequal-knot-spacing/46418)

<div class="topic-metadata">

**Author:** [@Nathan\_Boyer](https://discourse.julialang.org/u/Nathan_Boyer)\
**Replies:** 1\
**Last updated:** [September 12, 2020, 7:45am UTC](https://discourse.julialang.org/t/smoothing-splines-with-optimized-unequal-knot-spacing/46418 "2020-09-12T07:45:19Z")

</div>

I have some (x,y) data with equally-spaced x’s. I would like to smooth the data using (up to) 4 cubic splines and obtain the equations for each spline. I would like the knots connecting the splines to move to an optimal …

---

## [Choose a tool for curve fitting out of all available](https://discourse.julialang.org/t/choose-a-tool-for-curve-fitting-out-of-all-available/44202)

<div class="topic-metadata">

**Author:** [@nandoconde](https://discourse.julialang.org/u/nandoconde)\
**Replies:** 2\
**Last updated:** [August 4, 2020, 7:51am UTC](https://discourse.julialang.org/t/choose-a-tool-for-curve-fitting-out-of-all-available/44202 "2020-08-04T07:51:59Z")

</div>

Hello! I’m relatively new to Julia. This year I saw the JuliaCon and I’m trying to use it for my Master Thesis. I need to fit data from a simulation to a Foster series but I can’t really choose the best tool available i…

---

## [Julia vs GNU Octave for plot fitting / finding peaks](https://discourse.julialang.org/t/julia-vs-gnu-octave-for-plot-fitting-finding-peaks/42237)

<div class="topic-metadata">

**Author:** [@doronbehar](https://discourse.julialang.org/u/doronbehar)\
**Replies:** 16\
**Last updated:** [July 1, 2020, 7:33am UTC](https://discourse.julialang.org/t/julia-vs-gnu-octave-for-plot-fitting-finding-peaks/42237 "2020-07-01T07:33:34Z")

</div>

I’m currently using GNU octave to fit a simple cosine with a phase to many data sets stored in text files. For most data sets, the fit works well, but for some others, it doesn’t. I’m wondering whether I’d be able to get…

---

## [Fitting ODE system to one single data](https://discourse.julialang.org/t/fitting-ode-system-to-one-single-data/40737)

<div class="topic-metadata">

**Author:** [@thomas\_vilches](https://discourse.julialang.org/u/thomas_vilches)\
**Replies:** 9\
**Last updated:** [June 23, 2020, 2:42pm UTC](https://discourse.julialang.org/t/fitting-ode-system-to-one-single-data/40737 "2020-06-23T14:42:03Z")

</div>

Hi everyone, I have an ODE system with 5 equations and I want to fit it to a data. However, the data is related to only one of the equations. I am trying to use the functions in Parameters Estimation of Differential eq…

---

## [Estimating parameters of a function for curve fitting](https://discourse.julialang.org/t/estimating-parameters-of-a-function-for-curve-fitting/32404)

<div class="topic-metadata">

**Author:** [@affans](https://discourse.julialang.org/u/affans)\
**Replies:** 11\
**Last updated:** [April 9, 2020, 8:37am UTC](https://discourse.julialang.org/t/estimating-parameters-of-a-function-for-curve-fitting/32404 "2020-04-09T08:37:36Z")

</div>

I have some data that has missing values. I am trying to fit a curve on this data, using Richard’s Model which is \\begin{aligned} I(t)=& \\frac{K}{\\left\[1+e^{-r a(t-\\tau)}\\right\] \\frac{1}{a}} \\end{aligned} where K is …

---

## [Fitting data with x and y errors](https://discourse.julialang.org/t/fitting-data-with-x-and-y-errors/23627)

<div class="topic-metadata">

**Author:** [@feanor12](https://discourse.julialang.org/u/feanor12)\
**Replies:** 1\
**Last updated:** [April 29, 2019, 10:42am UTC](https://discourse.julialang.org/t/fitting-data-with-x-and-y-errors/23627 "2019-04-29T10:42:15Z")

</div>

Is there a package for total least square regression, or a method which can be used to fit a function to data with errors in x and y?

[Previous page](https://discourse.julialang.org/tag/curve-fitting/314.md?match_all_tags=true&tags%5B%5D=curve-fitting)
