so far uncertianty of what cv plot prediction data
play

So far... Uncertianty of what? CV plot Prediction data Plotting - - PowerPoint PPT Presentation

So far... Uncertianty of what? CV plot Prediction data Plotting - data processing Variance of abundance In R... Variance propagation When can we use the delta method? GAM + detection function uncertainty Sources of uncertainty Eort


  1. So far... Uncertianty of what? CV plot Prediction data Plotting - data processing Variance of abundance In R... Variance propagation When can we use the delta method? GAM + detection function uncertainty Sources of uncertainty EοΏ½ort overplotted Prediction recap Extrapolation What do we mean by extrapolation? Subsetting Total abundance Predicting Maps of predictions Making a prediction Predictors Interpreting CV plots Plotting (code) Big CVs Avoiding rules of thumb Resources Uncertainty recap Segmenting Disappointment Covariates can make a big diοΏ½erence! Going back to the formula Visibility during POWER 2014 Pilot studies and "you get what you pay for" What does a map mean? Sometimes things are complicated Each cell has an abundance, sum to get total R subsetting lets you calculate "interesting" estimates: (Getting a little fast-and-loose with the mathematics) ## x y Depth SST NPP DistToCAS Count model ( observations): Using dsm.var.gam dsm_tw_var_map <- dsm.var.gam(dsm_all_tw_rm, predgrid_split, predgrid$width <- predgrid$height <- 10*1000 Build, check & select detection models Course reading list has pointers to these topics Plotting coefficient of variation Add another column to the prediction data Example on course site Sometimes you don't have enough data How does uncertainty arise in a DSM? Same data, same spatial model Designing surveys is hard Calculate uncertainty per-cell In general, try not to do it! Weather has a big effect on detectability Detection function parameters When detection function is not independent Uncertainty from detection function + GAM Here CVs are "well behaved" Think about assumptions Assumes detection function and GAM are independent With these values can use predict in R Using predict Functions in dsm to do this ## 126 547984.6 788254 153.59825 12.04609 1462.521 11788.974 π‘˜ predgrid_split <- split(predgrid, 1:nrow(predgrid)) off.set=predgrid$off.set) p <- ggplot(predgrid) + Predicting at values Grids! ## 127 557984.6 788254 552.31067 12.81379 1465.410 5697.248 Detection function head(predgrid_split,3) geom_tile(aes(x=x, y=y, This is okay if: Length of Variance issues? GAM parameters Or, enough coverage Need to record during survey Plotting then easier (in R) Uncertainty "propagated" through the model Build, check & select spatial models Estimate variance of abundance estimate DenMod wiki with FAQ and more With weather covariates and without Standardise standard deviation by mean Not always the case (huge CVs possible) is reasonable dsm.var.* thinks predgrid is one "region" Getting "overall" abundance dsm.var.gam Want to talk about , so need to do some maths # how many sperm whales at depths shallower than 2500m? sum(predgrid$Nhat_tw) outside those observed ## 258 527984.6 778254 96.81992 12.90251 1429.432 13722.626 dsm_tw_var_ind <- dsm.var.gam(dsm_all_tw_rm, predgrid, fill=Nhat_tw)) β‰ˆ 2 π‘₯ 𝑂 Μ‚ Designing surveys is essential Cells are abundance π‘œ π‘˜ = 𝐡 π‘˜ π‘ž Μ‚ exp [ 𝛾 0 + 𝑑 ( y π‘˜ ) + 𝑑 ( Depth π‘˜ ) ] + πœ— π‘˜ sum(predgrid$Nhat_tw[predgrid$Depth < 2500]) predict(model, newdata=data, off.set=off.set) ## 259 537984.6 778254 138.23763 13.21393 1424.862 9720.671 off.set=predgrid$off.set) CV 2 𝑂 Μ‚ π‘˜ CV 2 no detection function covariates Spatial model scale_fill_viridis() + assumes spatial model and detection function are (And more! But only looking at these 2 here!) Disambiguate between distribution/detectability These can be a pain to plot Or, the right covariates Distance sampling Google Group Too big: no detail Map coefficient of variation Space-time interchangability? Refit both models together ## $`1` ## 260 547984.6 778254 505.14386 13.75655 1379.351 8018.690 Need to split data into cells (using split() ) Subsetting summary(dsm_tw_var_ind) (per cell) ) β‰ˆ (GAM) + dsm does this for you! What does "outside" p <- plot(dsm_tw_var_map, estimate ## [1] 2491.863 ( coord_equal() What about predictions? 𝑂 Μ‚ 𝑂 Μ‚ ## x y Depth SST NPP DistToCAS Lecture 5: Predictions Lecture 5: Predictions ## 261 557984.6 778254 1317.59521 14.42525 1348.544 3775.462 predgrid$Nhat_tw <- predict(dsm_all_tw_rm, independent observations=FALSE, CV = se( )/ Now we can make predictions Now we can make predictions ## [1] 1006.27 mean? print(p) Friendly, helpful, low traffic ## 126 547984.6 788254 153.5983 12.04609 1462.521 11788.97 ## EKE off.set long lat Predictions (index ): predgrid, Think about design Potential confounding can be BAD Too small: all 0/1 Bravington, Miller and Hedley (2019) dsmextra package by Phil Bouchet Use cut() in R to make categorical variable plot=FALSE) + Plotting in R Need width and height of cells for plotting Can be useful to overplot survey effort "snapshot" Details in Miller et al (2013) appendix ## Summary of uncertainty in a density surface model calculated ## EKE off.set long lat Nhat_tw ## 126 0.0008329031 1e+08 -66.52252 40.94697 off.set=predgrid$off.set) 𝑠 coord_equal() + between transects? Predictions are useless without uncertainty Predictions are useless without uncertainty Where does uncertainty come from? Where does uncertainty come from? Let's talk about maps Let's talk about maps Estimating variance Estimating variance Practical advice Practical advice That's all folks! That's all folks! Extrapolation Extrapolation Getting help Getting help and and Better to fail one season than fail for 5, 10 years ## analytically for GAM, with delta method off.set gives the area of the grid cells dsm.var.prop CV 2 https://arxiv.org/abs/1807.07996 Spatial coverage see distancesampling.org/distancelist.html Sometimes, you can't build a spatial model ## 126 0.0008329031 1e+08 -66.52252 40.94697 0.01417646 ## 127 0.0009806611 1e+08 -66.40464 40.94121 https://densitymodelling.github.io/dsmextra/index.html e.g. c(seq(0,1, len=10), 2:4, Inf) or somesuch # how many sperm whales East of 0? scale_fill_viridis() See also Redfern et al., (2008) Extrapolation (and its dangers) Sum cells to get ## (detection function) ## 258 0.0011575423 1e+08 -66.76551 40.86781 ## height width sum(predgrid$Nhat_tw[predgrid$x>0]) print(p) Now we are dangerous. Now we are dangerous. outside "survey area"? 𝛾 Μ‚ ## Approximate asymptotic confidence interval: propagates uncertainty from detection function to variance variance π‘œ Μ‚ 𝑑 Μ‚ y 𝑠 𝑑 Μ‚ Depth 𝑠 = 𝐡 𝑠 exp [ + ( ) + ( ) ] ## 126 10000 10000 abundance ## 259 0.0013417297 1e+08 -66.64772 40.86227 Covariate coverage 𝑠 0 ## 2.5% Mean 97.5% Get information early, get it cheap (Example in practical) spatial model ## ## 260 0.0026881567 1e+08 -66.52996 40.85662 more info in ?predict.dsm ## 1539.017 2491.863 4034.641 ## [1] 1383.744 ## $`2` ## 261 0.0045683752 1e+08 -66.41221 40.85087 Sum a subset? Inform design from a pilot study ## (Using log-Normal approximation) ## x y Depth SST NPP DistToCAS Need to "fill-in" values for , and . only works for count models ## ## 127 557984.6 788254 552.3107 12.81379 1465.41 5697.248 𝐡 𝑠 y 𝑠 Depth 𝑠 ## Point estimate : 2491.863 the "delta method" ## EKE off.set long lat Nhat_tw covariates can only vary at segment level ## CV of detection function : 0.2113123 ## 127 0.0009806611 1e+08 -66.40464 40.94121 0.05123446 ## CV from GAM : 0.1329 ## height width ## Total standard error : 622.0386 ## 127 10000 10000 ## Total coefficient of variation : 0.2496 ## ## $`3` ## x y Depth SST NPP DistToCAS Thanks to Hiroto Murase and co. for this data! ## 258 527984.6 778254 96.81992 12.90251 1429.432 13722.63 44 / 45 10 / 45 40 / 45 45 / 45 41 / 45 11 / 45 43 / 45 43 / 45 42 / 45 45 / 45 39 / 45 24 / 45 27 / 45 17 / 45 29 / 45 22 / 45 21 / 45 30 / 45 20 / 45 20 / 45 19 / 45 19 / 45 18 / 45 18 / 45 31 / 45 32 / 45 26 / 45 16 / 45 38 / 45 36 / 45 12 / 45 13 / 45 37 / 45 13 / 45 25 / 45 28 / 45 14 / 45 33 / 45 35 / 45 35 / 45 23 / 45 34 / 45 15 / 45 17 / 45 1 / 45 6 / 45 2 / 45 3 / 45 3 / 45 4 / 45 5 / 45 9 / 45 8 / 45 7 / 45 1 / 45 ## EKE off.set long lat Nhat_tw

  2. So far... Build, check & select detection models Build, check & select spatial models What about predictions? 2 / 45

  3. Let's talk about maps Let's talk about maps 3 / 45 3 / 45

  4. What does a map mean? Grids! Cells are abundance estimate "snapshot" Sum cells to get abundance Sum a subset? 4 / 45

  5. Going back to the formula Count model ( observations): π‘˜ π‘œ π‘˜ = 𝐡 π‘˜ π‘ž Μ‚ exp [ 𝛾 0 + 𝑑 ( y π‘˜ ) + 𝑑 ( Depth π‘˜ ) ] + πœ— π‘˜ π‘˜ Predictions (index ): 𝑠 𝛾 Μ‚ π‘œ Μ‚ 𝑑 Μ‚ y 𝑠 𝑑 Μ‚ Depth 𝑠 = 𝐡 𝑠 exp [ + ( ) + ( ) ] 𝑠 0 Need to "fill-in" values for , and . 𝐡 𝑠 y 𝑠 Depth 𝑠 5 / 45

  6. Predicting With these values can use predict in R predict(model, newdata=data, off.set=off.set) off.set gives the area of the grid cells more info in ?predict.dsm 6 / 45

Recommend


More recommend