Making predictions

So far... Build, check & select models for detectability Build, check & select models for abundance Make some ecological inference about smooths What about predictions?

Let's talk about maps

What does a map mean? Grids! Cells are abundance estimate “snapshot” Sum cells to get abundance Sum a subset?

Going back to the formula (Count) Model:

nj = Aj p^j exp[β0 + s(yj ) + s(Depthj )] + ϵj Predictions (index r):

nr = Ar exp[β0 + s(yr ) + s(Depthr )] Need to “fill-in” values for Ar , yr and Depthr .

Predicting With these values can use predict in R predict(model, newdata=data)

Prediction data x y Depth SST NPP DistToCAS EKE off.set 126 547984.6 788254 153.5983 8.8812 1462.521 11788.974 0.0074 127 557984.6 788254 552.3107 9.2078 1465.410 5697.248 0.0144 258 527984.6 778254 96.8199 9.6341 1429.432 13722.626 0.0024 259 537984.6 778254 138.2376 9.6650 1424.862 9720.671 0.0027 260 547984.6 778254 505.1439 9.7905 1379.351 8018.690 0.0101 261 557984.6 778254 1317.5952 9.9523 1348.544 3775.462 0.0193 LinkID Nhat_tw 126 1 0.01417657 127 2 0.05123483 258 3 0.01118858 259 4 0.01277096 260 5 0.04180434 261 6 0.45935801

1e+08 1e+08 1e+08 1e+08 1e+08 1e+08

A quick word about rasters We have talked about rasters a bit In R, the data.frame is king Fortunately as.data.frame exists Make our “stack” and then convert to data.frame

Predictors

Making a prediction Add another column to the prediction data Plotting then easier (in R) predgrid$Nhat_tw <- predict(dsm_all_tw_rm, predgrid)

Maps of predictions p <- ggplot(predgrid) + geom_tile(aes(x=x, y=y, fill=Nhat_tw)) + scale_fill_viridis() + coord_equal() print(p)

Total abundance Each cell has an abundance, sum to get total sum(predict(dsm_all_tw_rm, predgrid)) [1] 2491.864

Subsetting R subsetting lets you calculate “interesting” estimates: # how many sperm whales at depths less than 2500m? sum(predgrid$Nhat_tw[predgrid$Depth < 2500]) [1] 1006.272

# how many sperm whales North of 0? sum(predgrid$Nhat_tw[predgrid$x>0]) [1] 1383.742

Extrapolation

What do we mean by extrapolation? Predicting at values outside those observed What does “outside” mean? between transects? outside “survey area”?

Temporal extrapolation Models are temporally implicit (mostly) Dynamic variables change seasonally Migration can be an issue Need to understand what the predictions are

Extrapolation Extrapolation is fraught with issues Want to be predicting “inside the rug” In general, try not to do it! (Think about variance too!)

Recap Using predict Getting “overall” abundance Subsetting Plotting in R Extrapolation (and its dangers)

Estimating variance

Now we can make predictions Now we are dangerous.

Predictions are useless without uncertainty

Where does uncertainty come from?

Sources of uncertainty Detection function GAM parameters

Let's think about smooths first

Uncertainty in smooths Dashed lines are +/- 2 standard errors

^? How do we translate to N

Back to bases Before we expressed smooths as:

s(x) =

K ∑k=1

βk bk (x)

Theory tells us that:

