【问题标题】:R dynamic brownian bridge movement model raster errorR动态布朗桥运动模型光栅误差
【发布时间】:2017-01-24 05:00:47
【问题描述】:

为了探索我的数据(某些位置的存在/不存在数据),我希望使用“move”包使用动态布朗桥运动模型 (dBBMM) 对利用率分布进行建模。我试图弄清楚它是如何工作的,所以我创建了一个简单的代码来为我的数据子集运行一个 dBBMM,以便创建一些图。似乎相同的编码规范适用于 1 个子集,但不适用于另一个。具体来说,我得到了返回的错误

Error in .local(object, raster, location.error, ext, ...) : 
  Lower x grid not large enough

这是数据的一个子集:

data.ss1<-structure(list(timestamp = structure(c(1455851760, 1455851880, 
1455852000, 1455852180, 1455857220, 1455857340, 1455915720, 1455915780, 
1455916020, 1455917760, 1455918240, 1455920100, 1455920520, 1455920700, 
1455920940, 1455921060, 1456786200, 1456786620, 1456788960, 1456789080, 
1456789200, 1456821540, 1456821660, 1456821960, 1457295480, 1457295600, 
1457296260, 1457296380, 1457296500, 1457296800, 1457319240, 1457319540, 
1457319660, 1457319780, 1457322900, 1457323020, 1457323140, 1457323320, 
1457323440, 1457325000, 1457325180, 1457325420, 1457325600, 1457325720, 
1457326560, 1457326680, 1457333340, 1457333700, 1457333820, 1457334000, 
1457334120, 1457334240, 1457334360, 1457353800, 1457353920, 1457354040, 
1457354280, 1457354400, 1457354700, 1457355780, 1457355960, 1457356080, 
1457356200, 1457356320, 1457364600, 1457364780, 1457365020, 1457365320, 
1457365500, 1457365620, 1457365740, 1457365860, 1457365980, 1457366100, 
1457366220, 1457407200, 1457407380, 1457407500, 1457407560, 1457407680, 
1457407800, 1457407920, 1457408040, 1457408160, 1457408280, 1457408340, 
1457408580, 1457408700, 1457408820, 1457408940, 1457409060, 1457409480, 
1457409600, 1457409780, 1457409900, 1457410320, 1457412540, 1457412660, 
1457412780, 1457412900), class = c("POSIXct", "POSIXt"), tzone = "US/Eastern"), 
    station = c(109655L, 109655L, 109655L, 109655L, 124083L, 
    124083L, 126404L, 126404L, 126404L, 126412L, 126412L, 126413L, 
    126413L, 126413L, 126413L, 126413L, 102307L, 102307L, 126413L, 
    126413L, 126413L, 126407L, 126407L, 126407L, 124086L, 124086L, 
    124086L, 124086L, 124086L, 124086L, 104668L, 104668L, 104668L, 
    104668L, 126408L, 126408L, 126408L, 126408L, 126408L, 126410L, 
    126410L, 126410L, 126410L, 126410L, 126410L, 126410L, 104668L, 
    104668L, 104668L, 104668L, 104668L, 104668L, 104668L, 124086L, 
    124086L, 124086L, 124086L, 124086L, 124086L, 124086L, 124086L, 
    124086L, 124086L, 124086L, 124086L, 124086L, 124086L, 124086L, 
    124086L, 124086L, 124086L, 124086L, 124086L, 124086L, 124086L, 
    124086L, 124086L, 124086L, 124086L, 124086L, 124086L, 124086L, 
    124086L, 124086L, 124086L, 124086L, 124086L, 124086L, 124086L, 
    124086L, 124086L, 124086L, 124086L, 124086L, 124086L, 124086L, 
    124086L, 124086L, 124086L, 124086L), elasmo = structure(c(5L, 
    5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 
    5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 
    5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 
    5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 
    5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 
    5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 
    5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L), .Label = c("7954", "19681", 
    "19690", "19691", "20180", "20182", "20184", "23156", "23794", 
    "23796", "27549", "27551"), class = "factor"), location = c("pier", 
    "pier", "pier", "pier", "new barge", "new barge", "bimini barge", 
    "bimini barge", "bimini barge", "west west round rock", "west west round rock", 
    "west north west turtle", "west north west turtle", "west north west turtle", 
    "west north west turtle", "west north west turtle", "south west south turtle", 
    "south west south turtle", "west north west turtle", "west north west turtle", 
    "west north west turtle", "mini wall", "mini wall", "mini wall", 
    "mini barge west", "mini barge west", "mini barge west", 
    "mini barge west", "mini barge west", "mini barge west", 
    "west round rock", "west round rock", "west round rock", 
    "west round rock", "northwest turtle rock", "northwest turtle rock", 
    "northwest turtle rock", "northwest turtle rock", "northwest turtle rock", 
    "west turtle", "west turtle", "west turtle", "west turtle", 
    "west turtle", "west turtle", "west turtle", "west round rock", 
    "west round rock", "west round rock", "west round rock", 
    "west round rock", "west round rock", "west round rock", 
    "mini barge west", "mini barge west", "mini barge west", 
    "mini barge west", "mini barge west", "mini barge west", 
    "mini barge west", "mini barge west", "mini barge west", 
    "mini barge west", "mini barge west", "mini barge west", 
    "mini barge west", "mini barge west", "mini barge west", 
    "mini barge west", "mini barge west", "mini barge west", 
    "mini barge west", "mini barge west", "mini barge west", 
    "mini barge west", "mini barge west", "mini barge west", 
    "mini barge west", "mini barge west", "mini barge west", 
    "mini barge west", "mini barge west", "mini barge west", 
    "mini barge west", "mini barge west", "mini barge west", 
    "mini barge west", "mini barge west", "mini barge west", 
    "mini barge west", "mini barge west", "mini barge west", 
    "mini barge west", "mini barge west", "mini barge west", 
    "mini barge west", "mini barge west", "mini barge west", 
    "mini barge west", "mini barge west"), Y = c(25.76453, 25.76453, 
    25.76453, 25.76453, 25.74273, 25.74273, 25.69792, 25.69792, 
    25.69792, 25.68681, 25.68681, 25.67408, 25.67408, 25.67408, 
    25.67408, 25.67408, 25.65654, 25.65654, 25.67408, 25.67408, 
    25.67408, 25.81482, 25.81482, 25.81482, 25.72441, 25.72441, 
    25.72441, 25.72441, 25.72441, 25.72441, 25.68646, 25.68646, 
    25.68646, 25.68646, 25.67416, 25.67416, 25.67416, 25.67416, 
    25.67416, 25.66495, 25.66495, 25.66495, 25.66495, 25.66495, 
    25.66495, 25.66495, 25.68646, 25.68646, 25.68646, 25.68646, 
    25.68646, 25.68646, 25.68646, 25.72441, 25.72441, 25.72441, 
    25.72441, 25.72441, 25.72441, 25.72441, 25.72441, 25.72441, 
    25.72441, 25.72441, 25.72441, 25.72441, 25.72441, 25.72441, 
    25.72441, 25.72441, 25.72441, 25.72441, 25.72441, 25.72441, 
    25.72441, 25.72441, 25.72441, 25.72441, 25.72441, 25.72441, 
    25.72441, 25.72441, 25.72441, 25.72441, 25.72441, 25.72441, 
    25.72441, 25.72441, 25.72441, 25.72441, 25.72441, 25.72441, 
    25.72441, 25.72441, 25.72441, 25.72441, 25.72441, 25.72441, 
    25.72441, 25.72441), X = c(-79.29315, -79.29315, -79.29315, 
    -79.29315, -79.30235, -79.30235, -79.31699, -79.31699, -79.31699, 
    -79.32016, -79.32016, -79.31871, -79.31871, -79.31871, -79.31871, 
    -79.31871, -79.3227, -79.3227, -79.31871, -79.31871, -79.31871, 
    -79.28847, -79.28847, -79.28847, -79.30922, -79.30922, -79.30922, 
    -79.30922, -79.30922, -79.30922, -79.31012, -79.31012, -79.31012, 
    -79.31012, -79.30888, -79.30888, -79.30888, -79.30888, -79.30888, 
    -79.31092, -79.31092, -79.31092, -79.31092, -79.31092, -79.31092, 
    -79.31092, -79.31012, -79.31012, -79.31012, -79.31012, -79.31012, 
    -79.31012, -79.31012, -79.30922, -79.30922, -79.30922, -79.30922, 
    -79.30922, -79.30922, -79.30922, -79.30922, -79.30922, -79.30922, 
    -79.30922, -79.30922, -79.30922, -79.30922, -79.30922, -79.30922, 
    -79.30922, -79.30922, -79.30922, -79.30922, -79.30922, -79.30922, 
    -79.30922, -79.30922, -79.30922, -79.30922, -79.30922, -79.30922, 
    -79.30922, -79.30922, -79.30922, -79.30922, -79.30922, -79.30922, 
    -79.30922, -79.30922, -79.30922, -79.30922, -79.30922, -79.30922, 
    -79.30922, -79.30922, -79.30922, -79.30922, -79.30922, -79.30922, 
    -79.30922)), .Names = c("timestamp", "station", "elasmo", 
"location", "Y", "X"), row.names = c(NA, 100L), class = "data.frame")

