修改的Weibull错误-函数无法估计参数,错误代码为100 [英] Modified Weibull Error - the function failed to estimate the parameters, with the error code 100

查看:138
本文介绍了修改的Weibull错误-函数无法估计参数,错误代码为100的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试估算Almalki和Yuan的修改后的Weibull分布(NMW)参数,但是遇到以下错误:

I'm trying to estimate the Almalki and Yuan's modified Weibull distribution (NMW) parameters, but I'm encountering the following error:

AIC的值仅是负数.出了点问题.我知道在文献中AIC可能是负数,但我认为估算或函数中存在一些错误.该bug可能是在估算,fitdist或类似的东西中吗?有人帮我吗?

The value of the AIC is giving negative ONLY VERY NEGATIVE. Something is wrong. I know that in the literature the AIC may be negative, but I believe that some error in the estimation or the functions is happening. Can the bug be in the estimation, fitdist or something like that? Somebody help me?

文章

 https://www.sciencedirect.com/science/article/pii/S0951832012002396

累计功能

  pnmw = function(x, alpha, beta, gama,theta, lambda)
{
  1 - exp(-alpha*(x^(theta))-beta*(x^(gama))*exp(lambda*x))
}

密度函数

       dnmw = function(x, alpha, beta, gama, theta, lambda)
{
  (alpha * theta * (x^(theta - 1)) + beta*(((gama+lambda*x)*(x^(gama-1))*exp(lambda*x))*exp(-alpha*x^(theta)-beta*x^(gama)*exp(lambda*x)))) 
}

危险函数

   hnmw = function(x, alpha, beta, gama, theta, lambda)
{
  alpha * theta * x^(theta - 1) + beta * (gama  + lambda * x) * 
    x^(gama - 1) * exp(lambda * x)
}

生存功能

   snmw = function(x, alpha, beta, gama, theta, lambda)
{
  exp(-alpha*x^(theta)-beta*x^(gama)*exp(lambda*x))
}

估算

paramYuan = fitdist(data = dadosp, distr = 'nmw', start = c(0.05,5,1.25,5,0.05),lower = c(0, 0))

图像

 [https://i.stack.imgur.com/XDxwC.png][1] Image
    [https://i.stack.imgur.com/87Cid.png][1] Image Estimation
    [https://i.stack.imgur.com/FScsM.png][3] Image Functions

示例:

    dadosp = c(240.3,71.9,271.3, 186.3,241,253,287.4,138.3,206.9,176,270.4,73.3,118.9,203.1,139.7,31,269.6,140.2,205.1,133.2,107,354.6,277,27.6,186,260.9,350.4,242.6,292.5, 112.3,242.8,310.7,309.9,53.1,326.5,145.7,271.5, 117.5,264.7,243.9,182,136.7,103.8,188.3,236,419.8,338.6,357.7)

[ https://i.stack.imgur.com/U0KwD. png] [1] 图片

推荐答案

让我们对密度函数进行一些测试.

Let's do a little testing with your effort at a density function.

dnmw = function(x, alpha, beta, gama, theta, lambda)
   {
(alpha * theta * (x^(theta - 1)) + beta*(((gama+lambda*x)*(x^(gama-1))*exp(lambda*x))*
     exp(-alpha*x^(theta)-beta*x^(gama)*exp(lambda*x)))) 
    }
 curve(dnmw(x,4,.3,2.4,2,0.05))

我想我们需要得出一个结论,那就是这不是一个好的密度函数,因为它的整数显然大于1.还要查看文档:

I think we need to conclude that this is NOT a good density function since it's integral is clearly greater than 1. Also look at the documentation: http://uksacb.org/sites/default/files/webform/Research%20Paper1_A%20new%20modi%EF%AC%81ed%20Weibull%20distribution_0.pdf

因此,将代码放入R感知编辑器中,查看与最右边的括号匹配的位置:

So take the code and put it into an R-aware editor and see where the match to the rightmost paren might be:

dnmw = function(x, alpha, beta, gama, theta, lambda)
{
(alpha * theta * (x^(theta - 1)) + beta*(((gama+lambda*x)*(x^(gama-1))*exp(lambda*x))*
#^
             exp(-alpha*x^(theta)-beta*x^(gama)*exp(lambda*x)))) 
#                                                              ^
}

它与最左边的那个相匹配!但是,该左括号应该与exp(lambda*x)右边的那个相匹配,以隔离我称之为标准化项的东西.因此,在该位置放置一个正确的括号,并尝试找出其他地方缺少的括号. ....经过几次更正后,我们得到:

It matched with the one to the extreme left! But that left-paren was supposed to be matching the one just to the right of exp(lambda*x) to fence off what I would call the normalization terms. So put a right paren in that spot and try to figure out where there is a missing paren elsewhere. .... After several corrections, we get:

dnmw = function(x, alpha, beta, gama, theta, lambda)
{
  (alpha*theta*(x^(theta - 1)) +beta*( (gama+lambda*x) * x^(gama-1)*
  exp(lambda*x) ))*exp(-alpha*x^(theta)-beta*x^(gama)*exp(lambda*x))
}

现在,在检查图形测试时,事情看起来更加明智.但我也认为您需要确保其他分布函数没有类似的错误.

And now things look more sensible when examining a graphical test. But I also think you need to make sure your other distribution functions do not have similar errors.

这篇关于修改的Weibull错误-函数无法估计参数,错误代码为100的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