Applied hierarchical modeling in ecology. analysis of distribution, abundance and species richness i

Page 1


AppliedHierarchicalModelinginEcology.Analysis ofdistribution,abundanceandspeciesrichnessin RandBUGS:Volume1:PreludeandStaticModels 1stEditionKéry

https://ebookmass.com/product/applied-hierarchical-modelingin-ecology-analysis-of-distribution-abundance-and-speciesrichness-in-r-and-bugs-volume-1-prelude-and-staticmodels-1st-edition-kery/

Instant digital products (PDF, ePub, MOBI) ready for you

Download now and discover formats that fit your needs...

Applied Modeling Techniques and Data Analysis 2: Financial, Demographic, Stochastic and Statistical Models and Methods, Volume 8 Yannis Dimotikalis

https://ebookmass.com/product/applied-modeling-techniques-and-dataanalysis-2-financial-demographic-stochastic-and-statistical-modelsand-methods-volume-8-yannis-dimotikalis/ ebookmass.com

Applied Data Analysis and Modeling for Energy Engineers and Scientists

https://ebookmass.com/product/applied-data-analysis-and-modeling-forenergy-engineers-and-scientists/

ebookmass.com

Predictive Modeling in Biomedical Data Mining and Analysis

Sudipta Roy

https://ebookmass.com/product/predictive-modeling-in-biomedical-datamining-and-analysis-sudipta-roy/

ebookmass.com

(eBook PDF) Business and Society: A Strategic Approach to Social Responsibility & Ethics, 7th edition

https://ebookmass.com/product/ebook-pdf-business-and-society-astrategic-approach-to-social-responsibility-ethics-7th-edition/

ebookmass.com

https://ebookmass.com/product/to-the-gates-of-hell-david-nix-2/

ebookmass.com

Conceptions of Giftedness and Talent Robert J. Sternberg

https://ebookmass.com/product/conceptions-of-giftedness-and-talentrobert-j-sternberg/

ebookmass.com

Application of Machine Learning in Agriculture Khan

https://ebookmass.com/product/application-of-machine-learning-inagriculture-khan/

ebookmass.com

Militarized Cultural Encounters in the Long Nineteenth Century: Making War, Mapping Europe 1st ed. Edition Joseph Clarke

https://ebookmass.com/product/militarized-cultural-encounters-in-thelong-nineteenth-century-making-war-mapping-europe-1st-ed-editionjoseph-clarke/

ebookmass.com

The Analysis of Irregular Shaped Structures: Wood Diaphragms and Shear Walls, 2nd Edition Terry R. Malone

https://ebookmass.com/product/the-analysis-of-irregular-shapedstructures-wood-diaphragms-and-shear-walls-2nd-edition-terry-r-malone/

ebookmass.com

https://ebookmass.com/product/lunchtime-chronicles-mai-tai-amarieavant-lunchtime-chronicles/

ebookmass.com

AcademicPressisanimprintofElsevier

125LondonWall,LondonEC2Y5AS,UK

525BStreet,Suite1800,SanDiego,CA92101-4495,USA

225WymanStreet,Waltham,MA02451,USA

TheBoulevard,LangfordLane,Kidlington,OxfordOX51GB,UK

Copyright © 2016ElsevierInc.Allrightsreserved.

Nopartofthispublicationmaybereproducedortransmittedinanyformorbyanymeans,electronicor mechanical,includingphotocopying,recording,oranyinformationstorageandretrievalsystem,without permissioninwritingfromthepublisher.Detailsonhowtoseekpermission,furtherinformationaboutthe Publisher’spermissionspoliciesandourarrangementswithorganizationssuchastheCopyrightClearance CenterandtheCopyrightLicensingAgency,canbefoundatourwebsite: www.elsevier.com/permissions.

ThisbookandtheindividualcontributionscontainedinitareprotectedundercopyrightbythePublisher(other thanasmaybenotedherein).

Notices

Knowledgeandbestpracticeinthisfieldareconstantlychanging.Asnewresearchandexperiencebroadenour understanding,changesinresearchmethods,professionalpractices,ormedicaltreatmentmaybecome necessary.

Practitionersandresearchersmustalwaysrelyontheirownexperienceandknowledgeinevaluatingandusing anyinformation,methods,compounds,orexperimentsdescribedherein.Inusingsuchinformationormethods theyshouldbemindfuloftheirownsafetyandthesafetyofothers,includingpartiesforwhomtheyhavea professionalresponsibility.

Tothefullestextentofthelaw,neitherthePublishernortheauthors,contributors,oreditors,assumeany liabilityforanyinjuryand/ordamagetopersonsorpropertyasamatterofproductsliability,negligenceor otherwise,orfromanyuseoroperationofanymethods,products,instructions,orideascontainedinthe materialherein.

ISBN:978-0-12-801378-6

BritishLibraryCataloguing-in-PublicationData

AcataloguerecordforthisbookisavailablefromtheBritishLibrary

LibraryofCongressCataloging-in-PublicationData

AcataloguerecordforthisbookisavailablefromtheLibraryofCongress

ForinformationonallAcademicPresspublications visitourwebsiteat http://store.elsevier.com/

J.A.Roylewastheprincipalauthorofchapters2,7,8,9.Useofproductnamesdoesnotconstitute endorsementbytheU.S.Government.

ForJimNichols,whochangedthewayinwhichwethinkaboutEcology

Foreword

Istartedgraduateschoolin2003workingonasimpleprojecttounderstandhowforestmanagement practicesaffectbirdpopulationsintheWhiteMountainNationalForestinNewHampshire,USA.As withmanyprojectsofitskind,wecollectedpointcountdatatocharacterizeabundanceatacollection ofsitesthathadreceiveddifferentmanagementactions.Knowingthatwewouldfailtodetectmanyof theindividualspresentatseveralsites,andthatdetectionprobabilitymightcovarywithhabitatvariables,myadviserDavidKingrecommendedthatwesurveyeachsitemultipletimesandrecordthe distancetoeachindividualdetected.Whenthefieldseasoncametoanend,Ihadmydatainhand andwasreadytoknockoutaquickanalysis.Thatiswhenthedifficultiesbegan.ThefirstthingItried wasamultipleregression,butIwasimmediatelystumpedastowhattheappropriateresponsevariable was.Shoulditbethemeannumberofindividualsdetectedateachsite,themaximumnumberdetected, orperhapsthemedian?Differentauthoritiesrecommendeddifferentstrategies,andtomydismay,the resultsdifferedwitheachapproach.Inadditiontothisproblem,itwasapparentthatthemodelmadeno distinctionbetweentheexplanatoryvariablesthatIhadcollectedtodescribevariationinabundance andthevariablesthatIhadcollectedtoexplainvariationindetection.Asaresult,Icouldusemymodel topredicttheeffectofmanagementonobservedcounts,butnotonabundance,thestatevariablethatI wasactuallyinterestedin.

Isoonabandonedtheregressionapproachandturnedmyattentiontodistancesamplingmethods. Hereagain,IwasquicklysurprisedtofindthatalthoughIcouldpoolmydatatoaccountfortheeffect ofdistanceondetectionprobability,Icouldn’tdirectlymodeltheeffectsofmanagementvariables (someofwhichwerecontinuous)onabundance.Eventhetwo-stageapproachesthatwererecommendedatthetimewerenotpossiblebecauseofthesparsenessofmydata,whichincludedmanysiteswith nodetections.Moreover,evenifIhadbeenabletocorrectfordetectionandthenmodelmyestimates, itwouldhavebeenverydifficulttoproperlyaccountforthecovarianceoftheestimates.AsIsearched forsolutionstotheseproblems,mydespaircontinuedtogrowasIreadseveraldistancesampling papersproclaimingthatthedataIhadworkedsohardtocollectmightbeimpossibletouseformy purpose.Theonlyoptionseemedtobetostudysomethingelse!

Andthenin2004,AndyRoyleandcolleaguespublishedtwopapersthatseemedtohavebeenwrittenwithexactlymyprobleminmind.Royle(2004b, Biometrics)demonstratedhowrepeatedcount datacouldbeusedtomodelspatialvariationinabundancewhileaccountingforvariousfactorsinfluencingdetectionprobability,andRoyleetal.(2004, Ecology)explainedhowspatialvariationinabundancecouldbemodeledusingdistancedatacollectedusingstandardpointcountsurveymethods. UnlikeallothermethodsIhadseen,therewasnoneedtodoatwo-stageanalysis,anditwasstraightforwardtomodelcovariatesofbothabundanceanddetection.Herewerehierarchicalmodelsthatnot onlyprovidedconceptualclarity,butallowedmetomakefulluseofmydatasothatIcouldtestthe hypothesesIwasinterestedin.

TherewasonlyoneproblemwiththeexcitingmodelsthatIwasreadingabout Ihadnoclue howtofitthemtomydata.Ihadtakenacoupleofstatisticscourses,butIhadneverheardofmarginallikelihood,andIcertainlyhadnoideahowto writecodetomaximizeanintegratedlikelihood function.Theverynextyear,however,MarcKe ´ ry,AndyRoyle,andHansSchmidpublishedapaper in EcologicalApplications thatprovidedadditiona ldetailsaboutthesemodels,andthepaper includedanappendixwithashortRscriptthatd emonstratedhowtoobtainmaximumlikelihood

estimates.It’snoexaggerationtosaythatIlearnedmoreaboutstatisticsandprogrammingby tryingtounderstandthisonebitofcodethanId idfromanyformaleducationuptothatpoint. Fromthere,Iquicklybeganmodifyingthecodetomakeitmoregeneralandtodealwithother typesofdatathatIhadgathered.Thiseventuallyledmetodevelopsomegeneralfunctions,which werecomingtogetherjustasIlearnedaboutanRpackagebeingdevelopedbyIanFisketofitthis classofmodels.Iofferedtohelp,andeventhoughInevermetIaninperson,wehadac oupleof goodyearsofcollaborationthatresultedintheRpackage unmarked

ThereasonforconveyingthisbitofpersonalhistoryisnotjusttomakethepointthatMarcand Andyhavehadahugeimpactonmyowncareer,buttoconveyastorythatIknowappliedecologists aroundtheworldcanrelateto.Simplepracticalproblemsturnouttoposeseriouschallengeswhenwe areunabletodirectlyobservetheprocessesofinterest.Indicesofabundanceandpopulationtrendsare nearlyuselesswhenwe’reconcernedaboutabsoluteslikeextinctionriskorharvestlimits.Applied ecologistshaverecognizedtheseproblemsforalongtime,andhierarchicalmodelsprovideasolution byenablingresearcherstodirectlymodeltheecologicalprocess,ratherthansomepoorlydefinedindex,whilealsomodelingtheobservationprocess.Moreover,thesemodelsallowpractitionerstosolve problemsinsuchawaythattheresultscanbeclearlycommunicatedtomanagersandpolicymakers. Butwhydidittakesolongforthesemethods,thefoundationsofwhichweredevelopedalongtime ago,tomaketheirwayintothehandsofpractitioners?Inmyopinion,thepowerofhierarchicalmodels wouldneverhavebeenrealizedhaditnotbeenforresearcherslikeMarcandAndy,whohavedeliberatelyworkedtomakethesetoolsaccessibletothoseofuslackingadvanceddegreesinstatistics.This bookisaphenomenalsynthesisofthateffort.Unlikemanybooksonstatisticalmodelingthatseemto havebeenwrittenbystatisticiansforstatisticians,themainaudienceofthisvolumeisclearlythepracticingecologist.Thewritingstyleisclearandengaging,andforvirtuallyeverytechnicalproblem, workedexamplesandcodeareprovided.Thisaccomplishment,ofdistillingadvancedmodelingtechniquesintoanaccessibleformat,isinmyviewoneofthetwogreatcontributionsofthisworktoecologyandrelatedenvironmentalsciences.