这是一秒钟:

data.ss2<-structure(list(timestamp = structure(c(1414786140, 1414786740, 
1420747380, 1420750020, 1425956580, 1425956940, 1427796900, 1427797080, 
1453615800, 1453616040, 1453616400, 1453618020, 1453618920, 1453619580, 
1453619760, 1460017140, 1460017680, 1460017860, 1460141880, 1460142060, 
1460144040, 1460145300, 1460181840, 1460183100, 1460215860, 1460216100, 
1460378040, 1460378760, 1460403840, 1460404140, 1460456100, 1460456280, 
1460456460, 1460540340, 1460541600, 1460863560, 1460864160, 1460875860, 
1460876880, 1460882040, 1460883960, 1460887200, 1460887740, 1460928540, 
1460929200, 1460948160, 1460948340, 1460953920, 1460954220, 1461037440, 
1461038100, 1461041220, 1461041400, 1461041580, 1461043320, 1461043500, 
1461046260, 1461046440, 1461059340, 1461059700, 1461059820, 1461060000, 
1461060720, 1461061440, 1461061860, 1461062100, 1461062700, 1461062880, 
1461063060, 1461063240, 1461063420, 1461064140, 1461064320, 1461064500, 
1461064800, 1461065160, 1461065340, 1461065880, 1461066780, 1461066960, 
1461072060, 1461072300, 1461072900, 1461073080, 1461119580, 1461120240, 
1461124320, 1461124500, 1461124620, 1461166500, 1461166680, 1461166920, 
1461167100, 1461216840, 1461217560, 1461218880, 1461219060, 1461219660, 
1461219840, 1461221280), class = c("POSIXct", "POSIXt"), tzone = "US/Eastern"), 
    station = c(104667L, 104667L, 124097L, 124097L, 125904L, 
    125904L, 125907L, 125907L, 126408L, 126408L, 126408L, 126410L, 
    126410L, 126411L, 126411L, 126406L, 126406L, 126406L, 125906L, 
    125906L, 125906L, 125906L, 125904L, 126406L, 125904L, 125904L, 
    106809L, 106809L, 125906L, 125906L, 126408L, 126408L, 126408L, 
    126408L, 126408L, 126408L, 126408L, 126410L, 126410L, 126408L, 
    126408L, 126411L, 126411L, 104668L, 104668L, 104668L, 104668L, 
    126411L, 126411L, 104668L, 104668L, 126410L, 126410L, 126410L, 
    126411L, 126411L, 126411L, 126411L, 126404L, 126404L, 126404L, 
    126404L, 126404L, 126404L, 126404L, 126404L, 126404L, 126404L, 
    126404L, 126404L, 126404L, 126404L, 126404L, 126404L, 126404L, 
    126404L, 126404L, 126404L, 126404L, 126404L, 126404L, 126404L, 
    126404L, 126404L, 104668L, 104668L, 126410L, 126410L, 126410L, 
    126408L, 126408L, 126408L, 126408L, 126413L, 126413L, 104668L, 
    104668L, 104668L, 104668L, 126408L), elasmo = structure(c(11L, 
    11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 
    11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 
    11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 
    11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 
    11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 
    11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 
    11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 
    11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 
    11L, 11L, 11L), .Label = c("7954", "19681", "19690", "19691", 
    "20180", "20182", "20184", "23156", "23794", "23796", "27549", 
    "27551"), class = "factor"), location = c("bimini barge", 
    "bimini barge", "northwest turtle rock", "northwest turtle rock", 
    "west turtle", "west turtle", "west west round rock", "west west round rock", 
    "northwest turtle rock", "northwest turtle rock", "northwest turtle rock", 
    "west turtle", "west turtle", "south west turtle", "south west turtle", 
    "south bimini 3", "south bimini 3", "south bimini 3", "south bimini 1", 
    "south bimini 1", "south bimini 1", "south bimini 1", "south bimini 3 south", 
    "south bimini 3", "south bimini 3 south", "south bimini 3 south", 
    "south bimini 1 south", "south bimini 1 south", "south bimini 1", 
    "south bimini 1", "northwest turtle rock", "northwest turtle rock", 
    "northwest turtle rock", "northwest turtle rock", "northwest turtle rock", 
    "northwest turtle rock", "northwest turtle rock", "west turtle", 
    "west turtle", "northwest turtle rock", "northwest turtle rock", 
    "south west turtle", "south west turtle", "west round rock", 
    "west round rock", "west round rock", "west round rock", 
    "south west turtle", "south west turtle", "west round rock", 
    "west round rock", "west turtle", "west turtle", "west turtle", 
    "south west turtle", "south west turtle", "south west turtle", 
    "south west turtle", "bimini barge", "bimini barge", "bimini barge", 
    "bimini barge", "bimini barge", "bimini barge", "bimini barge", 
    "bimini barge", "bimini barge", "bimini barge", "bimini barge", 
    "bimini barge", "bimini barge", "bimini barge", "bimini barge", 
    "bimini barge", "bimini barge", "bimini barge", "bimini barge", 
    "bimini barge", "bimini barge", "bimini barge", "bimini barge", 
    "bimini barge", "bimini barge", "bimini barge", "west round rock", 
    "west round rock", "west turtle", "west turtle", "west turtle", 
    "northwest turtle rock", "northwest turtle rock", "northwest turtle rock", 
    "northwest turtle rock", "west north west turtle", "west north west turtle", 
    "west round rock", "west round rock", "west round rock", 
    "west round rock", "northwest turtle rock"), Y = c(25.69792, 
    25.69792, 25.67416, 25.67416, 25.66495, 25.66495, 25.68681, 
    25.68681, 25.67416, 25.67416, 25.67416, 25.66495, 25.66495, 
    25.65662, 25.65662, 25.68256, 25.68256, 25.68256, 25.68266, 
    25.68266, 25.68266, 25.68266, 25.67332, 25.68256, 25.67332, 
    25.67332, 25.67316, 25.67316, 25.68266, 25.68266, 25.67416, 
    25.67416, 25.67416, 25.67416, 25.67416, 25.67416, 25.67416, 
    25.66495, 25.66495, 25.67416, 25.67416, 25.65662, 25.65662, 
    25.68646, 25.68646, 25.68646, 25.68646, 25.65662, 25.65662, 
    25.68646, 25.68646, 25.66495, 25.66495, 25.66495, 25.65662, 
    25.65662, 25.65662, 25.65662, 25.69792, 25.69792, 25.69792, 
    25.69792, 25.69792, 25.69792, 25.69792, 25.69792, 25.69792, 
    25.69792, 25.69792, 25.69792, 25.69792, 25.69792, 25.69792, 
    25.69792, 25.69792, 25.69792, 25.69792, 25.69792, 25.69792, 
    25.69792, 25.69792, 25.69792, 25.69792, 25.69792, 25.68646, 
    25.68646, 25.66495, 25.66495, 25.66495, 25.67416, 25.67416, 
    25.67416, 25.67416, 25.67408, 25.67408, 25.68646, 25.68646, 
    25.68646, 25.68646, 25.67416), X = c(-79.31699, -79.31699, 
    -79.30888, -79.30888, -79.31092, -79.31092, -79.32016, -79.32016, 
    -79.30888, -79.30888, -79.30888, -79.31092, -79.31092, -79.31325, 
    -79.31325, -79.2818, -79.2818, -79.2818, -79.30135, -79.30135, 
    -79.30135, -79.30135, -79.28196, -79.2818, -79.28196, -79.28196, 
    -79.30154, -79.30154, -79.30135, -79.30135, -79.30888, -79.30888, 
    -79.30888, -79.30888, -79.30888, -79.30888, -79.30888, -79.31092, 
    -79.31092, -79.30888, -79.30888, -79.31325, -79.31325, -79.31012, 
    -79.31012, -79.31012, -79.31012, -79.31325, -79.31325, -79.31012, 
    -79.31012, -79.31092, -79.31092, -79.31092, -79.31325, -79.31325, 
    -79.31325, -79.31325, -79.31699, -79.31699, -79.31699, -79.31699, 
    -79.31699, -79.31699, -79.31699, -79.31699, -79.31699, -79.31699, 
    -79.31699, -79.31699, -79.31699, -79.31699, -79.31699, -79.31699, 
    -79.31699, -79.31699, -79.31699, -79.31699, -79.31699, -79.31699, 
    -79.31699, -79.31699, -79.31699, -79.31699, -79.31012, -79.31012, 
    -79.31092, -79.31092, -79.31092, -79.30888, -79.30888, -79.30888, 
    -79.30888, -79.31871, -79.31871, -79.31012, -79.31012, -79.31012, 
    -79.31012, -79.30888)), .Names = c("timestamp", "station", 
"elasmo", "location", "Y", "X"), row.names = c(NA, 100L), class = "data.frame")

