如何解决日志(z)中的警告:R中产生的NAN?

如何解决日志(z)中的警告:R中产生的NAN?,r,simulation,distribution,R,Simulation,Distribution,我尝试使用不同的数据和GEV分布运行,但我在日志(z)中收到50条关于警告的警告:生成的NAN 这是我的数据t1=2.1466558 2.9447386 2.1410642 1.8847492 2.0233282 2.1907725 3.1755095 2.1142972 2.1889601 2.8422979 1.8555857 1.0429501 2.1383811 3.9976282 14.0612719 6.0016379 4.0426939 3.9845386 5.1821300 3.

我尝试使用不同的数据和GEV分布运行,但我在日志(z)中收到50条关于
警告的警告:生成的NAN

这是我的数据
t1=2.1466558 2.9447386 2.1410642 1.8847492 2.0233282 2.1907725 3.1755095 2.1142972 2.1889601 2.8422979 1.8555857 1.0429501 2.1383811 3.9976282 14.0612719 6.0016379 4.0426939 3.9845386 5.1821300 3.8703266 2.9009807 3.8450287 3.1019829 4.1811628.0737452.8416872.20472.8037649  6.9629563  2.8223349 10.9695854  1.8985456  0.9444765  6.0065642  2.0394709  9.1677515  5.0589429  4.1036932  4.9599679  3.0425898  1.9477278  3.0447457  8.1563085  4.9423730  3.1336760  1.8389239  3.1262185  1.1628846  3.8445247  2.1454052  1.9209593  0.9197765  2.8171347  8.0249643 13.1267940  6.8506226  2.0811591  2.8517716  2.8864796  1.8227987  8.1442224  2.8798242  5.1112049  2.8529055  6.8265215  1.0436781  3.8380311  2.9659720  3.0153516  2.8497134  24.0545609  3.1952943  3.9564030  7.1348925  3.0067497  2.8581224  13.0294469  1.8576194  2.8081190  6.0940443  1.9729950  4.1334539  9.9874363  2.0489537  1.9479052  2.8050009  3.1097060  8.9115900  23.8376271  3.9219177  2.9991323  3.8501608  4.1910852  4.9508869  11.9260378  5.1473547  6.1864583  2.8165587  3.8589393  5.1742220  2.8812650  4.1469513  2.9816058  6.9291070  4.0086371  2.8950365  3.1368533  2.9716707  4.0936148  4.0987735  8.8792285  2.9914305  15.9832293 11.1705646  4.1691180  2.0268396  9.1313510  2.8457873  5.8162405  5.1019303  2.9493099  3.1892744  6.1027555  5.9852653  6.0070368  5.0606722  3.8827039  2.8579010  3.1809342  2.8639117  4.0446142  8.1086074  6.9708477  3.9406243  3.9113551  2.8471808  3.9408469  1.8318536  4.8696027  6.1638158 10.0075047  4.0620721  2.1995222  2.9713600  0.9827086 11.8048057  3.1639570  4.1820899  2.8913417  5.1807095  1.8735194  3.8650210  2.9308563  6.9203276  7.0470336  2.1721080  1.9304191  2.9782089  4.9717892  1.8260324  4.0094237  6.0354774  4.1934337  3.8605304  6.9868062  9.0001938  19.9510362 10.0213967  1.9980948  1.9564188 10.0595901  5.9441410  5.9212171  1.9805753  2.8141160  9.8859371  2.1912938  5.0260191  7.0394183  3.1071499  4.8651357  4.8464983  3.1653826  4.0813080  0.9293124  2.0533324  3.1302422  5.0649879  1.9045972  3.0304574  6.1638933  1.8765108  2.1042605  5.0677281  7.9328270  5.0485400  11.8101217  2.8496955  3.9641349  2.0423748  3.9535697 10.1833001  1.9963743  3.9404075  1.0794579  5.1952880  2.1310139  3.1615550  4.1934939  2.1528778  1.8080386  7.8411243  9.8299614  6.0534968  4.0174467  2.0321006  6.8884815  3.1990381  3.9448174  4.1087308  2.8989261  3.1667614  3.0734750  4.9591400  4.0537864  5.1886589  2.0860818  3.9166460  3.8028030  2.8333645  2.0257119  3.9347423  2.1057551  2.9608942  5.8546608  3.1449161  1.8630542  5.0733393  1.8331204  3.1629142  4.0929211  6.9565034  3.8253997  2.8041233  5.1246350 3.8994802 2.0389505 5.0663955 3.8854816 1.8575128 1.9655496 3.0056002 4.9812668 4.8201262

我将GEV与数据相匹配:

fit5=fevd(t1,type=“GEV”)
使用
extRemes
软件包中的功能
fevd
。我想做K-S测试模拟,但在这一部分得到50个警告:

stats <- replicate(n.sims, {
  r <- rgevd(n = length(t1),location=fit5$results$par["location"],
             shape= fit5$results$par["shape"], 
             scale = fit5$results$par["scale"])

  estfit.gev <- fevd(r, type = "GEV") # added to account for the estimated parameters

  as.numeric(ks.test(r, "pgevd",location=estfit.gev$results$par["location"],
                     shape= estfit.gev$results$par["shape"], 
                     scale = estfit.gev$results$par["scale"])$statistic)

stats如果你提供了一个可重复性最低的例子,你就有最大的机会得到一个有用的答案。也许会有帮助。你的问题不是MWE,因为你没有在这篇文章中包括你的输入数据、完整的代码和使用的包。嗨,我编辑了这篇文章@如果你提供了一个最小的可重复的例子,你就有最大的机会得到一个有用的答案。也许会有帮助。你的问题不是MWE,因为你没有在这篇文章中包括你的输入数据、完整的代码和使用的包。嗨,我编辑了这篇文章@利米