^, V β ) β ∼ N(β where Vβ is a bit complicated (derived from the smoother matrix)

Predictions to prediction variance (roughly) “map” data onto fitted values Xβ “map” prediction matrix to predictions Xp β Here Xp need to take smooths into account pre-/post-multiply by Xp to “transform variance”



T Xp Vβ Xp

link scale, need to do another transform for response

Adding in detection functions

GAM + detection function uncertainty (Getting a little fast-and-loose with the mathematics)

CV (N^ ) ≈ CV (GAM) + 2

2

2

CV (detection function)

Not that simple... Assumes detection function and GAM are independent Maybe this is okay? (Probably not true?)

Variance propagation Include the detectability as term in GAM Random effect, mean zero, variance of detection function Uncertainty “propagated” through the model Details in bibliography (too much to detail here) Under development (Can cover in special topic)

That seemed complicated...

R to the rescue

In R... Functions in dsm to do this dsm.var.gam assumes spatial model and detection function are independent dsm.var.prop propagates uncertainty from detection function to spatial model only works for count models (more or less)

Variance of abundance Using dsm.var.gam dsm_tw_var_ind <- dsm.var.gam(dsm_all_tw_rm, predgrid, off.set=predgrid$off.set) summary(dsm_tw_var_ind) Summary of uncertainty in a density surface model calculated analytically for GAM, with delta method Approximate asymptotic confidence interval: 2.5% Mean 97.5% 1539.018 2491.864 4034.643 (Using log-Normal approximation) Point estimate : 2491.864 CV of detection function : 0.2113123 CV from GAM : 0.1329 Total standard error : 622.0389 Total coefficient of variation : 0.2496

Variance of abundance Using dsm.var.prop dsm_tw_var <- dsm.var.prop(dsm_all_tw_rm, predgrid, off.set=predgrid$off.set) summary(dsm_tw_var) Summary of uncertainty in a density surface model calculated by variance propagation. Probability of detection in fitted model and variance model Fitted.model Fitted.model.se Refitted.model 1 0.3624567 0.07659373 0.3624567 Approximate asymptotic confidence interval: 2.5% Mean 97.5% 1556.898 2458.634 3882.646 (Using log-Normal approximation) Point estimate : 2458.634 Standard error : 581.0379 Coefficient of variation : 0.2363

Plotting - data processing Calculate uncertainty per-cell dsm.var.* thinks predgrid is one “region” Need to split data into cells (using split()) (Could be arbitrary sets of cells, see exercises) Need width and height of cells for plotting

Plotting (code) predgrid$width <- predgrid$height <- 10*1000 predgrid_split <- split(predgrid, 1:nrow(predgrid)) head(predgrid_split,3) $`1` x y Depth SST NPP DistToCAS EKE off.set 126 547984.6 788254 153.5983 8.8812 1462.521 11788.97 0.0074 1e+08 LinkID Nhat_tw height width 126 1 0.01417657 10000 10000 $`2` x y Depth SST NPP DistToCAS EKE off.set 127 557984.6 788254 552.3107 9.2078 1465.41 5697.248 0.0144 1e+08 LinkID Nhat_tw height width 127 2 0.05123483 10000 10000 $`3` x y Depth SST NPP DistToCAS EKE off.set 258 527984.6 778254 96.8199 9.6341 1429.432 13722.63 0.0024 1e+08 LinkID Nhat_tw height width 258 3 0.01118858 10000 10000

dsm_tw_var_map <- dsm.var.prop(dsm_all_tw_rm, predgrid_split, off.set=predgrid$off.set)

CV plot p <- plot(dsm_tw_var_map, observations=FALSE, plot=FALSE) + coord_equal() + scale_fill_viridis() print(p)

Interpreting CV plots Plotting coefficient of variation Standardise standard deviation by mean

CV = se(N^ )/N^ (per cell) Can be useful to overplot survey effort

Effort overplotted

Big CVs Here CVs are “well behaved” Not always the case (huge CVs possible) These can be a pain to plot Use cut() in R to make categorical variable e.g. c(seq(0,1, len=100), 2:4, Inf) or somesuch

Recap How does uncertainty arise in a DSM? Estimate variance of abundance estimate Map coefficient of variation

Let's try that!

βkbk β - GitHub

Make our “stack” and then convert to data.frame .... Plotting - data processing ... Big CVs. Here CVs are “well behaved”. Not always the case (huge CVs possible).

806KB Sizes 2 Downloads 38 Views

Recommend Documents

KBK SDM
The 2007 survey contains data from SPE members in 91 countries, compared with 51 in 2006. While every ... working in South Central & Eastern Europe reported having received education beyond a Bachelors Degree, .... Earth Science.

RPKPS KBK Psikologi Umum.pdf
Mendiskusikan tiap bahasan. Ketepatan. Penjelasan;. Daya Tarik. 5 %. Page 3 of 52. RPKPS KBK Psikologi Umum.pdf. RPKPS KBK Psikologi Umum.pdf. Open.

RPKPS KBK Psi Kepribadian.pdf
There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. RPKPS KBK Psi Kepribadian.pdf. RPKPS KBK Psi Kepribadian.pdf. Open. Extract. Open with. Sign In. Main menu.

GitHub
domain = meq.domain(10,20,0,10); cells = meq.cells(domain,num_freq=200, num_time=100); ...... This is now contaminator-free. – Observe the ghosts. Optional ...

GitHub
data can only be “corrected” for a single point on the sky. ... sufficient to predict it at the phase center (shifting ... errors (well this is actually good news, isn't it?)

Torsten - GitHub
Metrum Research Group has developed a prototype Pharmacokinetic/Pharmacodynamic (PKPD) model library for use in Stan 2.12. ... Torsten uses a development version of Stan, that follows the 2.12 release, in order to implement the matrix exponential fun

Untitled - GitHub
The next section reviews some approaches adopted for this problem, in astronomy and in computer vision gener- ... cussed below), we would question the sensitivity of a. Delaunay triangulation alone for capturing the .... computation to be improved fr

ECf000172411 - GitHub
Robert. Spec Sr Trading Supt. ENA West Power Fundamental Analysis. Timothy A Heizenrader. 1400 Smith St, Houston, Tx. Yes. Yes. Arnold. John. VP Trading.

Untitled - GitHub
Iwip a man in the middle implementation. TOR. Andrea Marcelli prof. Fulvio Risso. 1859. Page 3. from packets. PEX. CethernetDipo topo data. Private. Execution. Environment to the awareness of a connection. FROG develpment. Cethernet DipD tcpD data. P

BOOM - GitHub
Dec 4, 2016 - 3.2.3 Managing the Global History Register . ..... Put another way, instructions don't need to spend N cycles moving their way through the fetch ...

Supervisor - GitHub
When given an integer, the supervisor terminates the child process using. Process.exit(child, :shutdown) and waits for an exist signal within the time.

robtarr - GitHub
http://globalmoxie.com/blog/making-of-people-mobile.shtml. Saturday, October ... http://24ways.org/2011/conditional-loading-for-responsive-designs. Saturday ...

MY9221 - GitHub
The MY9221, 12-channels (R/G/B x 4) c o n s t a n t current APDM (Adaptive Pulse Density. Modulation) LED driver, operates over a 3V ~ 5.5V input voltage ...

fpYlll - GitHub
Jul 6, 2017 - fpylll is a Python (2 and 3) library for performing lattice reduction on ... expressiveness and ease-of-use beat raw performance.1. 1Okay, to ... py.test for testing Python. .... GSO complete API for plain Gram-Schmidt objects, all.

article - GitHub
2 Universidad Nacional de Tres de Febrero, Caseros, Argentina. ..... www-nlpir.nist.gov/projects/duc/guidelines/2002.html. 6. .... http://singhal.info/ieee2001.pdf.

PyBioMed - GitHub
calculate ten types of molecular descriptors to represent small molecules, including constitutional descriptors ... charge descriptors, molecular properties, kappa shape indices, MOE-type descriptors, and molecular ... The molecular weight (MW) is th

MOC3063 - GitHub
IF lies between max IFT (15mA for MOC3061M, 10mA for MOC3062M ..... Dual Cool™ ... Fairchild's Anti-Counterfeiting Policy is also stated on ourexternal website, ... Datasheet contains the design specifications for product development.

MLX90615 - GitHub
Nov 8, 2013 - of 0.02°C or via a 10-bit PWM (Pulse Width Modulated) signal from the device. ...... The chip supports a 2 wires serial protocol, build with pins SDA and SCL. ...... measure the temperature profile of the top of the can and keep the pe

Covarep - GitHub
Apr 23, 2014 - Gilles Degottex1, John Kane2, Thomas Drugman3, Tuomo Raitio4, Stefan .... Compile the Covarep.pdf document if Covarep.tex changed.

SeparableFilter11 - GitHub
1. SeparableFilter11. AMD Developer Relations. Overview ... Load the center sample(s) int2 i2KernelCenter ... Macro defines what happens at the kernel center.

Programming - GitHub
Jan 16, 2018 - The second you can only catch by thorough testing (see the HW). 5. Don't use magic numbers. 6. Use meaningful names. Don't do this: data("ChickWeight") out = lm(weight~Time+Chick+Diet, data=ChickWeight). 7. Comment things that aren't c