{"id":120,"date":"2018-03-22T09:25:42","date_gmt":"2018-03-22T09:25:42","guid":{"rendered":"https:\/\/blogs.ncl.ac.uk\/mep\/?p=120"},"modified":"2018-03-22T09:25:42","modified_gmt":"2018-03-22T09:25:42","slug":"random-encounter-uncertainty","status":"publish","type":"post","link":"https:\/\/blogs.ncl.ac.uk\/mep\/2018\/03\/22\/random-encounter-uncertainty\/","title":{"rendered":"Random encounter uncertainty"},"content":{"rendered":"<p><strong><a href=\"https:\/\/blogs.ncl.ac.uk\/mep\/staff\/\">Matt Grainger<\/a>\u00a0has kindly written this post about random encounter uncertainty models and camera traps<\/strong><\/p>\n<h2>Random encounter models with camera traps<\/h2>\n<p>A recent paper in the Journal of Zoology by Tom Gray (&#8220;Monitoring tropical forest ungulates using camera-trap data&#8221; <a href=\"10.1111\/jzo.12547\">doi:10.1111\/jzo.12547<\/a>) used a random encounter model (REM) to assess the density of lesser oriental chevrotain <em>Tragulus kanchil<\/em> in the Southern Cardamom National Park, in south-west Cambodia. Random encounter models were adapted for camera trapping by Rowcliffe et al. (2008); these models allow estimates of populations of animals that are not individually-identifiable.<\/p>\n<p>Density (D) is estimated from camera trap encounter rates by:<\/p>\n<p align=\"\u201dcenter\u201d\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-128 size-full\" src=\"https:\/\/blogs.ncl.ac.uk\/mep\/files\/2018\/03\/equation.jpg\" alt=\"\" width=\"209\" height=\"82\" \/><\/p>\n<p>where <em>y<\/em> is the total number of photographs, <em>t<\/em> is the survey effort (camera-trap nights), <em>v<\/em> is the animals speed of movement and the camera detection zone is denoted by the radius (<em>r<\/em>) and angle (<em>\u03b8<\/em>) of detection. The model assumes that camera traps are placed at random in relation to the animals movement. Variances can be estimated by non-parametric bootstrapping. Rowcliffe et al. (2008) suggest that the variances of the independently estimated variables (<em>v, r<\/em> and <em>\u03b8<\/em>) can be incorporated by adding the squared coefficients of variation to that derived from bootstrapping to give an overall squared coefficient of variation for the density estimate.<\/p>\n<p>Gray (2018) does not account for these variances in his paper, despite giving an indication of the size of the variation in these independently estimated variables. What difference would this make to the estimated density of lesser oriental chevrotain? Rather than using the delta method of Seber (1982) as suggested by Rowcliffe et al. (2008) I used the R package &#8220;propagate&#8221; (Spiess 2017) to propagate the uncertainty around the estimates of <em>v, r<\/em> and <em>\u03b8<\/em>.<\/p>\n<p>First we set up some data using the uncertainty estimates shown in Gray (2008).<\/p>\n<pre>set.seed(10101)\r\nDAT &lt;- data.frame(r = c(0.0014, 0.00026), v = c(0.82, 0.2),\r\n                  y =c(501,0), theta =c(0.063,0),tm=c(8236,0),pi=c(pi,0))<\/pre>\n<p>Next we write the formula to estimate D as an expression.<\/p>\n<pre>EXPR &lt;- expression((y\/tm)*(pi\/((v*r)*(2+theta))))<\/pre>\n<p>Then we can propagate the expression using the data. You can use the full data set or (as I have here) mean and standard deviations.<\/p>\n<pre>res &lt;- propagate(EXPR, DAT)<\/pre>\n<p>We then convert the simulation results to a dataframe so we can plot it with ggplot2. Propagate has a plot function but I have not worked out how to customise it to my own liking yet.<\/p>\n<pre>dat &lt;- as.data.frame(res$resSIM)\r\nnames(dat) &lt;- \"Density\"<\/pre>\n<p>Let&#8217;s also look at the 95% highest density region (the credible interval) and the median density estimate from the simulation.<\/p>\n<pre>hdr(dat$Density, h = bw.nrd0(dat$Density))\r\n\r\n ## $hdr\r\n ##\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 [,1]\u00a0\u00a0\u00a0\u00a0 [,2]\r\n ## 99% -18.52657 213.3657\r\n ## 95%\u00a0 19.59911 152.7857\r\n ## 50%\u00a0 70.37278 109.9119\r\n ##\r\n ## $mode\r\n ## [1] 96.91486\r\n ##\r\n ## $falpha\r\n ##\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 1%\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 5%\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 50%\r\n ## 0.002749692 0.018249954 0.059715893\r\n\r\n(median &lt;- median(dat$Density))\r\n\r\n## [1] 82.59773\r\n\r\nlwr&lt;-19.59#95% CI\r\nuppr&lt;-152.7857<\/pre>\n<p>Let&#8217;s plot the result of the simulation:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-131 size-full\" src=\"https:\/\/blogs.ncl.ac.uk\/mep\/files\/2018\/03\/density_plot.jpg\" alt=\"\" width=\"762\" height=\"608\" srcset=\"https:\/\/blogs.ncl.ac.uk\/mep\/files\/2018\/03\/density_plot.jpg 762w, https:\/\/blogs.ncl.ac.uk\/mep\/files\/2018\/03\/density_plot-300x239.jpg 300w, https:\/\/blogs.ncl.ac.uk\/mep\/files\/2018\/03\/density_plot-376x300.jpg 376w\" sizes=\"auto, (max-width: 762px) 100vw, 762px\" \/><\/p>\n<p><em><strong>The simulated density of lesser oriental chevrotain when uncertainty is taken in to account (the median density value is indicated by the solid black line and the 95% credible interval is indicated by the dashed black lines)<\/strong>.<\/em><\/p>\n<p>In Gray (2018) density was estimated at 80.7 km<sup>-2<\/sup> with boot-strapped 95% confidence intervals of 56.6-98.1 km<sup>-2<\/sup>. Here I have estimated density at 82.60 with 95% HDR 19.59 &#8211; 152.78 km<sup>-2<\/sup>. The median value is similar to the estimate in Gray (2018) but the credible intervals are much wider when we take uncertainty in to account. Given the wider credible intervals there is greater uncertainty in the estimate of density. Conservation managers might wish to increase the precision in the independently estimated variables by further research in to the species ecology (e.g. movement ecology) or by improving the estimate of the camera detection zone.<\/p>\n<h2>Decision making under uncertainty<\/h2>\n<p>With this approach we can ask questions related to the probability that the population density is greater than a value.<\/p>\n<pre>#What is the probability that the density is greater than 90 per Km-2?\r\nsum(dat$Density&gt;90)\/dim(dat)[1]\r\n\r\n## [1] 0.39562<\/pre>\n<p>These sorts of questions cannot easily be addressed outside of a Bayesian or simulation approach. This makes them extremely useful in decision making and wildlife monitoring. With monitoring data (e.g. several surveys over time) we can obtain the probability that the population is increasing or decreasing by a set amount.<\/p>\n<h2>References<\/h2>\n<p>Gray, T. (2018) Monitoring tropical forest ungulates using camera-trap data. <strong>Journal of Zoology<\/strong>, <a href=\"10.1111\/jzo.12547\">doi:10.1111\/jzo.12547<\/a><\/p>\n<p>Rowcliffe, J.M., Field, J., Turvey, S.T., Carbone, C. (2008) Estimating animal density using camera traps without the need for individual recognition. <strong>Journal of Applied Ecology<\/strong>, <em>45<\/em>(4), 1228-1236<\/p>\n<p>Seber, G.A.F. (1982). <strong>The estimation of animal abundance and related parameters<\/strong>. ISBN-13: 978-1930665552<\/p>\n<p>Spiess, A-N. (2017). <strong>propagate: Propagation of Uncertainty<\/strong>. R package version 1.0-5. <a href=\"https:\/\/CRAN.R-project.org\/package=propagate\">https:\/\/CRAN.R-project.org\/package=propagate<\/a><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Matt Grainger\u00a0has kindly written this post about random encounter uncertainty models and camera traps Random encounter models with camera traps A recent paper in the Journal of Zoology by Tom Gray (&#8220;Monitoring tropical forest ungulates using camera-trap data&#8221; doi:10.1111\/jzo.12547) used &hellip; <a href=\"https:\/\/blogs.ncl.ac.uk\/mep\/2018\/03\/22\/random-encounter-uncertainty\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":3152,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-120","post","type-post","status-publish","format-standard","hentry","category-uncategorised"],"_links":{"self":[{"href":"https:\/\/blogs.ncl.ac.uk\/mep\/wp-json\/wp\/v2\/posts\/120","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.ncl.ac.uk\/mep\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.ncl.ac.uk\/mep\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.ncl.ac.uk\/mep\/wp-json\/wp\/v2\/users\/3152"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.ncl.ac.uk\/mep\/wp-json\/wp\/v2\/comments?post=120"}],"version-history":[{"count":13,"href":"https:\/\/blogs.ncl.ac.uk\/mep\/wp-json\/wp\/v2\/posts\/120\/revisions"}],"predecessor-version":[{"id":135,"href":"https:\/\/blogs.ncl.ac.uk\/mep\/wp-json\/wp\/v2\/posts\/120\/revisions\/135"}],"wp:attachment":[{"href":"https:\/\/blogs.ncl.ac.uk\/mep\/wp-json\/wp\/v2\/media?parent=120"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.ncl.ac.uk\/mep\/wp-json\/wp\/v2\/categories?post=120"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.ncl.ac.uk\/mep\/wp-json\/wp\/v2\/tags?post=120"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}