2017-01-23 37 views
0

爲了探索我的數據(在某些位置存在/缺失數據)我希望使用「移動」包使用動態布朗運動橋運動模型(dBBMM)對利用率分佈進行建模。我試圖弄清楚它是如何工作的,所以我創建了一個簡單的代碼來運行我的數據子集的dBBMM,以創建一些圖。似乎相同的編碼規範適用於1個子集,但不適用於其他規範。具體來說,我得到的錯誤返回R動態布朗運動模型柵格錯誤

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) 

回答

1

有幾句話,首先,因爲2.0版本的移動包設置在很大程度上(EXT)的不以很長的計算時間爲代價,因此設置一個更高的數字(如2或3)不會造成傷害。

柵格參數設置用於UD計算的柵格分辨率。這對計算時間有重大影響。如果分辨率是兩倍大的計算速度應該快4倍。

ext參數確定柵格延伸超出軌跡範圍的程度。

鑑於這是來自記錄站的數據,檢查模型結果尤其重要,因爲長時間的平穩性可能導致非常小的西格瑪估計。我還注意到,在錄音之間有時會有相當長的時間間隔(10天,2分鐘錄音),這通常會導致UD伸展得相當寬,因爲動物的位置有很大的不確定性。這也會導致錄音速度很慢,因爲數值積分選擇了一個小時間步長,設置time.step = .6左右可能會加快速度(默認情況下,time.step設置爲最短間隔的1/15) 。