Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fitting Lognormal Data
#2
Lets consider for exmaple the following piece of code:

import numpy as np 
from scipy import stats
x = 2 * np.random.randn(10000) + 7.0 # normally  distributed values
y = np.exp(x) # these values have lognormal distribution
stats.lognorm.fit(y, floc=0)
(1.9780155814544627, 0, 1070.4207866985835) #so, sigma = 1.9780155814544627 approx 2.0
np.log(1070.4207866985835) #yields 6.9758071087468636 approx 7.0
So, everything works fine: sigma and mu are estimated correctly...
What about sample sizes in your case? The example above shows that we have to
use very large samples to get high accuracy estimations.
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,098 Jan-04-2023, 07:41 AM
Last Post: Pikano
  Fitting transfer function model to FRF data ymohammadi 0 1,776 Feb-10-2022, 10:02 AM
Last Post: ymohammadi
  Error in running the Elliott Fitting function shashisourabh 9 5,503 Nov-19-2020, 06:54 PM
Last Post: osvan
  curve fitting matlotlib scipy Cjstarling 2 2,551 Sep-15-2020, 02:56 PM
Last Post: Cjstarling
  Fitting experimental data with differential equations : Optimization madoko 6 7,046 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