Thesecondgreatcontributionofthisworkliesoutsidethecontextofappliedresearch.Thehierarchicalmodelingapproachthathasbeendevelopedandillustratedhereispartofanemergingtrend, onethatisfarmoregeneralandinsomewaysfarmoreconsequentialforecologyasascience.The methodscoveredinthisbookprovideaframeworkforadvancingknowledgeofecologicalsystems bynarrowingthechasmbetweentheoreticalandstatisticalmodels.Ithasalwaysstruckmeastroublingthatthemathematicalmodelscoveredinecologytextbooksoftenfallbythewaysidewhen wegetourhandsondata.Assoonasthedataarefacingusonthecomputer,theinstinctarisesto turntowardthelatestdevelopmentinstatisticsandleavetheorybehind.Forexample,wehave >100yearsoftheoryonthefactorslimitingspeciesdistributions factorssuchascompetition,Allee effects,andphysiologicalconstraints yetwecramdata,oftencollectedforotherpurposes,intospeciesdistributionmodelsthatignoredemographicprocessesandbioticinteractions,nottomentionthe observationprocessesthatwillcauseseverebiasifignored.Or,weoftenhavedatafrommetapopulationsthatwerunthroughamachinelearningalgorithmortowhichwefitsomesortofGAMwithloads ofrandomeffects.Thetoolsdescribedinthisbookprovideanalternative.Theyofferaframework thatallowsonetofitmetapopulationmodelstometapopulationdata,toestimatethestrengthofbiotic interactions,andtotestforeffectsofabioticcovariatesonabundance,occurrence,orpopulation growthrates.Thisisthepowerofhierarchicalmodeling:thatwecantailorourstatisticalmodelsto thescientificquestionathandandnottheotherwayaround.

Thisisnottosaythatthisbookisfulloftheory.Rather,itprovidesthetoolsnecessarytobuild hierarchicalmodelsbasedontheoryinsteadofrelyingonpurelyphenomenologicalapproaches. Whyisthissoimportantatthispointintime,whenfocusisincreasinglyshiftingtoprediction? Whydon’twejusthireateamofNetflixdataminerstoforecastthefutureofecologicalsystems? Inmyview,predictionwithoutmechanismfallswelloutsidetherealmofscience.Forinstance,we knowthatwecandevelopgoodpredictivemodelsbysimplymodelingspatialandtemporalautocorrelation.Abundanceatonelocationcanoftenbeaccuratelypredictedasafunctionofabundanceatan adjacentlocation,justasvotinghabitsinonecountycanbepredictedfromthebehaviorofneighboring counties,andjustastheweathertodayoftentellsussomethingabouttheweathertomorrow.Butwhat islearnedabouttheunderlyingprocessesfromfittingmodelslackingmechanism?Verylittle,inmy estimation,whichiswhyI’mhappytohavethisnewbookthatpresentssuchapowerfulalternative.

Asgreatasthehierarchicalmodelingframeworkis,Ithinkitisimportanttoemphasizethatitisnot meanttobeanalternativetoclassicalmethodsofexperimentaldesignandanalysis.Infact,Iwould suggestthatitisonlyviamanipulativeexperimentsthatcanweachievetheultimategoalofcausal inference.Theproblemswefaceinecology,however,arethatweoftencannotbringoursystem intothelab,andwecan’talwaysmanipulateonecomponentwhileholdingtheothersconstant.To complicatemattersfurther,processesthatholdatonepointinspaceandtimemayoperatedifferently atanother.Wearethereforeforcedtocombineexperimentalapproacheswithobservationalonesifwe wishtoadvanceknowledgeandinformconservationefforts.Onceagain,themethodspresentedinthis bookprovideaformalwayofbuildingmechanismsintoourmodelssothatwecanunifytheinsights gainedfromexperimentalstudieswiththeinformationcontainedinfielddata.Itisthisunified approachthatIthinkoffersthegreatestpromiseforadvancingourfield,anditisexcitingtobeworking inatimewhenwefinallyhavethetoolsavailableforthetask.SoitiswithgreatpleasurethatIcongratulateMarcandAndyonafantasticbook,onethat,aslargeasitis,isjustthebeginning.I’llbelooking forwardtothenextvolumeandalltheexcellentworkthatissuretobenefitfromit.

RichardChandler UniversityofGeorgia

Preface

Thisisvolume1ofournewbookontheappliedhierarchicalmodelingofthethreecentralquantitiesin ecology abundance,ordensity,occurrence,andspeciesrichness aswellasofparametersgoverning theirchangeovertime,especiallysurvivalandrecruitment.Hierarchicalmodelingisagrowthindustryin ecology.Inthelast10yearstherehavebeenadozenormorebooksfocusedonhierarchicalmodelingin ecologyincludingBanerjeeetal.(2004),ClarkandGelfand(2006),Clark(2007),GelmanandHill (2007),McCarthy(2007),RoyleandDorazio(2008),Kingetal.(2009),LinkandBarker(2010),Ke ´ ry andSchaub(2012),HobbsandHooten(2015),etc.Howcanwepossiblyadd700þ morepages(and perhaps1500ifyoucountvolume2)towhatisknownonthistopic?That’sagoodquestion!

Inthisbookwecoverseveralclassesofmodelsthathavepreviouslyreceivedonlycursoryorno treatmentatallinthehierarchicalmodelingliterature,andyettheyareextremelyimportantinecology (e.g.,distancesampling).Moreover,wegivecompleterecipesforanalyzingthesemodelsandall otherscoveredinthebook,usingprogramRingeneralandtheRpackage unmarked inparticular,and veryextensivelyusingthegenericBayesianmodelingsoftwareBUGS.Theuseof unmarked is completelynovelcomparedtotheseotherbooks.Somemodelsthatwecoverhereandespeciallyin volume2weresimplyunimaginableacoupleyearsago,e.g.,theopenhierarchicaldistancesampling models,themetacommunityabundancemodelsandmodelswithexplicitpopulationdynamics(i.e., thefamousmodelofDailandMadsen,2011),whichcanbefittocountsandrelateddata,including evendistancesamplingdata.Muchofthismaterialisextremelynew,andsomehasonlyjustappeared intheliteratureinthelastyearorso.Thus,thisbookrepresentsatimelysynthesisandextensionofthe stateofhierarchicalmodelinginecologythatbuildsonpreviousefforts,butcoversmuchnewand importantterritory,andprovidesimplementationsusingboththelikelihood(unmarked)andBayesian (BUGS)frameworks.

ABOOKOFMONOGRAPHS

Inasense, AppliedHierarchicalModelingforEcologists (AHM)isabookofbooks,ora bookof monographs.Volume1containsthefirsttwoparts,aprelude,whichintroducesthenecessaryconcepts andtechniquesinfivechapters,followedbysixchaptersthatdealwithstaticdemographicmodelsof distribution,abundance,andspeciesrichnessandotherdescriptorsofcommunitiesandmetacommunities.Volume2willcontaintwofurtherpartsondynamicmodelsandonadvanced demographicmodelsforpopulationsandcommunities;seebelowformoreinformationonthedivision oftopicsbetweenvolumes1and2of AHM andonthecontentthatweenvisionforvolume2.

Lookingbackatvolume1now,atthetimeofwritingofthispreface,wefeelasifwehave packagedalmostadozenindependentbooksintothisonebook.Therearegeneral,introductory “monographs”ontheconceptsofdistribution,abundance,andspeciesrichnessandtheirmeasurement andmodelinginpractice(Chapter1),onhierarchicalmodelsandtheiranalysis(Chapter2),onlinear, generalizedlinear,andmixedmodels(Chapter3),ondatasimulationinR(Chapter4),andonthe celebratedBUGSlanguageandsoftware(Chapter5).Afterthat,therearesixcomprehensive monographsondemographicmodelsfordistribution,abundance,andspeciesrichnessinthecontextof whatwecalla“meta-populationdesign,”thatis,theextremelycommonsituationwhereyoumeasure somethinginapopulationoracommunityatmorethanasinglepointinspace.

Intheprelude,andfollowingtheintroductoryChapter1,wehaveonemonographtocoverhierarchicalmodels(HMs)andtheirBayesianand frequentistanalyses(Chapter2).Thenext xiii

monograph(Chapter3)providesahighlyaccessiblereviewofthat“heart”ofappliedstatistics: linearmodels,generalizedlinearmodels(GLMs),andsimplemixedmodels,allofthemillustrated inthecontextofoneextremelysimpleecological dataset.Datasimulationisoneofthedefining featuresofthisbookbecauseitprovidessuchimmensebenefitsfortheworkofecologists(andalso forstatisticians).Hence,thenex tmonograph(Chapter4)isdedicatedtothisessentialtopicand walksyouthroughtheRcodenecessaryforthegenerationofonesimpletypeofdatasetthatis fundamentaltotheclassesofmodelscoveredinthisbook:thecasewhereonegoesoutandcounts birds(oranyotherspecies)atmultipleplaces(e.g.,20,100,or267)andrepeatsthesecountsateach sitemultipletimes(e.g.,2or3).

TheBUGSmodeldefinitionlanguageisimplementedinthreecurrentlyusedBUGSenginesfor Bayesianinference:WinBUGS(Lunnetal.,2000),OpenBUGS(Thomasetal.,2006),andJAGS (Plummer,2003).IthasalsojustbeenadoptedintheexcitingnewRpackageNIMBLE(NIMBLE DevelopmentTeam,2015;deValpineetal.,inreview),whichisageneralmodelfittingsoftwarethat usesandextendstheBUGSlanguageforflexiblespecificationofHMsandallowsanalysisofHMs withbothmaximumlikelihoodandBayesianposteriorinference.

