Questions tagged [symfit]

41 questions
1
vote
0 answers

Global fitting with two parameters sharing

I am trying to perform global fitting with two parameters sharing. Now I got a message 'AttributeError: 'float' object has no attribute 'exp'. The code is as follows: import numpy as np import symfit as sf import matplotlib.pyplot as…
kei
  • 11
  • 2
1
vote
1 answer

using named models in symfit python module for fitting with a gaussian distribution

I am trying to write a code for fitting two data set with two different equation with some shared parameters simultaneously with symfit module. it is too complicated to show it here so I show another code with the same command and simpler. Here I…
farhad
  • 11
  • 1
1
vote
2 answers

Global Fitting with Symfit: typestructure of dataset

I want to perform a global fitting of datasets with shared variables using symfit. I have a numpy array xdata which is common for all datasets ydata_i which are also numpy arrays. Following the example in the documentation a can setup the…
Katoon
  • 65
  • 1
  • 6
1
vote
1 answer

How to resolve TiffFileError: Not a Tiff File and Byte Problem with KeyError: b'\x89P'

I am setting up a computer vision project to detect and process GFP proteins. I keep getting errors about my file not being a Tiff Image and a Byte Error. I don't quite understand what they mean and haven't found anything about it online. I have…
CosmoCrash
  • 61
  • 1
  • 7
1
vote
0 answers

BasinHopping very very slow for straightforward optimization

Consider the following simple optimization problem. from symfit import parameters, Eq, Ge, Fit, log from symfit.core.minimizers import BasinHopping n = 3 # xdata = np.sort(np.random.choice(range(1, 4*n), n)) xdata = [2, 8, 11] print(xdata) p1, p2,…
Simd
  • 19,447
  • 42
  • 136
  • 271
1
vote
1 answer

What is causing this warning in symfit?

Consider this simple optimization code: from symfit import * x1 = 1 x2 = 4 p1, p2 = parameters('p1, p2') model = p1*p2 constraints = [ Eq(x1*p1+(x2-x1)*p2, 1), Ge(p1, p2), Ge(p2, 0) ] fit = Fit(- model,…
Simd
  • 19,447
  • 42
  • 136
  • 271
1
vote
0 answers

Fitting two different data sets by two model functions using symfit

I am trying to fit two data sets by two model functions. I tried to do so using symfit. Here the code: from symfit import variables, parameters, Fit, cos, sin, pi, sqrt, asin import numpy as np n0 = 1.5 data = np.genfromtxt('some data') data = 1000…
Rose
  • 21
  • 1
  • 4
1
vote
2 answers

ODE Fitting with Symfit for Python: How to get estimations for intial values?

I would like to know how to extract the intial values for the state variables. Basically, the intial values are also considered as parameters. I'm providing the initial values because they are needed for integration. However, these values are…
kossikater
  • 41
  • 5
1
vote
1 answer

Setting a negative fixed parameter in the symfit python package

I need to fit two out of the three values in a parameter, say I have a,b, and c and I know a but I just want to fit b and c. The issue becomes if I try to fix a to a negative value I the following error ValueError: SLSQP Error: lb > ub in bounds…
Austin Downey
  • 943
  • 2
  • 11
  • 28
1
vote
1 answer

Global fitting example with symfit

I am trying to perform global fitting with symfit package, following symfit documentation. import numpy as np import symfit as sf import matplotlib.pyplot as plt %matplotlib inline # for ipynb # Generate example data t = np.arange(0.0, 600.1, 30) k…
heartfield
  • 93
  • 1
  • 7
0
votes
0 answers

Error showing when using Symfit function in python to fit curve made out of data from excel file

The code was just taken from the Symfit documentation. https://symfit.readthedocs.io/en/stable/examples/ex_fourier_series.html Now I only modified xdata and ydata to read it instead from an excel file using pandas. But the problem is not matching…
0
votes
0 answers

Can't get the correct parameter fit for a system of ODEs using Symfit and some experimental results

I want to fit the following model: To some fluorescence measurements ([YFP] over time). Basically I can measure the change of YFP over time, but not the change of x. After navigating through different solutions in overflow (and trying various of…
0
votes
1 answer

Improved Fourier Series Parameters in Python

Edit: to clarify the problem, I am specifically looking for a routine that will accurately compute phi1, phi2, phi3, etc in the Fourier decomposition of periodic data, given a series of the form m(t) = A0 + sum_{n=1}^{N} A_i * sin(2*pi*n*f +…
0
votes
1 answer

Minimizing Two Functions Simultaneously

I'm trying to optimize a model that involves two functions to be fitted to data simultaneously whilst sharing variables. I am currently having problems minimizing this model due to scipy.optimize requiring a function to be passed through but I need…
Ryan
  • 1
  • 1
0
votes
0 answers

Unsure about the cause of the DiracDelta error with my code using symfit

I have been carrying out QMSA analysis of PdSn4 and when trying to implement a multicarrier fitting I keep getting an error NameError: name 'DiracDelta' is not defined My output includes only one instance where the DiracDelta function is present…
Ryan
  • 1
  • 1