Skip to contents

A function to calculate the dynamic Bivariate Gaussian Bridge orthogonal and parallel variance for a movement track

Usage

dynBGBvariance(move, locErr, margin, windowSize,...)

Arguments

move

a move object. This object must be in a projection different to longitude/latitude, use spTransform to transform your coordinates.

locErr

single numeric value or vector of the length of coordinates that describes the error of the location (sender/receiver) system in map units. Or a character string with the name of the column containing the location error can be provided.

margin

The margin used for the behavioral change point analysis. This number has to be odd.

windowSize

The size of the moving window along the track. Larger windows provide more stable/accurate estimates of the brownian motion variance but are less well able to capture more frequent changes in behavior. This number has to be odd.

...

Additional arguments

Details

The function uses windowApply with the BGBvarbreak function in order to implement a dynamic calculation of the variance

Value

a dBGBvariance-class object

References

Kranstauber, B., Safi, K., Bartumeus, F.. (2014), Bivariate Gaussian bridges: directional factorization of diffusion in Brownian bridge models. Movement Ecology 2:5. doi:10.1186/2051-3933-2-5.

Author

Bart Kranstauber & Anne Scharf

Examples

data(leroy)
leroy <- leroy[230:265,]

## change projection method to aeqd and center the coordinate system to the track
dataAeqd <- spTransform(leroy, CRSobj="+proj=aeqd +ellps=WGS84", center=TRUE)