我的问题是我真的不知道如何结合扩展参数设置光栅参数。对于给定模型的 1 个数据集,它会返回错误,但不会返回另一个。这些只是较大的个人数据集的 2 个迷你子集,我有超过 100 个个人。因此,如果我可以指定一个模型来尽其所能容纳所有数据集,那将会很有用。我想我可以为我的所有模型将ext 参数设置为一个很大的数字,但我不确定这是否是理想和最好的方法。感谢您的帮助!

这是我用于子集的 R 代码:

    require(move)

ss1 <- move(x=data.ss1$X, y=data.ss1$Y, time=as.POSIXct(data.ss1$timestamp, format="%Y-%m-%d %H:%M", tz="US/Eastern"), 
            proj=CRS("+proj=longlat +ellps=WGS84"),data=data.ss1, animal="20186") 

data.sAEQD1 <- spTransform(ss1, center=T)

x_UD1 <- brownian.bridge.dyn(data.sAEQD1, window.size=31, ext=1.5,
                             margin=15, raster=100,
                             location.error=23)
ss2 <- move(x=data.ss2$X, y=data.ss2$Y, time=as.POSIXct(data.ss2$timestamp, format="%Y-%m-%d %H:%M", tz="US/Eastern"), 
            proj=CRS("+proj=longlat +ellps=WGS84"),data=data.ss2, animal="27549") 