Overthefirst25yearsofitsexistence,BUGShasbeeninstrumentalinthesurgeofBayesian statisticsinallkindsofsciencesincludingecology(Lunnetal.,2009).Ithasgrownbyfarintothemost importantgeneral,Bayesianmodelinglanguage,anditsuserpopulationkeepsgrowingatarapidrate (andofcoursewehopetoincreasethatrateevenmorewiththisbook).BUGSisuniqueingivingyou asanonstatisticianamodelingfreedomthatletsyoudevelop,test,andfitmodelsthatyouwouldn’t evenhavedaredtodreamofinthepre-BUGSeraofecologicalmodeling(whichwemightcallthe ecologicalStoneAge;.).AlthoughtherearenowmanyusefulintroductorybooksonBUGS(e.g., McCarthy,2007;Ke ´ ry,2010;Lunnetal.,2013;Korner-Nievergeltetal.,2015),wehavedecidedto writeyetanotherpracticalBUGSintroductionandpackageitintoChapter5.Itisourlatestandbest attemptatcoveringasmuchaspossibleonthistopicandincludingsomeofthelatesttricksinBUGS modelinginamere70bookpages,illustratingtheuseofallthreeBUGSenginesandfocusingonthe modelscoveredinChapter3,i.e.,linearmodels,GLMs,andsimplemixedmodels.Byintroducing BUGSforexactlythekindsofmodelsthatyouarelikelytobefamiliarwithalready,wehopetomake itespeciallyeasyforyoutograsptheBayesiansideoftheanalysisandtheimplementationofthese essentialmodelsintheBUGSlanguage.

Inthesecondpartofthebook,wepresentsixmonographsthatcontainacomprehensivetreatment ofimportantclassesofmodelsforinferenceaboutdistribution,abundance,andspeciesrichness,and relateddemographicpopulationorcommunitymetricsinso-called“meta-populationdesigns”(Royle, 2004a;Ke ´ ryandRoyle,2010),i.e.,forthefrequentcasewhereyouareinterestedinthesethingsnotat asingleplacebuthavestudiedthematmultiplesites.Specifically,inChapter6wecoverbinomial mixture,or N-mixture,models(Royle,2004b),whichareauniquetypeofmodelforcountdataon unmarkedindividuals(thatis,youdonotneedtokeeptrackofwhichindividualiswhichacrossthe repeatedmeasurementsofabundanceatasite)andthatcontainsanexplicitmeasurementerrormodel, whichcorrectsyourinferencesforthebiasesthatwouldotherwisebecausedbyundercountingdueto imperfectdetectionprobability.Chapter7coversa“sister-type”ofmodel,themultinomialmixture model(Royle,2004a;Dorazioetal.,2005),whichonlydiffersfrombinomialmixturemodelsinthe typeofdatatowhichitisfitted:typicallyyouneedindividualrecognition,thatis,youhavecapturerecapture-typeofdata,butagaincollectednotatasinglesitebutatmultipleplaces.Bothtypesof mixturemodelshavebeenaroundforabout10yearsnowandpreviouslytheyhavebeenfeaturedin

someoftheabove-citedhierarchicalmodelingbooks(mostlyinRoyleandDorazio,2008),butnever beforehavetheybeencoveredinsuchdetailand,especially,inamannerthatmakesthemsoaccessible toyouasanecologist.

Chapters8and9arespecialinthattheyprovideperhapsthefirstlarge,andyetpracticaland applied,synthesisindistancesamplingmorethan10yearsafterthetwoclassicsbyBucklandetal. (2001,2004a)werepublished.Inourtwodistancesamplingmonographs,weprovideafresh,newlook atdistancesamplinginthecontextofhierarchicalmodelsinanessentiallybook-lengthtreatment.We hopethatthiswillhelptomakethisimportanttypeofmodelevenmorewidelyunderstoodandusedby ecologists.Whilewecovermainlystaticmodelsinvolume1andthencoverdynamicmodelsinmore detailinvolume2of AHM,wehavedeviatedslightlyfromthisruleinChapters8and9,wherewehave preferredtopicalunityoverconceptualunitybykeepingallofdistancesampling(closedandopen) together.Nevertheless,weplantocoverseveralmorecutting-edgeopenandothernovelextensionsof hierarchicaldistancesampling(HDS)modelsinvolume2.

Thesetwomonographs,andmorespecificallythewealthofmaterialonhierarchicaldistance sampling,areperhapsthosewithmostnoveltyinourbook.Thoughagaininventedjustover10years ago(around2004),HDShasrecentlyexperiencedaboostwiththewidespreadrealizationthatthistype ofspecificationofdistancesamplingmodelsenablesextremelyflexiblemodelingofspatiallyor temporallyreplicateddistancesamplingdataorcombinedanalysesofdatasetscollectedunder differingprotocols(“integratedmodels”),whichwasthoughtimpossiblebeforeoratleastwasnever achieved.Forinstance,itisperfectlydoable(oreventrivial)tomodelpopulationdynamics(Sollmann etal.,2015)orcommunitysizeandcomposition(Sollmannetal.,inpress)fromdistancesampling datawithinthecontextofhierarchicalmodels.And,thepowerofBUGSnowadaysmakesthe implementationofsuchmodelspossibleevenforecologists,sincereallysuchmodelsdifferinonly relativelyminorwaysfromsimilarmodelsforotherdatatypes(e.g.,ofthecapture-recapturetype).

Hence,wehopethatwecontributetochangeyourviewof“capture-recapture”and“distance sampling”asbeingtwowidelyseparatedfieldstoanewwayofseeingthemasreallyrelativelyminor variationsontheoverarchingthemeofhierarchicalmodels,whichhaveonemodelcomponentfor abundance,ordensity,andinanothermodelcomponentdescribethemeasurementerrorthatinduces imperfectdetectionandthereforeundercounting(Borchersetal.,2015).Theonlythingthatchanges whenyoumovefromacapture-recapturetoadistancesamplingmodelisthespecificparameterization ofthemeasurementerrorunderlyingtheobserveddataandofcoursethetypeofdatathatyouneedto estimatetheparametersofthatmeasurementerrormodel.Thiswonderful,unifyingpowerof describingstatisticalmodelsinahierarchicalwayletsyoumuchbettergraspthesimilaritiesamong largenumbersofmodelsthatwereoftenthoughtastotallydistincthitherto.Itisoneofthemain themesofthisbookandoneonwhichwewillsaymuchmorethroughoutthebook.Forinstance,we hopethatyouwillrecognizethattherearereallyonlyquiteminordifferencesbetweenabinomial mixturemodelforcountsofunmarkedindividuals,amultinomialmixturemodelforcapture-recapture data,andahierarchicaldistancesamplingmodel theonlydifferenceisagainthemeasurementerror model,whilethestatemodel,thatis,thedescriptionoftheessentialbiologicalquantity(abundanceor density),isexactlythesameinallthreetypesofmodels.

Thepenultimatemonograph(Chapter10)isonoccupancymodeling(MacKenzieetal.,2002;Tyre etal.,2003).Thispowerfultypeofmodelforoccurrenceordistributioncomeswithanexplicit measurementerrorcomponentmodelforbothfalse-negativesandfalse-positives(modelsbyRoyle andLink,2006;Aingetal.,2011;Milleretal.,2011,2013b;Sutherlandetal.,2013;Chambertetal.,

2015)orwithameasurementerrormodelforfalsenegativesonly(allothertypesofoccupancy models).Occupancymodelshavebecomehugeinecologyandhaveexperiencedasteepgrowthcurve inboththenumberofpapersthatfurtherdevelopthetheoryofthesemodelsandespeciallyalsoin studiesthatapplythisdesignandtheassociatedmodels.(Wehaveevenheardrumorsthatthevigorous growthofthefieldhas“scared”someecologyjournaleditorssothattheyputacaponthenumberof occupancypaperstheyaccept astrangewayofstiflingprogressonewouldthink.)Occupancy modelshavereceivedonebook-lengthtreatisesofar(MacKenzieetal.,2006),withasecondedition thatisinpreparation,andseveralcustomizedsoftwareproductsthatspecializeinthem,especially PRESENCE(Hines,2006)andMARK(WhiteandBurnham,1999;CoochandWhite,2014).Inthis first AHM volume,wedealwithsingle-speciesoccupancymodelsingreatdetailandcoversometopics (e.g.,somemodelsfordatacollectedalongspaceortime“transects”)thathaven’tbeencoveredinany bookbefore.Involume2,wewilladdseveralmoremonographsonalargevarietyofoccupancymodel types;seebelow.

Thefinalmonographinvolume1coverscommunitymodels,thatis,communityormultispecies variantsofallthepreviousmodels.Specifically,wecoverthecommunityvariantofanoccupancy model(Chapter10)andthecommunityvariantofabinomial N-mixturemodel(Chapter6).These powerfulhierarchicalmodelsenableinferencesatmultiplescales,thatoftheindividualspecies,thatof alocalcommunity,andthatofanentiremetacommunity.Asalwaysinthisbook,bothcomewithan explicitmeasurementerrormodelforthedesiredstateofinference,presence/absence,orabundanceof eachindividualspeciesateverysiteinthe“meta-population.”Thesemodelshaveexperiencedmuch increasedattentionintheveryrecentpast(Iknayanetal.,2014;Yamauraetal.,2012,inpress),andwe provideamuchneeded,comprehensiveandyetsupremelypracticalmonographonboththeabundance andontheoccupancy-basedcommunitymodels.

Ofcourse,apartfromservingasastandaloneintroductiontothislargerangeofpowerfulanduseful hierarchicalmodels,thematerialinvolume1alsolaysthegroundworkformoremodelsandmore advancedmaterialinvolume2.Seebelowformoreaboutthedivisionofcontentbetweenthetwo volumes.

UNIFYINGTHEMES

AHM isnotjustahodgepodgeofmodelsthathavenotpreviouslybeencoveredindetailoratall. Rather,ourdevelopmentandorganizationofthesemodelshasanumberofunifyingthemesthatwe emphasizethroughoutthebook:

•hierarchicalmodeling

•datasimulation

•measurementerrormodels

•dualinferenceparadigmapproach(Bayesianismandfrequentism)

•accessibleandgentlestyle(includinghierarchicallikelihoodconstructionanddatasimulation)

•“cookbookrecipes”

•predictions

One,weadvocate hierarchicalmodeling asaunifyingconceptandoverarchingprinciplein modelingandalsoconceptually;aswehaveemphasizedbefore,whenseenasHMsallthesemodels almostlookthesame(orverysimilar)anditisquitetrivialtomovefromonetoanother,e.g.,froma capture-recapturemodeltoadistancesamplingmodeltoanoccupancymodeloreventoacommunity

ormetacommunitymodel.Wededicateanentirechaptertointroduceandexplainthecrucialconcept ofHMs,whichpermeateseverysectionofthisbook.

