天道酬勤,学无止境

gamma-distribution

尝试使用 R fitdistr{MASS} 拟合伽马分布时出错(Errors while trying to fit gamma distribution with R fitdistr{MASS})

问题 我在 R 中使用 fitdistr{MASS} 函数有问题。我有这个向量: a <- c(26,73,84,115,123,132,159,207,240,241,254,268,272,282,300,302,329,346,359,367,375,378, 384,452,475,495,503,531,543,563,594,609,671,687,691,716,757,821,829,885,893,968,1053,1081,1083,1150,1205,1262,1270,1351,1385,1498,1546,1565,1635,1671,1706,1820,1829,1855,1873,1914,2030,2066,2240,2413,2421,2521,2586,2727,2797,2850,2989,3110,3166,3383,3443,3512,3515,3531,4068,4527,5006,5065,5481,6046,7003,7245,7477,8738,9197,16370,17605,25318,58524) 我想使用命令将伽马分布拟合到数据中: fitted.gamma <- fitdistr(a, "gamma") 但我有这样的错误: Error in optim(x = c(26, 73, 84, 115, 123, 132

2021-06-10 02:24:28    分类:技术分享    r   gamma-distribution

Fit gamma mixture to fertility schedule in R

I am trying to fit a gamma mixture model (two gamma distributions) to an age-fertility profile. I have a dataset containing age specific fertility rates and age, and I want to fit two gammas in order to find the corresponding parameters (in the end I will use fertility profiles from different years and try to see how the parameters evolve over time). I have so far tried to use mixtools library (gammamixEM) but without success. I would be very grateful for some help. Ale a<- structure(list(EDAD = structure(1:45, .Label = c("11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22",

2021-06-03 15:47:26    分类:问答    r   gamma-distribution

Errors while trying to fit gamma distribution with R fitdistr{MASS}

I have a problem with fitdistr{MASS} function in R. I have this vector: a <- c(26,73,84,115,123,132,159,207,240,241,254,268,272,282,300,302,329,346,359,367,375,378, 384,452,475,495,503,531,543,563,594,609,671,687,691,716,757,821,829,885,893,968,1053,1081,1083,1150,1205,1262,1270,1351,1385,1498,1546,1565,1635,1671,1706,1820,1829,1855,1873,1914,2030,2066,2240,2413,2421,2521,2586,2727,2797,2850,2989,3110,3166,3383,3443,3512,3515,3531,4068,4527,5006,5065,5481,6046,7003,7245,7477,8738,9197,16370,17605,25318,58524) and I want to fit a gamma distribution to the data with a command: fitted.gamma <-

2021-05-25 01:05:12    分类:问答    r   gamma-distribution

Color spaces, gamma and image enhancement

Color space. Well, everybody knows about RGB: three values normalized in the range [0.0,1.0], which have the meaning of the intensity of the color components Red Green Blue; this intensity is meant as linear, isn't? Gamma. As far I can understand, gamma is a function which maps RGB color components to another value. Googling on this, I've seen linear functions and non linear functions... Linear functions seems to scale RGB components, so it seems to tune image brightness; non linear functions seems to "decompress" darker/lighter components. Now, I'm starting to implement an image viewer, which

2021-05-15 20:37:35    分类:问答    opengl   rgb   gamma   srgb   gamma-distribution

用(python)Scipy拟合伽马分布(Fitting a gamma distribution with (python) Scipy)

问题 谁能帮助我在python中拟合伽玛分布? 好吧,我有一些数据:X和Y坐标,我想找到适合此分布的伽玛参数...在Scipy文档中,事实是实际上存在一个fit方法,但我不知道如何要使用它:..首先,参数“数据”必须采用哪种格式,由于我要查找的是第二个参数(参数),我该如何提供呢? 回答1 生成一些伽玛数据: import scipy.stats as stats alpha = 5 loc = 100.5 beta = 22 data = stats.gamma.rvs(alpha, loc=loc, scale=beta, size=10000) print(data) # [ 202.36035683 297.23906376 249.53831795 ..., 271.85204096 180.75026301 # 364.60240242] 在这里,我们将数据拟合为伽马分布: fit_alpha, fit_loc, fit_beta=stats.gamma.fit(data) print(fit_alpha, fit_loc, fit_beta) # (5.0833692504230008, 100.08697963283467, 21.739518937816108) print(alpha, loc, beta) # (5, 100.5, 22) 回答2 我不满意ss

2021-05-07 21:35:08    分类:技术分享    python   scipy   distribution   gamma-distribution

How would you fit a gamma distribution to a data in R?

Suppose I have the variable x that was generated using the following approach: x <- rgamma(100,2,11) + rnorm(100,0,.01) #gamma distr + some gaussian noise head(x,20) [1] 0.35135058 0.12784251 0.23770365 0.13095612 0.18796901 0.18251968 [7] 0.20506117 0.25298286 0.11888596 0.07953969 0.09763770 0.28698417 [13] 0.07647302 0.17489578 0.02594517 0.14016041 0.04102864 0.13677059 [19] 0.18963015 0.23626828 How could I fit a gamma distribution to it?

2021-04-26 10:32:35    分类:问答    r   distribution   gamma-distribution

Fitting a gamma distribution with (python) Scipy

Can anyone help me out in fitting a gamma distribution in python? Well, I've got some data : X and Y coordinates, and I want to find the gamma parameters that fit this distribution... In the Scipy doc, it turns out that a fit method actually exists but I don't know how to use it :s.. First, in which format the argument "data" must be, and how can I provide the second argument (the parameters) since that's what I'm looking for?

2021-04-09 07:49:23    分类:问答    python   scipy   distribution   gamma-distribution