Really Basic Question

23 views
Skip to first unread message

Roger

unread,
Aug 22, 2022, 8:50:24 PM8/22/22
to powerlaw-general
I'm just trying to fit a curve to a power-law dataset. I'm used to using scipy for curve fitting and was wondering how to accomplish the same task with powerlaw.

so lets say I have a function to get power law data 

def plaw(x,a,b):
          return b*x**a

If I was using scipy I would just use 
pars,cov = curve_fit(f=plaw,xdata=x,ydata=y,p0=[0,0],bounds=(-np.inf,np.inf))

and then send the pars(a,b) into plaw and and I can plot the fitted line.

My question is how to I get these parameters using powerlaw?

Reply all
Reply to author
Forward
0 new messages