Presentation is loading. Please wait.

Presentation is loading. Please wait.

More General Need different response curves for each predictor

Similar presentations


Presentation on theme: "More General Need different response curves for each predictor"β€” Presentation transcript:

1 More General Need different response curves for each predictor
Need more complex responses

2 Generalized Additive Models
𝑔 𝑓 π‘₯ 𝑖 = 𝛽 0 +𝑓 1 π‘₯ 1𝑖 + 𝑓 2𝑖 π‘₯ 2𝑖 +… Adds functions to linearize each predictor variable 𝐸 π‘Œ 𝑖 = 𝑔 βˆ’1 ( 𝑓 1 π‘₯ 1𝑖 + 𝑓 2𝑖 π‘₯ 2𝑖 +…) Functions can be parametric or non-parametric: Including splines Makes GAMS: Very general Prone to over-fitting

3 Spline Curves 𝑓 π‘₯ = (π‘₯+2) βˆ’2≀π‘₯β‰€βˆ’ π‘₯ 3 βˆ’6 π‘₯ βˆ’1≀π‘₯≀ βˆ’π‘₯ ≀π‘₯≀2 Knots Bell-shaped Irwin-Hall spline

4 Spline Curves in R Wrap predictors in a spline function:
s(predictor) Use β€œgamma” parameter to set the number of knots Controls over-fitting 1.4 is recommended In R: TheModel=gam(Height~s(AnnualPrecip), data=TheData,gamma=1.4)

5 Reading When you have time: For our next meeting (on web site):
β€œThe Elements of Statistical Learning” by Friedman Generalized Additive Models by Hastie and Tibshirani For our next meeting (on web site): Read Martinez-Rincon (wahoo) Jensen (crabs)

6 Which Approach? GAM Kernel Smoother Age Income Age Income
Z-axis shows the proportion of families with a telephone at home Hastie and Tibshirani 1986, Generalized Additive Models

7 GAM Plots in R β€œPartial” = 1 Covariate Modeled Response Curve 95% CI
Sample point β€œGrass” FIA Doug-Fir height data vs. BioClim Annual Precipitation

8 Brown Shrimp in GOM Data from SeaMap and NOAA
SeaMap Data, brown shrimp prefer muddy bottoms. Also, they spawn in shallow waters and then migrate to deeper water as they mature. The reason the density goes down as the depth goes to 0 is that the size of the net allows the smaller shrimp to escape. Data from SeaMap and NOAA

9 Gamma=1.4 Explained Deviance: 59%, AIC=57807 Data from FIA and BioClim
Models for Doug-Fir in California from FIA data Explained Deviance: 59%, AIC=57807 Data from FIA and BioClim

10 Gamma=10 Explained Deviance: 59%, AIC=57961 Data from FIA and BioClim

11 Gamma=20 Explained Deviance: 57%, AIC=58081 Data from FIA and BioClim

12 Gamma=20 Explained Deviance: 51%, AIC=58796 Data from FIA and BioClim

13 Gamma=0.1 Explained Deviance: 59%, AIC=57811 Data from FIA and BioClim

14 GAM Model Runs Layers Gamma Explained Deviance AIC All 6 1.4 59 57807
10 58 57961 20 57 58081 Best 3 51 58796 0.1 57811

15 Best Model? Best 3 predictors, gamma=20 Data from FIA and BioClim

16 Blue Crab Distribution Model

17 Blue Crab vs. Salinity Jensen et. al. 2005, Winter distribution of blue crab Callinectes sapidus in Chesapeake Bay: application and cross-validation of a two-stage generalized additive model

18 Response Curves (partial)
GAMs BRTs

19 GAMs vs. BRTs The BRT was made with over 5,000 trees! β€œResults indicate little difference between the performance of GAM and BRT models” Martinez-Rincon 2012, Comparative performance of generalized additive models and boosted regression trees for statistical modeling of incidental catch of wahoo (Acanthocybium solandri) in the Mexican tuna purse-seine fishery

20 Gamma in GAMs 𝑛 = number of training points π‘₯ = degrees of freedom
𝑛 – number of estimated parameters gam() chooses smoothing parameters to minimize: Note: The reason the effect of gamma reverses itself at large values is that π‘”π‘Žπ‘šπ‘Ž βˆ—π‘₯ becomes larger than 𝑛 ( 𝑦 βˆ’ 𝑦 𝑖 ) 2 (π‘›βˆ’π‘”π‘Žπ‘šπ‘Ž βˆ—π‘₯) 2

21 Anderson We are not trying to model the data; instead, we are trying to model the information in the data. The goal is to recover the information that applies more generally to the process, not just to the particular data set. If we were merely trying to model the data well, we could fit high order Fourier series terms or polynomial terms until the fit is perfect. Data contain both information and noise; fitting the data perfectly would include modeling the noise and this is counter to our science objective.

22 Additional Resources Generalized Additive Models: an introduction with R Copyrighted book Includes: Linear models GLMs GAMs Examples in R Some matrix algebra

23 Additional Resources Geospatial Analysis with GAMs:
Disease mapping using GAMs (workshop): Mapping population based studies:


Download ppt "More General Need different response curves for each predictor"

Similar presentations


Ads by Google