Two,weuse datasimulation throughoutthebook,becausethisissotremendouslyimportantin practice,forstatisticians,butmuchmoresostillforecologists.Thisisdoneinhardlyanyotherbook weknowof,exceptfortwoofourearlierbooks(Ke ´ ry,2010;Ke ´ ryandSchaub,2012).Thoughquite frequentlydonebystatisticiansandalsobyecologistsinmanydifferentmodes,webelievethatdata simulationshouldbedone much morewidelystill.Wededicateanentirechaptertodatasimulation (Chapter4)andthereinexplainthemajoradvantagesforyouwhenyoustartdoingthisroutinelyfor yourwork.Amongthem,perhapsthetwomostimportantbenefitsofdatasimulationare,first,thatit enforcesonyouacompleteunderstandingofyourmodel.Ifyoudon’tunderstandyourmodel,youwill notbeabletowriteRcodetosimulatedataunderthatmodel it’sassimpleasthat.Wewouldevengo asfarassayingthatadatasimulationalgorithmprovidesacompletedescriptionofastatisticalmodel. Indeed,throughoutthebookweusedatasimulationinRinacompletelynovelfashion toexplaina statisticalmodel!

Thesecondmajorbenefitofdatasimulationisthatitservesanimportantroletovalidatebothyour MCMCalgorithm(whetherwrittenbyyourselforproducedbyanMCMCblackboxsuchasBUGS) andtovalidateyourmodelcode.FormostmodelclassesinthebookweprovideRfunctionsto simulatedataundervarioustypesofmodels.Wehopethatthesewillbewidelyusedinthemany differentmodesofdatasimulation(asperChapter4).orperhapssometimessimplytomarvelatthe prettyandhighlyvariablegraphicaloutputtheyproduce.

Three,onedefiningfeatureofallmainclassesofmodelsinourbookisthepresenceofasubmodel thatcontainsanexplicitdescriptionofthe measurementerror processunderlyingalldataonthe distributionandabundanceofindividualspeciesandevenmoreperhapswhenyoustudytheminentire communitiesormetacommunities.Unlikethetypesofmeasurementerrorforcontinuousvariables (suchasbodylength)towhichyoumayhavebeenexposed,themeasurementerrorfordiscrete measurements(e.g.,countsandpresence/absencemeasurements)isofaradicallydifferentnatureand comesinexactlytwotypes:false-positiveandfalse-negativemeasurementerror,withthecomplement ofthelattertypicallybeingcalleddetectionorencounterprobability,ordetectabilityforshort.These areverydifferenttypesofmeasurementerror,whichyoucannotexpecttocanceloutinthemeanover severalmeasurements.Hence,unlessyouaccountfortheminyourmodelsfordistribution,abundance, andspeciesrichness,badlybiasedinferencesmayresult.Our AHM bookisan“estimationistbook”in linewitharapidlyincreasingnumberofpreviousworksthatemphasizethemeasurementerrorprocessesinecologicalmodelsfordistributionandabundanceinecology,suchasOtisetal.(1978),Seber (1982),Bucklandetal.(2001),Borchersetal.(2002),Williamsetal.(2002),Bucklandetal.(2004a), Amstrupetal.(2005),MacKenzieetal.(2006),RoyleandDorazio(2008),Kingetal.(2009),Ke ´ ry andSchaub(2012),McCreaandMorgan(2014),andRoyleetal.(2014).

Four,weareneitherpurebredBayesiansnorhardcorefrequentists,rather,wearebigfansofa dual inferenceparadigmapproach,i.e.,theuseofBayesianism and frequentismalongside,asitseems especiallyusefulfortheparticularcase.Whileperhapsbothofushaveaslightpersonalslanttoward Bayesianism,thereareadvantagesanddisadvantagesofbothBayesianismandfrequentism,andthese maycomeintoplaymoreorlessforanygivendatasetorscientificquestion(Little,2006;deValpine, 2009,2011).Inaddition,thechoiceofwhetheraBayesianorafrequentistanalysisismostappropriate willalsobeaffectedbytheavailabilityofawell-trainedanalystand/orafastcomputer,withBayesian solutionsoftenrequiringmorestatisticalandprogrammingexperienceandfastercomputers.Thus,we

arefirmbelieversinthevalueofadualinferenceparadigmapproach,andthisisapervasivethemeof ourbookaswell.Thedualinferenceparadigmapproachappearsinallbutonechaptersofthisbook. Thisapproachhasbeendonealittlebitinsomepreviousbooks(especiallyinRoyleandDorazio, 2008)butnevertoourknowledgeinsuchacompletelyintegratedwayasinthisbook.Everytopical chapterinPart2coversaclassofmodelsusingbothinferenceparadigmsandemphasizesthingsthat areeasierorhardertodoonewayortheother(theexceptionbeingChapter11,whereitisveryhardto doanon-Bayesiananalysisoftheseparameter-richmodels).

Five,wehavestriventomakethisbook gentleandaccessibleinstyleandeasytoread.This meansthatwedoofcoursepresentformulaeande quations,butperhapsfewerthaninmanyother comparablestatisticsbooks.Manyecologistscannotreadevenmoderatelycomplexlikelihood expressions.Thisisperhapsnotagoodstateofaffairs,butitisasimplefactoflifethatisunlikelyto changeanytimesoon.Webelievethatthehierarchi calconstructionofthelikelihood,asaseriesof conditionalprobabilitystatementsasineverytopicalchapterinthisbook(andaswenaturallydo whenspecifyingthesemodelsintheBUGSlanguage),isperhapsthe only wayinwhichafairlylarge proportionofecologistshaveanychanceofbeingabletoreadandunderstandthelikelihoodofa somewhatcomplexmodel.Inadditiontoalgebra, weuseespeciallydatasimulation(andhenceR code)todescribeourmodelsthroughoutthebook.WefindthatRcodefordatasimulationisan extremelyclearandtransparent wayofimplicitlydescribingthelik elihoodofamodel.Thisseemsto beacompletelynovelideathathasneverbeenexpressedexplicitlybefore.

Six,weillustrateanalysesofeachclassofmodelsusingacompletesetofstepsthatyouwoulduse inyourwork(“cookbookrecipes”).Thisincludesnotjustfittingthemodelsbutproducingsummary analysessuchasresponsecurvesandprediction,andespeciallyillustratingmapsofabundanceand occurrence,andalsoassessingthegoodness-of-fitofmodels.Webelievethatprovidingcookbook recipesisfrowneduponbymanystatisticiansbecausethereisafeelingthatthisencouragespeopleto dothingsthattheydon’tunderstand.Weareconvincedthatthissentimentismostlyunfounded.First, andmostimportantly,foranybutanextremelytrivialanalysis,thepractitionerwillstillhavetounderstandthemodelandtheanalysisinordertonotmakeanyofamyriadoftrivialerrorsthatwillmake theBUGSprogramcrash.Second,withoutatleastsomeunderstanding,hewillprobablynotbeableto describetheresultsinanintelligiblewayintheresultssectionofhispaperortoexplainthemtoher supervisor,advisor,orcolleague.Ontheotherhand,evensomeofthemostbasicofstatisticalanalyses,namelylinearmodelswithfactorlevels,areextremelywidelymisunderstood,i.e.,peopledon’t understandwhattheinterceptmeansandwhatthetreatmentcontrastparametersare.Hence,some abuseistobeexpectedwith any kindofstatisticalmodelforwhicheasy-to-usecodeismadewidely available.Inaddition,incomplexmodelsinthisandsimilarbooks,sometimesevenverybasicsteps suchasformattingthedataintoathree-orfour-dimensionalarraycanbeacompletestumblingblock toanRnovice,eventhoughhemayhaveadecentconceptualgraspofamodel.Inthiscase,the availabilityofcookbookanalysiscodeisessential.Finally,itistheexperienceofatleastoneofthe authorsthatonlyfittingamodelandlookingattheestimatesmaysometimesreallyletoneunderstand whattheseparametersmean.Ofcourse,thislattereffectmaybemagnifiedstillwhenyoufitthemodel tosimulateddata,whereyouknowwhatyouinputintoyourdatasetandthereforewhatballpark estimatesyoucanexpect.Insummary,webelievethatitisnoteviltohandoutcookbookrecipesbut ratherthatthey ought tobegivenmuchmorewidely,andwedoexactlythisthroughoutourbook.

Seven,andfinally,oneoftheexamplesofusgivingamplecoderecipesisfor prediction,i.e.,for thecomputationoftheexpectedvalueofsomequan tity(e.g.,theresponseorsomeparameter)fora

rangeofvaluesforoneormorecovariates.Formingsuchpredictionsisextremelyimportantforyou intwoways:toevenunderstandwhatthemodelistellingyouabouttheformofsomecovariate relationshipwhenyouhavelog,logistic,orsimilar linkfunctions,polynomialterms,orinteractions; andsecondtopresenttheresultsofyouranalysis,e.g.,inafigureinyourpaper.Weemphasize predictionthroughoutthebook,especiallypredictionsingeographicspace,leadingtomapsof speciesabundanceandoccurrence(theassociatedmodelsarethencalled“speciesdistribution models”);thisisaveryhottopicnowadays.Theformingofpredictions,andhowtoputthese predictionsonamap,isthefocusofeverysinglemonographinthesecondpartofthebookandalso appearsextensivelyinthepreludechapters.

Althoughthisbookisespeciallygearedtoward ecologists,itpresentsthecuttingedgeofthe currentstateandunderstandingofallofthemodelspresented.Atseveralplaces,wewerenotshyto layopenourpartiallackofunderstandingabouts ometopics,inthehopetoemphasizetheneedfor furtherresearch;thisincludesgoodness-of-fitinthesemodels(andprobablyinmanyotherclassesof hierarchicalmodelsingeneral),thegoodfitversusbadpredictiondilemmawithsomenegative binomial N-mixturemodelsinChapter6,ortheuseofspatialinsteadoftemporalreplicationfor obtaininginformationaboutmeasurementerrorin occupancymodelsinChapter10.Clearly,ouraim inwritingthisbookisnottoshowoffhowmuchweknowbuttohelpyoutolearnthesemodelsto understandandapplythem.Thisi ncludesarecognitionofwheretheirlimitsorthegenerallimitsof ourunderstandingaboutthemareandwhereyoucouldthereforemakeacontributiontotheprogress inthisfield.

THE unmarked PACKAGE

Somebodyoncesaidthathe(orshe)didnottrustanyRpackageunlessithasabookwrittenaboutit. SonowyoucanfinallytrusttheRpackage unmarked (FiskeandChandler,2011)becausethisisalsoa bookabout unmarked.The unmarked packageisfullygeneral,andaspartoftheRprogramming environment,itallowsyoutoembedyouranalysesseamlesslyintoyourRprogramming.Thisisa greathelpwhenrunningsimulations,fordataprocessingandformatting,runninganalysesinbatch mode(e.g.,loopingovermanyspecies,years,sites),documentingyourdataprocessingandanalysis steps,andwhenanalyzingresultstoproduceplots,summaryanalyses,fitassessments,andmodel selection.

