Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fitting Lognormal Data
#3
Thank you for your answer!

I think i have to ask my question more precise.

I have 2 arrays, one of x-data, one of y-data:

x-data array:
Plotting this, i geht the graph that i postet yesterday. Its clearly a lognormal function, so what i need now is a (lognormal-) function, that fits my data best, to gain the median and the sigma. I thought, that "stats.lognorm.fit" provides me this information. Unfortunately when i run the following code, i get a median of approximately 1.4, but looking at my graph, it clearly should be somewhere around 6.

from scipy import stats
 
 s, loc, scale = stats.lognorm.fit(x0, floc=0) #x0 is rawdata x-axis
 estimated_mu = np.log(scale)
 estimated_sigma = s
 
 print estimated_mu
 print estimated_sigma
 
 estimated mu = 1.4968829026551267
 estimated sigma = 0.8699922377581952
I am really sorry, for posting thiy wall of numbers, and clearly dumb beginner questions, but im quite desperate right now. Any help is appreciated!

Thx, Carol
Reply


Messages In This Thread
Fitting Lognormal Data - by Carolyn - May-19-2018, 07:49 PM
RE: Fitting Lognormal Data - by scidam - May-20-2018, 10:51 AM
RE: Fitting Lognormal Data - by Carolyn - May-20-2018, 07:25 PM
RE: Fitting Lognormal Data - by scidam - May-21-2018, 12:10 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Sine fitting - extra modulation Pikano 2 1,055 Jan-04-2023, 07:41 AM
Last Post: Pikano
  Fitting transfer function model to FRF data ymohammadi 0 1,730 Feb-10-2022, 10:02 AM
Last Post: ymohammadi
  Error in running the Elliott Fitting function shashisourabh 9 5,367 Nov-19-2020, 06:54 PM
Last Post: osvan
  curve fitting matlotlib scipy Cjstarling 2 2,510 Sep-15-2020, 02:56 PM
Last Post: Cjstarling
  Fitting experimental data with differential equations : Optimization madoko 6 6,956 Jan-17-2019, 11:30 AM
Last Post: scidam

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020