Questions tagged [symfit]

41 questions
5
votes
1 answer

Global distribution fitting sharing some parameters without any specification of the bin size in python

I have several data sets that fit separately very well to a vonMises distribution. I am looking for a way of fitting all of them sharing mu but with different kappas without to care about the election of the bins. When one wants to fit with only one…
alpelito7
  • 435
  • 2
  • 10
4
votes
2 answers

How to resolve the conda issue: PackagesNotFoundError: The following packages are not available from current channels

I am try ing to install symfit on a MacBook Pro M1 using miniforge, for processor compatibility as pip3 install symfit results into errors. However, when running conda install -c conda-forge symfit, I get: Collecting package metadata…
bessie
  • 53
  • 1
  • 6
4
votes
3 answers

How to extend the number of Symfit parameters arbitrarily in Python

I have the following optimization code that is a parameterized by a variable n. from symfit import parameters, Eq, Ge, Fit import numpy as np n = 3 xdata = np.sort(np.random.choice(range(1, 4*n), n)) # Make fake data print(xdata) p1, p2, p3 =…
Simd
  • 19,447
  • 42
  • 136
  • 271
3
votes
1 answer

Preventing symfit models from sharing parameter objects

Multiple symfit model instances share parameter objects with the same name. I'd like to understand where this behaviour comes from, what it's intent is and if it's possible to deactivate. To illustrate what I mean, a minimial example: import symfit…
darudiith
  • 110
  • 9
3
votes
1 answer

RuntimeWarning: divide by zero encountered in true_divide W = 1/sigma**2/s_sq symfit

I've tried running this code, but I keep getting the same errors, no matter how much I simplify it. /home/runner/.site-packages/symfit/core/fit.py:1046: RuntimeWarning: divide by zero encountered in true_divide W =…
3
votes
1 answer

AttributeError when evaluating symfit model with substraction in exponent

I've set up a model to fit some data with a substraction in the exponent. It works fine for fits, but when I explicitly evaluate the model I get strange results and an AttributeError: 'Mul' object has no attribute 'exp'. The problem seems to stem…
darudiith
  • 110
  • 9
2
votes
1 answer

Error while installing symfit library in Python

I get an error while installing symfit library. I use pip3 in cmd to install the library. here's the error in cmd: Collecting symfit Using cached symfit-0.5.2.tar.gz (943 kB) Requirement already satisfied: numpy>=1.12 in…
Amirhosein Arabhaji
  • 472
  • 1
  • 6
  • 14
2
votes
1 answer

How can I extract x and y pairs from pandas dataframe to then use in symfit?

I am using pandas to read in .csv files. I then take the x and y pairs from the dataframe and use symfit to perform a global fit on the data. I am new to pandas dataframes and to symfit. My current proof-of-concept code works for two data sets, but…
MML
  • 31
  • 4
1
vote
0 answers

Symbolic model for Exponential Integral, expi(x)

I am trying to do a global fit with shared parameters using objective functions that contain exponential integrals. If I were using, curve_fit, I would simply include the line: from scipy.special import expi I haven't been able to get the…
1
vote
0 answers

Strange ConnectivityMapping in Symfit CallableNumericalModel.with_dependencies

When creating a Model of type CallableNumericalModel with dependencies in Symfit the Fit method asks for data even for interdependent variables. Put differently, even if I create a model with dependencies such that no independent variables are left…
TAH
  • 11
  • 3
1
vote
1 answer

fitting data to fourier3 series always produce a straight line

I have data where I want to fit the Fourier3 series, I looked to this answer: here and tried different algorithms from different packages (like symfit, and scipy). But when I plot the data, different packages give me get this result: enter image…
1
vote
0 answers

curve fitting different in Python than Matlab

I have a code in Matlab that I want to convert to python. In the Matlab code, I'm using the curve fitting toolbox to fit some data to the Fourier series of order 3. Here is how I did it in Matlab: ft= fittype('fourier3'); …
abdullatif
  • 90
  • 2
  • 8
1
vote
1 answer

How to perform a cross-Validation on Piecewise Model using Symfit or curve_fit?

I am trying to perform a cross-Validation on Piecewise Model using Symfit : My Data : x_data = np.array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], dtype=float) y_data = np.array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 10, 10, 10, 10]) to use…
1
vote
1 answer

Scipy distributions on symfit?

I think the title is self explaining. I really want to use several pdfs already implemented on scipy.stats as models for a symfit model, e.g., CrystalBall or Johnson functions. I have tried with a gaussian distribution with the following code: x =…
Horace
  • 62
  • 4
1
vote
0 answers

Why is symfit giving me terrible results when I try to fit fourier series to my data?

I am trying to find a fourier series that fits this plot: First I used this website and I found the following fourier coefficients a = [0.983, 0.292, 0.110, 0.006, -0.022, -0.018, 0.006] b = [0.000, 0.246, 0.002, -0.021, 0.017, 0.046, 0.019] omega…
1
2 3