dBGBvar <- dynBGBvariance(dataAeqd, locErr=9, windowSize=31, margin=15)
#> Warning: Optimized to zero
#> Warning: Optimized to zero
dBGBvar
#>               coordinates               timestamp eobs.battery.voltage
#> 481 (511.2778, -861.4074) 2009-02-16 06:00:17.999                 3642
#> 482 (493.8736, -869.6403) 2009-02-16 06:15:29.997                 3649
#> 483 (288.4163, -371.5557) 2009-02-16 06:30:39.000                 3637
#> 484 (291.5331, -321.2216) 2009-02-16 06:45:15.997                 3632
#> 485 (376.5051, -340.5135) 2009-02-16 07:00:22.000                 3635
#> 486 (253.9153, -16.36416) 2009-02-16 07:15:24.999                 3632
#> 487  (-194.8878, 296.247) 2009-02-16 07:30:39.999                 3627
#> 488 (-486.2428, 187.9726) 2009-02-16 07:45:20.000                 3625
#> 489  (-508.401, 184.4749) 2009-02-16 08:01:50.999                 3632
#> 490 (-511.1986, 208.5924) 2009-02-16 08:16:36.999                 3632
#> 491 (-498.6528, 175.2206) 2009-02-16 08:30:48.000                 3632
#> 492 (-493.7076, 191.8946) 2009-02-16 08:45:45.000                 3632
#> 493   (-502.1551, 189.84) 2009-02-16 09:00:58.997                 3632
#> 494 (-224.0052, 476.9105) 2009-02-16 09:15:35.997                 3627
#> 495  (127.0539, 869.6603) 2009-02-16 09:30:46.999                 3625
#> 496  (235.6933, 482.8319) 2009-02-16 09:45:26.000                 3620
#> 497  (179.325, -234.7656) 2009-02-16 10:00:51.000                 3623
#> 498 (195.1895, -243.8411) 2009-02-16 10:15:35.997                 3623
#> 499 (220.9947, -341.6089) 2009-02-16 10:30:38.997                 3627
#> 500  (286.053, -431.5211) 2009-02-16 10:45:24.997                 3625
#> 501 (318.2851, -501.4274) 2009-02-16 11:01:09.000                 3632
#> 502 (313.8483, -503.5605) 2009-02-16 11:15:51.000                 3632
#> 503  (315.322, -508.4816) 2009-02-16 11:30:16.000                 3632
#> 504  (310.9174, -499.106) 2009-02-16 11:45:20.999                 3642
#> 505  (315.404, -510.0257) 2009-02-16 12:00:25.999                 3647
#> 506 (312.8903, -499.1726) 2009-02-16 12:15:11.999                 3652
#> 507  (312.219, -497.9839) 2009-02-16 12:30:45.000                 3652
#> 508 (308.0928, -491.6743) 2009-02-16 12:45:43.997                 3645
#> 509 (318.2199, -506.4152) 2009-02-16 13:00:25.997                 3642
#> 510   (311.8594, -511.57) 2009-02-16 13:16:04.000                 3643
#> 511  (287.177, -492.2307) 2009-02-16 13:30:55.000                 3637
#> 513 (323.9009, -502.0937) 2009-02-16 14:00:43.000                 3637
#> 514 (311.4169, -501.7388) 2009-02-16 14:15:48.999                 3642
#> 515 (308.2658, -516.0248) 2009-02-16 14:30:59.000                 3638
#> 516 (315.2069, -497.0507) 2009-02-16 14:45:45.000                 3638
#> 517 (317.4093, -503.1493) 2009-02-16 15:01:33.000                 3645
#>     eobs.horizontal.accuracy.estimate eobs.key.bin.checksum
#> 481                              7.42            3176955507
#> 482                              8.70            3139764111
#> 483                              8.45            2078320217
#> 484                              7.68             240013594
#> 485                              8.96            1241574621
#> 486                              8.96            2953393676
#> 487                             15.87            1407198400
#> 488                             11.52            1564363870
#> 489                             56.58            2844287311
#> 490                             77.57            4291715164
#> 491                             29.18            4183208866
#> 492                             16.64            3052007744
#> 493                             34.30            2753733296
#> 494                             25.34            2600037759
#> 495                              7.17            4278126056
#> 496                             14.08             133217540
#> 497                              4.10            2859995921
#> 498                              4.35            3561279887
#> 499                              5.12            2592106979
#> 500                              7.94            1721000569
#> 501                              9.22            1412920251
#> 502                              5.63             333830276
#> 503                              7.42             239020043
#> 504                             17.41            1290356863
#> 505                              5.38            4214530624
#> 506                              6.14             277604328
#> 507                              4.61             796074989
#> 508                             14.08             485550622
#> 509                             27.39            2306753863
#> 510                             53.76             717331412
#> 511                             37.63             941707278
#> 513                              8.45            4012835419
#> 514                             24.32            3983589768
#> 515                             35.84            1884037354
#> 516                              6.40             173446269
#> 517                             20.22            3170610477
#>     eobs.speed.accuracy.estimate    eobs.start.timestamp eobs.status
#> 481                         5.56 2009-02-16 06:00:01.000           A
#> 482                         8.06 2009-02-16 06:15:01.000           A
#> 483                         4.23 2009-02-16 06:30:02.000           A
#> 484                         4.99 2009-02-16 06:45:00.000           A
#> 485                         7.57 2009-02-16 07:00:02.000           A
#> 486                         7.02 2009-02-16 07:15:00.000           A
#> 487                        11.73 2009-02-16 07:30:01.000           A
#> 488                         5.01 2009-02-16 07:45:02.000           A
#> 489                        18.74 2009-02-16 08:00:00.000           A
#> 490                         8.61 2009-02-16 08:15:01.000           A
#> 491                        20.24 2009-02-16 08:30:02.000           A
#> 492                         7.35 2009-02-16 08:45:01.000           A
#> 493                         9.63 2009-02-16 09:00:00.000           A
#> 494                        18.69 2009-02-16 09:15:01.000           A
#> 495                         7.33 2009-02-16 09:30:01.000           A
#> 496                         9.09 2009-02-16 09:45:02.000           A
#> 497                         4.44 2009-02-16 10:00:01.000           A
#> 498                         3.60 2009-02-16 10:15:00.000           A
#> 499                         5.15 2009-02-16 10:30:01.000           A
#> 500                         6.94 2009-02-16 10:45:01.000           A
#> 501                         5.04 2009-02-16 11:00:02.000           A
#> 502                         5.82 2009-02-16 11:15:01.000           A
#> 503                         6.42 2009-02-16 11:30:01.000           A
#> 504                         8.89 2009-02-16 11:45:00.000           A
#> 505                         4.67 2009-02-16 12:00:01.000           A
#> 506                         4.12 2009-02-16 12:15:02.000           A
#> 507                         4.62 2009-02-16 12:30:02.000           A
#> 508                         5.99 2009-02-16 12:45:00.000           A
#> 509                        12.77 2009-02-16 13:00:01.000           A
#> 510                        15.69 2009-02-16 13:15:02.000           A
#> 511                         5.11 2009-02-16 13:30:01.000           A
#> 513                         4.67 2009-02-16 14:00:01.000           A
#> 514                         8.11 2009-02-16 14:15:00.000           A
#> 515                        16.63 2009-02-16 14:30:02.000           A
#> 516                         4.92 2009-02-16 14:45:01.000           A
#> 517                         9.46 2009-02-16 15:00:01.000           A
#>     eobs.temperature eobs.type.of.fix eobs.used.time.to.get.fix ground.speed
#> 481               26                3                        16         0.19
#> 482               21                3                        28         0.98
#> 483               19                3                        37         0.20
#> 484               20                3                        15         0.49
#> 485               20                3                        20         1.36
#> 486               20                3                        24         3.54
#> 487               18                3                        38         0.59
#> 488               20                3                        18         0.41
#> 489               22                3                       110         1.41
#> 490               23                3                        95         1.53
#> 491               24                3                        46         1.43
#> 492               23                3                        44         0.25
#> 493               25                3                        58         0.90
#> 494               20                3                        34         1.31
#> 495               19                3                        45         0.43
#> 496               20                3                        24         5.04
#> 497               18                3                        50         0.58
#> 498               20                3                        35         0.28
#> 499               21                3                        37         0.32
#> 500               23                3                        23         2.44
#> 501               22                3                        67         0.87
#> 502               22                3                        50         0.12
#> 503               22                3                        15         0.04
#> 504               19                3                        20         0.65
#> 505               18                3                        24         0.06
#> 506               18                3                         9         0.59
#> 507               19                3                        43         0.17
#> 508               21                3                        43         0.30
#> 509               22                3                        24         1.11
#> 510               24                3                        62         0.47
#> 511               24                3                        54         0.49
#> 513               27                3                        42         0.16
#> 514               26                3                        48         0.32
#> 515               24                3                        57         0.51
#> 516               24                3                        44         0.40
#> 517               24                3                        92         0.33
#>     heading height.above.ellipsoid utm.easting utm.northing utm.zone
#> 481  357.17                   88.3    590703.9      4733995      18N
#> 482  204.47                   55.7    590686.6      4733987      18N
#> 483    8.52                   70.0    590474.8      4734482      18N
#> 484  356.52                   67.9    590477.2      4734532      18N
#> 485  353.89                   62.5    590562.4      4734514      18N
#> 486  318.50                   73.1    590435.6      4734836      18N
#> 487  247.73                   61.8    589982.9      4735143      18N
#> 488   20.97                   77.8    589693.1      4735031      18N
#> 489  119.28                   45.9    589671.0      4735027      18N
#> 490  305.40                   67.7    589667.9      4735051      18N
#> 491    8.52                  103.0    589680.9      4735018      18N
#> 492    7.86                   81.8    589685.6      4735035      18N
#> 493   34.08                  165.3    589677.2      4735033      18N
#> 494   63.57                   86.6    589951.5      4735323      18N
#> 495  337.51                   83.4    590297.3      4735720      18N
#> 496  222.82                   70.3    590410.9      4735335      18N
#> 497    0.00                   77.9    590363.9      4734617      18N
#> 498  350.62                   76.4    590379.9      4734608      18N
#> 499    5.90                   73.6    590407.0      4734511      18N
#> 500  146.15                   67.5    590473.2      4734422      18N
#> 501  356.52                   85.7    590506.3      4734352      18N
#> 502    3.28                   77.3    590501.9      4734350      18N
#> 503   21.63                   84.2    590503.4      4734345      18N
#> 504  351.93                   69.3    590498.9      4734355      18N
#> 505   21.63                  108.4    590503.5      4734344      18N
#> 506   15.07                   71.1    590500.9      4734355      18N
#> 507    1.97                   78.9    590500.2      4734356      18N
#> 508  347.34                   75.5    590496.0      4734362      18N
#> 509   41.94                   72.9    590506.3      4734347      18N
#> 510  212.34                   70.7    590500.0      4734342      18N
#> 511  298.19                   64.6    590475.1      4734361      18N
#> 513   26.87                   77.0    590511.9      4734352      18N
#> 514  187.43                   64.5    590499.5      4734352      18N
#> 515  221.51                   46.5    590496.5      4734338      18N
#> 516    1.31                   71.0    590503.2      4734357      18N
#> 517   24.90                   75.2    590505.5      4734351      18N
#>       study.local.timestamp
#> 481 2009-02-16 00:00:17.999
#> 482 2009-02-16 00:15:29.997
#> 483 2009-02-16 00:30:39.000
#> 484 2009-02-16 00:45:15.997
#> 485 2009-02-16 01:00:22.000
#> 486 2009-02-16 01:15:24.999
#> 487 2009-02-16 01:30:39.999
#> 488 2009-02-16 01:45:20.000
#> 489 2009-02-16 02:01:50.999
#> 490 2009-02-16 02:16:36.999
#> 491 2009-02-16 02:30:48.000
#> 492 2009-02-16 02:45:45.000
#> 493 2009-02-16 03:00:58.997
#> 494 2009-02-16 03:15:35.997
#> 495 2009-02-16 03:30:46.999
#> 496 2009-02-16 03:45:26.000
#> 497 2009-02-16 04:00:51.000
#> 498 2009-02-16 04:15:35.997
#> 499 2009-02-16 04:30:38.997
#> 500 2009-02-16 04:45:24.997
#> 501 2009-02-16 05:01:09.000
#> 502 2009-02-16 05:15:51.000
#> 503 2009-02-16 05:30:16.000
#> 504 2009-02-16 05:45:20.999
#> 505 2009-02-16 06:00:25.999
#> 506 2009-02-16 06:15:11.999
#> 507 2009-02-16 06:30:45.000
#> 508 2009-02-16 06:45:43.997
#> 509 2009-02-16 07:00:25.997
#> 510 2009-02-16 07:16:04.000
#> 511 2009-02-16 07:30:55.000
#> 513 2009-02-16 08:00:43.000
#> 514 2009-02-16 08:15:48.999
#> 515 2009-02-16 08:30:59.000
#> 516 2009-02-16 08:45:45.000
#> 517 2009-02-16 09:01:33.000