The unmarked packagepermitsyoutofitalargevarietyofclosedandopenhierarchicalmodelsand, tothebestofourknowledge,itistheonlypackageforlikelihoodestimationof(almost)allclassesof modelswecoverinthisbook,althoughPRESENCE(Hines,2006),MARK(WhiteandBurnham, 1999;CoochandWhite,2014),andE-SURGE(Choquetetal.,2009b;Gimenezetal.,2014)fitoccupancymodels,andtheformertwoalsoRoyle-Nicholsandbinomial N-mixturemodels.Oneofthe benefitsofusing unmarked foranalyzingthesevarioushierarchicalmodelsisthatitstreamlinesand standardizestheworkflowacrossmodels.Ananalysisofanyclassofhierarchicalmodelin unmarked hasafewbasicsteps,whichinclude:(1)processingandpackagingthedataintoan“unmarked frame” usingstandardconstructorfunctionsthatensuredataareintheproperformat;(2)utilizationofa standardmodelfittingfunctionthatproducesparameterestimates,standarderrors,AIC,andother summarystatistics;(3)summaryanalysesthatincludeproducingmodelselectiontables,goodness-offitanalyses(e.g.,usingparametricbootstrapping),andplottingpredictionsorfittedvalues.Eachof thesesummaryanalysesissupportedbystandardfunctionsthatarepartofthe unmarked package.