data.sAEQD2 <- spTransform(ss2, center=T)

x_UD2 <- brownian.bridge.dyn(data.sAEQD2, window.size=31, ext=1.5,
                             margin=15, raster=100,
                             location.error=23)

【问题讨论】:

    标签: r


    【解决方案1】:

    有几点说明,首先,由于 2.0 版本的 move 包设置大范围(ext)不会以长计算时间为代价,因此设置稍高的数字(例如 2 或 3)不会伤害。

    raster 参数设置用于 UD 计算的网格的分辨率。这对计算时间有很大影响。如果分辨率大两倍计算应该快4倍。

    ext 参数确定光栅超出轨迹范围的程度。

    鉴于它是来自记录站的数据,因此检查模型结果尤其重要,因为长时间的平稳性可能会导致非常小的 sigma 估计值。我还注意到您有时在录制之间有相当长的间隔(10 天,交替录制 2 分钟),这通常会导致 UD 伸展得很宽,因为动物在哪里的不确定性很大。它还会导致记录非常慢,因为为数值积分选择了一个小的时间步长,设置 time.step=.6 左右可能会加快速度(默认情况下 time.step 设置为最短间隔的 1/15) .

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-03-14
      • 1970-01-01
      • 2020-08-25
      • 1970-01-01
      • 2022-01-20
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多