0

为什么我在运行以下代码时会得到 NaN?我正在对每个协变量的物种密度进行距离抽样分析。我的任何其他协变量都没有发生这种情况?

#umf2总结

> summary(umf2)
unmarkedFrameDS Object

line-transect survey design
Distance class cutpoints (m):  0 5 10 15 20 25 30 35 

64 sites
Maximum number of distance classes per site: 7 
Mean number of distance classes per site: 7 
Sites with at least one detection: 8 

Tabulation of y observations:
  0   1   2 
434  12   2 

Site-level covariates:
           transect     length_m        length          number     
 01_Cungha_T1  : 1   Min.   : 996   Min.   :0.996   Min.   : 1.00  
 02_Capicada_T1: 1   1st Qu.:1061   1st Qu.:1.061   1st Qu.:16.75  
 03_Caghode_T1 : 1   Median :1098   Median :1.099   Median :32.50  
 04_Caghode_T2 : 1   Mean   :1126   Mean   :1.126   Mean   :32.50  
 05_Cafal_T1   : 1   3rd Qu.:1167   3rd Qu.:1.167   3rd Qu.:48.25  
 06_Muna_T1    : 1   Max.   :1758   Max.   :1.758   Max.   :64.00  
 (Other)       :58                                                  
                                                                    
       y               x            d_forest_1    d_all_roads_1   
 Min.   :11.10   Min.   :-15.16   Min.   :    0   Min.   :   5.0  
 1st Qu.:11.19   1st Qu.:-15.08   1st Qu.:    0   1st Qu.: 180.3  
 Median :11.25   Median :-15.02   Median :   10   Median : 534.8  
 Mean   :11.27   Mean   :-15.00   Mean   : 2751   Mean   : 811.5  
 3rd Qu.:11.34   3rd Qu.:-14.94   3rd Qu.: 2893   3rd Qu.:1145.9  
 Max.   :11.42   Max.   :-14.77   Max.   :17242   Max.   :3666.7    
                                                               

#拟合先验模型集:所有道路,危险。

m.haz.2.allroads <- distsamp(~1 ~d_all_roads_1, umf2, keyfun="hazard", output="density", unitsOut="kmsq")

#预测到所有道路的距离

> m.allroads2 <-  data.frame(d_all_roads_1=seq(5.0000, 3666.6775, length=64))    
> allroads.pred2 <- predict(m.haz.2.allroads, type="state", newdata=m.allroads2, appendData=TRUE)
There were 50 or more warnings (use warnings() to see the first 50)
> allroads.pred2 

   Predicted         SE    lower    upper d_all_roads_1
1   1.979158 0.23962464 1.561069 2.509221       5.00000
2   2.041778 0.23667781 1.626820 2.562582      63.12187
3   2.106379 0.23300058 1.695819 2.616337     121.24373
4   2.173025 0.22849261 1.768321 2.670350     179.36560
5   2.241779 0.22303220 1.844623 2.724444     237.48746
...
10  2.619589 0.17424708 2.299396 2.984369     528.09679
11  2.702472 0.15742845 2.410881 3.029331     586.21865
12  2.787978 0.13611667 2.533561 3.067943     644.34052
13  2.876189 0.10742754 2.673157 3.094641     702.46238
14  2.967191 0.06136485 2.849323 3.089934     760.58425
15  3.061072        NaN      NaN      NaN     818.70611
16  3.157924        NaN      NaN      NaN     876.82798
17  3.257839        NaN      NaN      NaN     934.94984
18  3.360917        NaN      NaN      NaN     993.07171
19  3.467255        NaN      NaN      NaN    1051.19357
...
60 12.434748        NaN      NaN      NaN    3434.19004
61 12.828180        NaN      NaN      NaN    3492.31190
62 13.234061        NaN      NaN      NaN    3550.43377
63 13.652784        NaN      NaN      NaN    3608.55563
64 14.084755        NaN      NaN      NaN    3666.67750

如果需要任何进一步的信息来帮助我解决这个问题,请告诉我,非常感谢。

4

0 回答 0