The unmarked packageissupportedbyanactiveandmostofthetimeveryfriendlye-mailuser group(groups.google.com/forum/#!forum/unmarked),whichyoucansubscribetoforfollowing developmentsandbugreports,orforrequestingassistance.Finally, unmarked isanopensource softwaredevelopmentproject.Thesourcecodeisreadilyavailableandcanbeeasilymodifiedand extendedbyanyone.Weencourageyoutoparticipateinthe unmarked community.

COMPUTING1

Inasensethisisabookaboutecologicalcomputing.Whileweemphasizetheformulationandanalysis ofmodels,avastmajorityoftheefforttodosorequiresprogrammingintheRlanguageandrunning variousfunctionsin unmarked andinWinBUGSorJAGS.ForBayesiananalysisweadoptthe implementationsoftheBUGSlanguageusingWinBUGSandJAGS(andcouldequallywellhaveused OpenBUGSorNIMBLE).TheseareusedalmostequivalentlywiththehelpoftheRpackages R2WinBUGS and jagsUI,andthereareonlyaverysmallnumberofminordifferencesbetweentheJAGS andWinBUGSimplementationsoftheBUGSlanguage(seetheJAGSmanual,availableonthe Internet,andLunnetal.,2013).

Interestingly,theuseofBUGSisoftenfrowneduponbystatisticiansassomekindofinferior approachtothings,ascomparedtowritingyourownMCMCalgorithm,andrelianceonBUGSis readilycriticizedinreviewsofpapersandconferencepresentations(especiallythosethatarewidely attendedbystatisticians).Theacademicstatistician’sviewisoftenthatyoushouldbewritingyour ownMCMCbecausethenyouunderstandwhat’sgoingonunderthehood.Wedisagreewiththisview. Now,andwethinkeven20yearsintothefuture,thevastmajorityofecologistswillnotbeableto writetheirownMCMCnorevenwillmostecologistswanttodothat.Indeed,manystatisticianscan’t dothateither.Ontheotherhand,BUGSmakesaccessibletoecologiststheextremelyconvenientand usefultechniqueofMCMCandconsequentlytheabilitytodescribemodelsandanalyzethemwithout havingtohaveaPhDstatisticianhelpingthemout.Wethereforestronglyadvocatefortheuseofthe BUGSlanguageinwhateverimplementationisconvenient(WinBUGS,JAGS,OpenBUGS, NIMBLE,orsomefutureimplementation).Tobesure,customMCMCalgorithmsmaybe much more efficientforanyparticularmodelorapplication.However,thetimetoproducecustomalgorithms reallyrendersthatapproachimpracticalformostsituationsandformostpeople.Moreover,perhaps thegreatestthingabouttheBUGSprogramsistheBUGSmodeldefinitionlanguage.Thishasproved tobesupremelyeasytounderstandforstatisticiansandnonstatisticiansalikeintheirattemptsto formulate,withconfidence,evenverycomplexstatisticalandsimulationmodels.Therefore,wefeel thattheBUGS language isheretostay.Theremaybesomeinefficiencytothecurrentimplementations,butwho’stosaythatamoreefficientimplementationwon’tbeinventedinthefuture? And,ofcoursecomputingpowerisalwaysimprovingandwillcontinuetodoso.Inparticular, computerswillcertainlyhavemanymorecores,andthereforemulticoreprocessingwillimprovethe runtimeofmanymodels.

AstothediffusefearsofsomewhenusingacomputationalMCMCblackboxsuchasBUGS, wehavearguedbeforethatdatasimulationhasanimportantroletoplayinmodernecological modeling.Analyzingsimulateddatacangiveyoumuchconfidenceaboutthegoodorbadbehavior ofacomputationalprocedure ofcoursenotforeverysingleparticularcase(butyoucan’thave

1UseofproductnamesdoesnotimplyendorsementbytheUSgovernment.

thisanyway,e.g.,yourlikelihoodmaximizationalgorithmmayalwaysgetstuckatalocal maximumoralongsomeflatridge),butonaverage ,andthatiswhatreallycounts.Forinstance, overtheyearswehaveusedBUGStofitmodelstolite rallymanythousandsofsimulateddatasets forthetypesofmodelspresentedinthisbook.Andwehaveonlyexceedinglyrarelyexperienced caseswherethealgorithmconvergedtoaplacein parameterspacethatwasnotclosetoorrightat thecorrectvalue,i.e.,thevalueusedtosimulatethedataset.Thus,wearenotatallmadenervous bytheoccasionalclaimsheardabouthowterriblyd ifficultitistoachievechainconvergenceinan MCMCanalysis.

ORGANIZATION

Whenwestarted AHM wedidnotthinkofitascomprisingtwovolumes.Butthenwerealizedthe wealthofmaterialwehadatourhands,andsonow AHM comesintwovolumes.Asplannednow,there are25chaptersthataregroupedinfourparts,withtwopartspervolume(see Table1).Asalready explained,thesplitofthewhole AHM projectintotwovolumeshasintroductorymaterialincluding basicconceptsofstatisticalmodelingandinferenceanddatasimulation(PartI)andthensingle-and multispeciesmodelsofabundanceandoccurrenceinstaticsystems(PartII)involume1(withthe slightexceptionmentionedfordistancesamplinginChapter9).Volume2ofthebookwillfocuson dynamicandspatialmodelsandother“advanced”topics.

WHOSHOULDREADTHISBOOK?

Thisbookhastwotargetaudiences:first,ecologistsandscientistsandmanagersinrelateddisciplines, wherethedemographicanalysisofpopulations,meta-populations,communities,andmetacommunities isafocusofinterest.Andsecond,statisticians,especiallythosehithertounacquaintedwiththeseclasses ofHMs,whicharehardlyevertaughtinstandardmethodologyclassesorintypicalclassicalapplied statisticstexts.Fortheformergroup,thebookrepresentsapracticalhow-toguideforeachclassof modelsandthusshouldbeaccessibletoanyonewithbasicRprogrammingknowledge.UseoftheBUGS languageisneededalso,butwehopeyoucangathertherequisiteskillsbyreadingtheearlierchaptersof thebook(3–5)orelseyoumayconsultanintroductoryBUGSbooksuchasMcCarthy(2007),Ke ´ ry (2010),Lunnetal.(2013),orKorner-Nievergeltetal.(2015).BecauseRprogrammingisthestandard nowinmanyuniversitycurricula,wethinkthebookshouldbeidealforagraduatelevelclasson quantitativemethods,eitherasacompletesemesterlongcourseorpartofacoursecoveringspecific modelssuchashierarchicalmodelingofabundanceusing N-mixturemodels,onoccupancymodels,and onhierarchicaldistancesampling.

BOOKWEBSITEANDUSERGROUPE-MAILLIST

Foreveryanalysisinthebookweprovidethecompleteinstructionsfororganizingthedata,fitting themodel,andsummarizingther esults.Mostofthecommandsaregivendirectlyinthebook, althoughourcompanionWebsite( http://www.mbr-pwrc.usgs.gov/pubanalysis/keryroylebook/ )also providesthescriptsforreadydownload.Inaddition,youfindother informationthere,notablythe solutiontoexercises,alistoferrataaswefindthem(or,morelikely,youdetectandreportthem tous),etc.

Table1Outlineofvolume1andvolume2oftheBook AppliedHierarchicalModelinginEcology (AHM).

AHM volume1:Preludeandstaticmodels

Preface

Part1:Prelude

01.Distribution,abundance,andspeciesrichnessinecology

02.Whatarehierarchicalmodelsandhowdoweanalyzethem?

03.Linearmodels,generalizedlinearmodels(GLMs),andrandomeffects:thecomponentsofhierarchicalmodels

04.Introductiontodatasimulation

05.TheBayesianmodelingsoftwareBUGSandJAGS

Part2:Modelsforstaticsystems

6.Modelingabundanceusingbinomial N-mixturemodels

7.Modelingabundanceusingmultinomial N-mixturemodels

8.Modelingabundanceusinghierarchicaldistancesampling

9.Advancedhierarchicaldistancesampling

10.Modelingdistributionandoccurrenceusingsite-occupancymodels

11.Communitymodels

AHM volume2:Dynamicandadvancedmodels

Part3:Modelsfordynamicsystems

12.ModelingpopulationdynamicswithPoissongeneralizedlinearmixedmodels(GLMMs)andsomeextensions

13.Modelingpopulationdynamicswithreplicatecountswithinaseason

14.Modelingpopulationdynamicswithdistancesamplingdata

15.Hierarchicalmodelsofsurvival

16.Modelingspeciesdistributionandrangedynamicsusingdynamicoccupancymodels

17.Modelingmetacommunitydynamicsusingdynamiccommunitymodels

Part4:Advancedmodels

18.Multistateoccupancymodels

19.Modelingfalse-positives

20.Modelsforspeciesinteractions

21.SpatialmodelsI

22.SpatialmodelsII

23.Combinationapproaches/Integratedmodels

24.Spatialdistancesamplingandspatialcapture-recapture

25.Conclusions

The AHM book(orindeedourlarger“hierarchicalmodelingenterprise”)hasanassociatede-mail usergroup(http://groups.google.com/forum/?hl¼en#!forum/hmecology),whichyoucansubscribeto forfollowingdevelopmentsandbugreports,orforrequestingassistance.Thereissomeoverlapwith the unmarked e-mailusergroup,butthehierarchicalmodelingusergroupismoregeneraland,in particular,istheonlyonespecificallyforquestionsaboutBUGSsoftwareinecologicalmodeling.We wouldagainencourageyoutobecomeanactivememberofthatcommunity.

Acknowledgments

WewouldliketothankJamesD.Nichols(USGSPatuxentWildlifeResearchCenter,Laurel,MD)for teachingusto“thinkhierarchically”inecologyandforemphasizingsoforcefullytheneedforaccommodatinginourecologicalmodelstheever-presentmeasurementerrors,especiallydetectionprobability,whichinecologicalstudiesafflictstheassessmentofdemographicquantitiessuchas distributionandabundance.Jim’ssharpbrain,hisnever-flaggingenthusiasm,hisinterestinotherpeople’sprojects,hiswillingnesstohelp,andatthesametimehislegendarymodesty,havebeenahuge influenceforusboth.Wewouldliketodedicatethisbooktoyou,Jim thankyousomuch!

Then,weowesuper-specialthankstoIanFiskeandRichardChandlerforcreatingthe unmarked package,whichalongwithBUGSisthemainsoftwarethatweuseinthisbook.Haditnotbeen forhisnewpositionattheUniversityofGeorgia/Athens,Richardwouldhavebeenacoauthorof thisbook.Now,weareverygratefulthathewrotetheforewordandthusisstillassociatedwiththe bookproject.KenKellnercreatedthe jagsUI package,whichisourfavoriteR/JAGSinterface. Manytimes,Kenhasbeenincrediblyquickatreplyingtoourqueriesaboutthingsthatwereproblems tousorthingsthatwethoughtwouldbenicetoaddto jagsUI, andweareextremelygratefulforKen’s time.MarcMazerolle’s AICcmodavg packagehasgrowntobeextremelyusefulformanytypesof models,anditcontainsalargesuiteoffunctionsspecificallyformodelsfitwith unmarked.Marc hasbeenparticularlyhelpfulaswellinansweringourqueriesandaddingfunctionalitytothepackage asneedswereperceived.

Next,wewouldliketowarmlythankthedevelopersofWinBUGS(Gilksetal.,1994;Lunnetal., 2000,2009,2013)forinventingthewonderfulBUGSlanguageandalsotothankthemandthedevelopersofOpenBUGS(Thomasetal.,2006)andJAGS(Plummer,2003)forgivingtheseunbelievably powerfulanduser-friendlyprogramstotheworld.Youhavechangedour(scientific)lives!TheBUGS modeldefinitionlanguageandthethreeBUGSengines(orfour,withNIMBLE)havebeenrevolutionizingthewayinwhichespeciallynonstatisticianscanfitcomplexandcustomizedmodelstotheir complicateddata.WethinkthattheserviceoftheBUGSdevelopersandmaintainerstoecology, andmanysciencesbeyond,canhardlybeexaggerated.

Manypeoplehavereviewedpartsofthebook,sometimesunderextremetimeconstraints,andwe areextremelygratefultothem,including(inalphabeticalorder)CourtneyAmundson,EvanCooch, TaraCrewe,NathanCrum,FranciscoDe ´ nes,EmilyDennis,GurutzetaGuillera-Arroita,Jose Lahoz-Monfort,AbbyLawson,DanLinden,MikeMeredith(wealwaysappreciateyouropenness, Mike),DanaJanineMorin,DanielleRappaport,BenediktSchmidt,RahelSollmann,NicolasStrebel, ChrisSutherland,andYuichiYamaura.SeveralpeoplehavebeengenerouslysharingdataorRor BUGScode,includingCourtneyAmundson(codeinChapter9),ScottSillett(ISSJdata,graphics, photos),WolfTheunissenfromtheDutchCentreforFieldOrnithologySovon(Dutchwagtaildata inChapter9),andRahelSollmann(materialofChapter9relatedtoopenHDSmodels).Wealsothank allthephotographerswhoofferedustheirgreatphotos,sometimesforfree,toillustratethefascinating animalsbehindthenumbersthatwecrunch.AwarmthanksgoestoBertOrrforallowingustousehis wonderfuldragonflyartonthecoversofthetwovolumesof AHM

WeoweaspecialthankyoutoourcolleagueHansSchmid,whoisthefatherandmanagerofthe SwissbreedingbirdsurveyMHB(MonitoringHa ¨ ufigeBrutvo ¨ gel),andtothehundredsofvolunteers whoannuallysurveythe2671-km2 quadratsinalargelymountainousSwitzerland.Inmanyrespects, xxiii

theMHBisanexemplarybiologicalsurvey.Weareprivilegedtohavereadyaccesstothehigh-quality dataproducedbyit,andwehavemadeampleuseofitsbeautifuldata;seetheanalysesinChapters6, 7,10,and11.And,haditnotbeenfortheMHBandthefirstpapersthatMKandJARwrotetogether backin2005,perhapsthisbookwouldneverhavebeenwrittenatall.

OtherpeoplewhohavecontributedtothebookinvariouswaysincludeJe ´ ro ˆ meGue ´ lat,Guido Hafliger,FranziKornerNievergelt,MichaelSchaub,BenediktSchmidt,RichardSchuster,andNicolas Strebel.

Finally,herearesomespecialthanksfromthetwoofus.

MK:MostofallIthankmycoauthorAndyforbeingmycolleagueandfriend.Thepublicationof thisbookmarksalittlemorethanthe10thanniversaryofwhatisthemostimportantandproductive collaborationinmyprofessionallife.ItwouldbehardtoexaggerateAndy’sroleinmydevelopmentas aquantitativeecologist.Ihavealwaysbeenastonishedbyyourgenerositytocontributeyourbrainsand yourpowerasastatisticalmodelertomyprojects.Itisatremendoushonorandahugepleasureforme tocoauthorthisbookwithyou,Andy.Thankyouverymuch!Next,Iwouldliketothankmy employers,theSwissOrnithologicalInstituteandespeciallymyformerbossNiklausZbinden (nowretired),forgrantingmethemuch-appreciatedacademicfreedominmyresearch,whichis requiredforconductingabigbookproject.Andlastly,butespeciallyimportantly,Iamindebtedto myfamily,SusanaandGabriel,fortoleratingsomuchinvestmentofmytimeandenergyinthis project,whichsometimesappearedtobegrowingoverourheads.

JAR:IextendequallyeffusiveandheartfeltthanksandgratitudetomyfriendandcolleagueMarc Ke ´ ry.Withoutyourpersistenceinpushingforwardourcollaboration10yearsago,noneofthiswould havehappened.Ioweyousomuch,myfriend!IwouldalsoliketothankthePatuxentcommunity,my colleagues,andpastandpresentpostdoctoralresearcherswithwhomI’vehadthepleasuretowork. Nothingismoresatisfyinginsciencethanpushingforwardnewideaswithenthusiasticyoung researcherswhoareatthestartoftheircareers.

MKandJAR,Lima/PeruandLaurel/MD July21,2015

CHAPTEROUTLINE

1.5HierarchicalModelsforDistribution,Abundance,andSpeciesRichness...........................................16

1.1 POINTPROCESSES,DISTRIBUTION,ABUNDANCE,ANDSPECIES RICHNESS

Distributionandabundancearethetwofundamentalstatevariablesinecology(Begonetal.,1986; Krebs,2009)andspeciesrichnessisthemostwidelyusedmeasureforbiodversity(PurvisandHector, 2000;Balmfordetal.,2003).Allthreearethefocusofapreponderanceofboththeoreticalecological studiesandespeciallyofstudiesfocusedonspecificmanagementorconservationproblemsinvolving rareorendangeredspecies,gameanimals,andinvasivespecies.Interestingly,though,allthreeareonly derivedquantities,i.e.,summariesofamorefundamentalquantity: pointpatterns.Pointpatternsare theoutcomeofstochasticprocessesknownaspointprocesses,and,notsurprisingly,statisticalmodels describingthemarecalledpointprocessmodels(PPMs;Illianetal.,2008;WiegandandMoloney, 2014).PPMstreatboththenumber and thelocationsofdiscretepointsasrandomquantitiesgoverned byanunderlying,continuousintensityfield.Theintensityistheexpectednumberofpoints(e.g., animalsorplants)perunitareainsomestudyareaandisthemodeledparameter.

Bothdistributionandabundancearesimplearealsummariesofspatialpointpatternsforasingle animalorplantspecies,thatis,aggregationsofapointpatternoversomearea.Todevelopabasic understandingoftherelationshipsbetweenapointpatternandabundanceandoccurrence,wejump rightinandrunourfirstsimpledatasimulationinprogramR.Thus,consistentwithhowweoften approachtheunderstandingofanewmodelintherestofthisbook, wehereusesimulationtoexplain andtounderstand amodel,suchasaPPM.Function sim.fn letsyouexperimentwiththerelationship betweenapointpatternandabundanceandoccurrenceasafunctionoftheintensityofthepattern (whichissomethingthatyoucannotcontrolandistheresultofthebiologyyou’reinterestedin)andof thegridsize,ormorespecifically,thesizeofthecellsmakingupthatgrid;thisissomethingthatyou CHAPTER

AppliedHierarchicalModelinginEcology. http://dx.doi.org/10.1016/B978-0-12-801378-6.00001-1 Copyright © 2016ElsevierInc.Allrightsreserved.

can control orsomebodyelsehasdoneitforyou(forinstance,thepeoplewhodesignedthe monitoringprogramthatproducesthedatayouareanalyzing).Thedefaultsettingsofthefunctionare: sim.fn(quad.size=10,cell.size=1,intensity=1)

Thefunctionsimulatesanimalorplantlocationsinagridofcellsformingaquadratwithtotal length(inarbitraryunits)equalto quad.size,accordingtoaPoissonprocesswhereindividualsare randomlydistributedinspace.Thisprocessischaracterizedbyaconstant intensity,whichisthe averagenumberofanimalsorplants(“points”)perunitarea.Theresultingpointpatternisthen discretizedbyoverlayingagridwithquadraticcellsoflength cell.size.Itisonlythisdiscretization ofspacethatletsonedefineabundanceinthefirstplaceandthenpresence/absence,oroccurrence,ina secondstep.Speciesrichness,thethirdcrucialquantityinthetitleofthischapter,isthesumofthe speciesoccurringatasite,hence,asummaryofthepointpatternsnotforasinglespeciesbutforall species(orforsomesetofspecies)thatoccuratasite.

Asusualforthedatasimulationfunctionsinthisbook,executionofthefunctionproducesboth numericaloutput(datathatyoucansaveanddothingswithafter)andinformativeplotsthatvisualize thesimulatedprocessandtheresultingdataset(Figure1.1).Wewillusemanysuchfunctionsinthis book;alsonotethatwehaveawholechapteronthesimulationofdatainR(Chapter4).

Toappreciatetherandomnessinherentinthestochasticprocessdefinedbythisfunction,we encourageyoutocallthefunctionrepeatedlywithoutrandomnumberseeds,orwithdifferentseeds, andwithchangedfunctionarguments.Thereisnothinglikedatasimulationtohelpyourealizewhat stochasticityreallymeans thatlackofexactreproducibilityofaprocess,whichcanthereforeonlybe predictedinsomeaveragesense.Therefore,weurgeyoutoplay!Playwiththisdatasimulation functionandalsowithallotherdatasimulationfunctionsinthisbook.Youwillseethatthisbookgives youmuchtoplaywith.“Toplay”meansthatyouvarythefunctionargumentsandobservethechanges intheoutputfromtheprocessrepresentedbythedatasimulationfunction.Weareconvincedthatthis canbeahugehelpforyourunderstandingoftheprocessrepresentedbythefunction.Inaddition,our hierarchicalmodelsdirectlyrepresenttheprocessesunderlyingtheobserveddata,hence,ifyouunderstandthedatasimulationprocessthatservesto assemble adataset,youwillalsounderstandthe modelthatservesto disassemble thedatasetintheanalysis,wheredisassemblymeansto“breakthe dataapart”intocoefficientsofcovariates,randomeffectsvariancesetc.(Ke ´ ry,2010).

Fornow,weexecutethefunctiononce,withaspecificrandomnumberseed,soyougetthesame resultsaswedo.Afterwards,youcando str(tmp) toseetheobjectscreatedbythefunctionandsaved intheobject tmp,butwesimplyfocusonthegraphicaloutputfornow.Thisisallthatweneedtomake ourpointabouttheone-waydeterministicrelationshipbetweenapointpattern,abundanceanddistribution(rememberthat“distribution”issimplyacertainspatialpatternofpresence/absence).

set.seed(82)

tmp<-sim.fn(quad.size=16,cell.size=2,intensity=0.5)

Thisrelationshipamongthethreequantitiesisvisualizedinthefirstthreepanelsof Figure1.1 Withoutspatialdiscretization,neitherabundancenoroccurrence(orpresence/absence)isdefined;both necessarilyrequirediscretizationofcontinuousspaceintowhatyoucanthinkofasoneormore“sites.” Inthissimulation,a“site”isrepresentedbyonecellintheentiregrid.Youcanperhapsthinkofthe entiregridasaregionwhereinyourstudytakesplace.Onlyoncewehaveestablishedthatdiscretizationofspaceisabundance(whichweliketodenoteas N )oroccurrence(presence/absence,

FIGURE1.1

Relationshipamongthreefundamentalquantitiesinecology:a pointpattern ofindividualanimalsorplants (topleft),amapof abundance withthelocalabundance(N )ineachcellshowninblue(topright),anda speciesdistributionmapshowingbinary presence/absenceoroccurrence (bottomleft),withoccupiedcells showningrayandunoccupiedcellsinwhite.Atthebottomrightisthedistributionofcell-basedabundance (whichisPoissoninthissimulation),alongwiththemeanshowninblue(whichestimatesthePoissonmean lambda).Thisfigureisthegraphicaloutputfromrunningfunction sim.fn

whichweliketodenoteas z)defined.Then,abundance N issimplythenumberofpointsfallinginto each“site”(i.e.,cell) ifthereisnopointinacell,abundanceiszero;ifthereisonepoint,abundance isone;andsoon.Furthermore,presence/absence(z)simplydistinguishesthetwocaseswherethereis eithernopointinacell(i.e., N ¼ 0,thisisanabsenceornonoccurrence)orthereisoneoranynumber greaterthanonepointinthecell(i.e., N > 0,thisisapresenceoroccurrence).Thus,wecansaythat abundanceisafirststepofaggregatinganunderlyingpointpatternwithinsomespatialdiscretization scheme,andoccurrenceisasecondstepinthisaggregationoverthespatialunits.Alternatively,wecan saythatoccurrenceisasimpleinformation-poorsummaryofabundanceor“thepoorman’sabundance,”whereweonlykeeptrackoftwoabundanceclasses,onebeingzero(¼ “absence”)andthe

othergreaterthanzero(¼ “presence”).Thus,therelationshipsbetweenapointpattern,abundanceand occurrencearedeterministicinonewayonly ifyouknowthefullpatternandaregivensomespatial discretizationscheme,youhavefullknowledgealsoaboutabundance;andifyouknowthespatial patternofabundance,youalsoperfectlyknowthespatialpatternofoccurrence.Incontrast,thingsare notsostraightforwardtheotherwayround,e.g.,fromknowingapresence/absencepatternyoucannot perfectlyinfertheunderlyingabundancedistribution,althoughyoucanmakeexplicitstatistical inferencesaboutabundancefromsimpleoccupancydata(HeandGaston,2000;RoyleandNichols, 2003;Royleetal.,2005;Ramseyetal.,2015).

Wecandescribethespatialabundancepatternthatemergesfromthisunderlyingspatialpointpattern bydiscretizationofspaceandsummarizingthemeanandthevarianceoftheindividualvaluesof N ineach cell.Thewaythatthissimulationworks(i.e.,withauniformintensityovertheentirefield),theresulting numbers N willfollowaPoissondistributionwithmean lambda,where lambda isestimatedbythemean abundance(ordensity)overthe256cells.Inturn,thespatialpresence/absencepatternwillfollowa Bernoullidistributionwitha“successparameter”thatwewilllatercall“occupancyprobability,”and whichcorrespondstotheexpectedproportionofoccupiedcells(thatis,cellswithnonzeroabundance).

Thisisperhapsthesimplestpossiblemannertoexplainbysimulationtherelationshipbetweena pointpattern,abundance,anddistribution weuseaso-calledhomogenousPoissonprocess,whichis onewithaconstantintensity.Whenmodelingthepointpatternaggregateofabundance,thisisequivalent toadoptingaPoissongeneralizedlinearmodelwithaninterceptonlyforthecellvaluesofabundance.In reallife,homogenousintensityfieldsarguablyneverexist,insteadintensityispatternedduetoenvironmentalheterogeneity,whichcanbedescribedbyspatiallyindexedcovariatesorspatiallycorrelated randomsiteeffects.Muchofecologicalmodelinginspace,alsointhisbook,isaimedatidentifyingthe natureandstrengthofsuchcovariaterelationships.Whenmodelingdistributionorabundancefromreal data,weveryoftenfindthattherearetoomanyzeros.Thatis,aspeciesisabsentfrommoresitesthan whatwewouldexpectunderourmodel.Someauthorsthereforemakeacleardistinctionbetween “distribution,”whichissomethinglikeapotentialdistributionareawhereaspeciescanoccurinprinciple,and“abundance,”whichdescribesthenumberofindividualsonlyatsitesthatbelongtothat distributionarea.Suchauthorsthentypicallyadoptzero-inflatedPoissonorrelatedzero-inflatedmodels todescribewhattheyperceiveofastwodistinctprocesses,distributionandabundance.

Thisisverydifferentfromthewayinwhichwelookatthetwoconceptsofdistributionand abundance.Asjustexplained,inourview,“distribution”naturallyfollowsfromanygivenspatialdistributionofabundance.Wethinkthatitrarelyevermakessensetoconceiveoftwodistinctmechanisms underlyingarealizedabundancedistributioninspace.Instead,wethinkthatinalmostallcaseswhere therearetoomanyzeroesinadataset,thisissimplyduetoafailuretoincludeinourmodelalladequate covariatestomodelthesezeroesthroughthePoisson(ornegativebinomial,etc.)mean.Wethinkthatitis notveryinterestingtotryandattributemuchbiologytowhatinourviewismerelyadeficiencyofour abundancemodelandwhichmanifestsitselfbyatoohighfrequencyofzeros.

Theremayberareexceptions,ofcourse,wherethereareindeedtwoentirelydistinctstochastic processesgoverningtheabundancedistributioninspace.Forinstance,imaginetheabundanceofsome terrestrialspeciesinanarchipelago.Clearly,anyabundancegreaterthanzerorequiresthecolonization ofanislandbeforehandandthatisastochasticprocesswithbinaryoutcome eithertheislandis colonizedoritisnotcolonized.Thismayhavenothingtodowiththefactorsthatdetermineabundance onthatislandonceitiscolonized,and,thereforeinthisexample,itmakessensetoimaginetwoseparate mechanismsunderlyingthespatialvariabilityofabundanceasinazero-inflatedabundancemodel.

Butinthevastmajorityofcaseswethinkofsuchzero-inflatedmodelssimplyasamodelingtrickto makeupforourlackofperfectknowledgeofthecovariatesthatreallygovernabundance.Therefore,

wearehappytoadoptzero-inflatedmodelstoaccountfortheresultinglackoffit(see,e.g.,Chapter6), butwewouldnotusuallyclaimthattherewasmuchbiologyinthezero-inflationpartofthemodel. Especially,wewouldnotadoptcomplicatedcovariatemodelsinthezero-inflationpartandwewould never usethesamecovariatesinboththezero-inflationpartandintheabundancepartofthemodel(the resultingmodelisprobablynear-unidentifiable;seealsoGhoshetal.,2012).

Afterthisbriefdiscussionofthemeaningofzero-inflatedmodels,let’snowlookfurtheratthe actualnumbersin Figure1.1.Theintensityofthefieldunderlyingthepointpatternis0.5,hencewe wouldexpecttohaveatotalof M ¼ 162 0.5 ¼ 128individualsintheentirequadrat,whichhasan areaof256units.However,duetotherandomnessinthenumberofpointsinherentinapointpattern model,weonlyhave114individualsinthisrealizationoftheprocess.Atthechosengrainsize(i.e., with cell.size=2),theabundanceinthe256cellsvariesfrom0to6individualsandthemean realized abundanceis1.78,whilewewouldhaveexpected l ¼ 22 0.5 ¼ 2(thedifferenceissampling variability).Inaddition,thevarianceoflocalabundance(N )is1.86,whilewewouldexpect2undera Poissondistributionwithexpectedvalueof2.Finally,the realized proportionofoccupiedcells (occupancy)is0.83,whereunderaPoissonprocesswithconstantintensitywewouldexpect j ¼ 1 exp( l) z 0.86(i.e.,1minustheexpectedproportionofzeroabundance).Asalwayswith simulateddatasets,weareneatlyconfrontedwiththedifferencebetweenthe expected valueofthe outputfromastochasticprocess,i.e.,theaverageoveraninfinitenumberofrealizations,andtheactual valueinoneparticularrealizationoftheprocess.Thedifferencerepresentssamplingvariability.

Inaddition,youcanusesuchsimulationfunctionstolearnsomethingaboutthesimulatedprocess inamoregeneralandfundamentalway.Forinstance, sim.fn letsyoustudytherelationshipsamong theintensityofafieldinahomogenousPoissonpointprocess(intensity)andthegrain(cell.size) ofthemeasurementofdistributionorabundanceononehand,andtheresultingnumericalvaluesof abundance(N )andoccurrence(z)ontheother.Thefollowingsetsofcommandsletyoustudysomeof therelationshipsinamorequalitativemanner.Tobeabletoaverageinyourmindovertherandomness oftheprocess,youshouldexecuteeverylinemultipletimes.

#Effectofgrainsizeofstudyonabundanceandoccupancy(intensityconstant)

tmp<-sim.fn(quad.size=10,cell.size=1,intensity=0.5)

tmp<-sim.fn(quad.size=10,cell.size=2,intensity=0.5)

tmp<-sim.fn(quad.size=10,cell.size=5,intensity=0.5)

tmp<-sim.fn(quad.size=10,cell.size=10,intensity=0.5)

Althoughtheunderlyingpointpatternisidenticalonaverage,youseehowboththemeanabundance N (andthevarianceofabundance N )andtheproportionoftheoccupiedcells(j)increasewith increasinggrainsize,providedthatthequadratsizeremainsconstant.Whenthecellsizeisequaltothe quadratsize,wealwaysobserve100%occupancyforaspeciesthatoccursatall.

#Effectofintensityofpointpattern(intensity)onabundanceandoccupancy tmp<-sim.fn(intensity=0.1)#chosedefaultquad.size=10,cell.size=1 tmp<-sim.fn(intensity=1) tmp<-sim.fn(intensity=5)

tmp<-sim.fn(intensity=10)

Now,youwillobservethatwhenaspeciesisveryrare(intensityislow),theoccurrenceandthe abundancepatternswillbeessentiallyidentical,sincerarelywillacellbeinhabitedbymorethana singleindividual;seealso Figure1.2.However,thegreatertheintensity,thelessinformativewillthe spatialpatternofoccurrencebeaboutthespatialvariationinpopulationdensity.

FIGURE1.2

RelationshipsamongintensityoftheunderlyingPoissonpointprocessandgrainsizeandmeanabundance percell(topleft),meanproportionofoccupiedcells(topright),andtherelationshipbetweenmeanoccupancyandmeanabundanceforthefullrangeofabundancecreatedinthesimulation(bottomleft),andfora restrictedrangecomprisingonlyverysmallabundancevalues < 0.25(bottomright);1:1lineisadded.Blue linesinbottompanelsaresmoothingsplineswith4d.f.

Youcanuseafunctionsuchasthisoneforaformalsimulation,tostudytherelationshipsamong severalquantitiesatatime.Forinstance,hereisalittlesimulationtoinvestigatetherelationship betweenintensityandgrain(cell.size)andtheresultingmeandensityandoccupancyproportion(j). Weusethedefaultquadratsizeof10andvarybothcellsizeandintensityinsixstepseachandrecord themeanabundancepercellandtherealizedproportionofoccupiedcells.Werepeatthisforatotalof 100datasetsforeachofthe36combinationsofthetwofactors grain and int(ensity).Whenyou switchofftheplottinginthefunction,yougenerate36 100datasetsinbarelyfourseconds!

simrep<-100#Run50simulationreps

grain<-c(0.1,0.2,0.25,0.5,1,2)#valueswillbefedinto'cell.size'argument int<-seq(0.1,3,,6)#valueswillbefedinto'lambda'argument n.levels<-length(grain)#numberoffactorlevelsinsimulation results<-array(NA,dim=c(n.levels,n.levels,2,simrep))#4-Darray! for(iin1:n.levels){#Loopoverlevelsoffactorgrain for(jin1:n.levels){#Loopoverlevelsoffactorintensity for(kin1:simrep){

cat("\nDim1:",i,",Dim2:",j,",Simrep",k) tmp<-sim.fn(cell.size=grain[i],intensity=int[j],show.plot=F) results[i,j,1:2,k]<-c(mean(tmp$N),tmp$psi)

Wevisualizetheresultsintwoimageplotsthatshowtheaverageabundance(overthe100 simulateddatasets)asafunctionofthesixlevelsofeachsimulationfactor(Figure1.2,left)andthe sameforthemeanrealizedproportionofoccupiedquadrats(Figure1.2,right;codenotshown).

Welearnthreethingsfrom Figure1.2.First,weseethatbothabundanceandoccurrencedocontain someinformationabouttheintensityoftheunderlyingpointprocess.Second,bothabundanceand occupancyarescaledependent(Figure1.2,top),and,hence,youdon’tneedtobeageniustorecognize thatneitherabundancenoroccupancymakesensewhenyoudon’tknowthespatialscale(here, cell.size)atwhichitisexpressed(FithianandHastie,2013).Andthird,thereisastrongpositive relationshipbetweenthemeanabundanceinagridandtheproportionofoccupiedcells(occupancy). Atverysmallmeanabundance,occupancyisexactlyidenticaltoaverageabundance(thereisaslope of1),whilewithincreasingdensity,theslopeoftherelationshipbecomesshallowerandeventually evenzero,whenallcellsareoccupied.Then,occupancyisnolongerinformativeatallabouteitherthe underlyingabundanceoraboutthefundamentalpointpattern.

WehavesaidthatwecanuseRcodefordatasimulationtoexplainamodel,butofcoursethereverse istruealso thatanydatasimulationimpliesaspecificstatisticalmodel.Clearly,thisdatasimulation processrepresentsoneparticularmodelwithmanyspecificassumptions;forinstance,weassumea homogenousPoissonprocess,whichinvolvesthreethings:thatthespatialvariabilityinabundance followsacertainpattern(thatofaPoissondistribution),thatthereisnospatialheterogeneityinthe suitabilityofthehabitatandfinally,thatindividualsareoccurringindependentlyofeachother.Allthree areidealizationsthatwillstrictlyneverbetrueinreallife.Forinstance,individualsmayoccurmore aggregated(withlargerspatialvariance)ormoreevenly(withsmallerspatialvariance)thanstipulated underthePoisson,theenvironmentwillbeheterogeneousandsowillbetheintensityoftheprocess andtheremayberepulsion(fromterritoriality)oraggregation(e.g.,fromsocialattraction)among individuals,allofwhichwillagainbemanifestinthevarianceofabundance N.Also,wesimulateda certaingeometry,asquaregridwithanintegernumberofnestedandcontiguouscells,andthismaynot beadequateforsomethingsthatyoumightperhapswanttolearnfromsuchasimulation.Asalways withmodels,youneedtouseabstractionwisely leaveoutonlythethingsthatareunimportantand keepthosethatareimportant;thesameappliesforsimulationmodels.

Insummary,theimportantinsightsthatwewantedtogainfromthissimplesimulationexerciseare therefore:(1)thatatthebaseofallabundanceanddistributiondataresidesaspatialpointpattern(and thatspeciesrichnessisasummaryofawholecollectionofsuchspecies-specificpointpatterns),(2)that toassignavalueof“abundance”or“occurrence,”onemusthaveaspatialscaleandthisis only possible whenyoudiscretizespace,and(3)thereisaone-waydeterministicrelationshipintherelationship amongthethreescalesofaggregation{pointpattern,abundance,occurrence},whereknowledgeofthe oneontheleftgivesperfectknowledgeaboutthequantitytotheright,whileintheotherdirection,there issome sometimesconsiderable lossofinformationandthereforenosimplerelationship.Hierarchicalmodelsareextremelysuitedfordescribingprocesseswithmultiplescales,includingcombinations oftwoormorescalesinthetriple:pointpattern,abundance,occurrence(Begonetal.,1986).

1.2 META-POPULATIONDESIGNS

Interestingly,withoutevenknowingabouttherelationshipbetweenpointprocessesandtheirareal summariesofabundanceandoccurrence,peoplehavealwayslikedtodiscretizetheirentirestudyarea intosmallersubunits,or,putinanotherway,toreplicatetheirstudyareasinspace.Thisgivesriseto whatwecalla“meta-populationdesign”(Royle,2004a;Ke ´ ryandRoyle,2010).Weareatadshyabout thistermbecausewedonotmeantoimplythattheanimalslivinginsuchdiscretespatialunits necessarilybehaveaccordingtoaformalmetapopulation(Hanski,1998;Sutherlandetal.,2012, 2014).Rather,wecouldnotcomeupwithabetterandmoreconcisetermfortheextremelycommon casewheredistributionorabundanceisstudiedatacollectionofspatiallyreplicatedsitesorwherea wholestudyareaissubdividedintosmallersubunits,whichwetypicallycalla“site.”Thisisa“metapopulationdesign”tous,andtoavoidannoyingmetapopulationecologists,wesometimesputtheterm inquotesandaddahyphen.Nevertheless,weemphasizethatthegeneralsamplingsituationdoes includetheformalmetapopulationsituation,andanymodelwediscussinthisbookcanapplyto classicalmetapopulations.Especiallythedynamicmodelsforoccurrence(inChapters16and22in AHM volume2)areexactlymetapopulationmodelsforcolonization/extinctiondynamicsina presence/absencepattern.

Suchmeta-populationdesigns,ordesignswithspatiallysubdividedpopulations,areextremely commoninecologyandallrelatedsciences.Inaddition,theyareadoptedvirtuallyeverywherein biologicalmonitoring,whereitisclearthatyoucan’tcharacterizethestateoftheenvironmentfrom measurementstakenonlyatasinglesite.Meta-populationdesignscomeinalargevariety,andthe number,size,andshapeofcells(subunits)mayallvary.Sometimesthereisheterogeneityevenwithin asingledesign,e.g.,studysitesinacollectiondifferinareaandshapeandalsointheirspatial configuration(e.g.,intersitedistance).Sitesmaybenaturallydefinedbyahabitatboundaryandthus represent“habitatislands,”suchaspondswhenyouarestudyingfishorpond-breedingamphibiansor mountaintopswhenyou’reinterestedinalpineplantlife.Thismaythenbethetypicalsettingfor formalmetapopulations.Alternatively,sitesmaybedefinedarbitrarily,e.g.,bylayingagridovera mapandthencallingagridcellasite.Sitesmaycomeintwodimensionsortheymaybeonedimensionalandfollowlinearstructuressuchasrivers,coastlines,roads,orfootpaths.Finally,one typicallyhassomelargerregionthatonewantstocharacterizeintermsoftheabundanceoroccurrence ofsomespecies,andthesamplingfractionofameta-populationdesignmaythendifferbetween anythingfromalmostzerotoone,correspondingtothecaseswhereonlyasmallminorityofthe possiblesitesaresurveyedontheonehandandthecompletecoverageofthatregionontheother.

Figure1.3 showsjustfourexamplesamongamyriadofpossible“meta-populationdesigns.”Inthe toprowwecontrastcoverage,withperfectregionalcoverage(allcellsintheregionofinterestsurveyed;left)andregionalcoverageofabout25%(right).Inthebottomrow,wecontrastasystematic versusarandomplacementofthespatialreplicates,withtheactualspatialsampleof267sitesinthe “meta-populationdesign”oftheSwissbreedingbirdsurveyMHB(left;seeSections6.9,7.9,10.9and 11.3formoreinformationaboutthatsurvey),whilerightisahypotheticalvariantofthatdesignwhere 267sitesarechosenrandomly.Intermsofthesamplingfraction,theMHBhasonlyabout0.64% coverage(267/42,000).

Inaddition,spatialsubsamplingissurprisinglycommoninmeta-populationdesigns,whereineach site(unit)isfurthersubdividedintosmallerspatialsubunits,whichmayagaincovertheentiresiteor theymayonlycoverpartoftheentireareaofasite;seeSections6.14and10.10,withFigure10.13.

Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.