Applied Hierarchical Modeling in Ecology Analysis of distribution, abundance and species richness in R and BUGS Volume 1 Prelude and Static Models Marc Ke´ry Swiss Ornithological Institute, Sempach, Switzerland J. Andrew Royle USGS Patuxent Wildlife Research Center, Laurel MD, USA AMSTERDAM(cid:129)BOSTON(cid:129)HEIDELBERG(cid:129)LONDON(cid:129)NEWYORK(cid:129)OXFORD PARIS(cid:129)SANDIEGO(cid:129)SANFRANCISCO(cid:129)SINGAPORE(cid:129)SYDNEY(cid:129)TOKYO AcademicPressisanimprintofElsevier 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 visitourwebsiteathttp://store.elsevier.com/ J.A.Roylewastheprincipalauthorofchapters2,7,8,9.Useofproductnamesdoesnotconstitute endorsementbytheU.S.Government. For Jim Nichols, who changed the way in which we think about Ecology Foreword Istartedgraduateschoolin2003workingonasimpleprojecttounderstandhowforestmanagement practicesaffectbirdpopulationsintheWhiteMountainNationalForestinNewHampshire,USA.As withmanyprojectsofitskind,wecollectedpointcountdatatocharacterizeabundanceatacollection ofsitesthathadreceiveddifferentmanagementactions.Knowingthatwewouldfailtodetectmanyof theindividualspresentatseveralsites,andthatdetectionprobabilitymightcovarywithhabitat vari- ables, my adviser David King recommended that we survey each site multiple times and record the distance to each individual detected. When the field season came to an end, I had my data in hand andwasreadytoknockoutaquickanalysis.Thatiswhenthedifficultiesbegan.ThefirstthingItried wasamultipleregression,butIwasimmediatelystumpedastowhattheappropriateresponsevariable was.Shoulditbethemeannumberofindividualsdetectedateachsite,themaximumnumberdetected, orperhapsthemedian?Differentauthoritiesrecommendeddifferentstrategies,andtomydismay,the resultsdifferedwitheachapproach.Inadditiontothisproblem,itwasapparentthatthemodelmadeno distinction between the explanatoryvariables that I had collected todescribevariationin abundance andthevariablesthatIhadcollectedtoexplainvariationindetection.Asaresult,Icouldusemymodel topredicttheeffectofmanagementonobservedcounts,butnotonabundance,thestatevariablethatI was actuallyinterested in. Isoonabandonedtheregressionapproachandturnedmyattentiontodistancesamplingmethods. Hereagain,IwasquicklysurprisedtofindthatalthoughIcouldpoolmydatatoaccountfortheeffect of distance on detection probability, I couldn’t directly model the effects of management variables (someofwhichwerecontinuous)onabundance.Eventhetwo-stageapproachesthatwererecommen- dedatthetimewerenotpossiblebecauseofthesparsenessofmydata,whichincludedmanysiteswith nodetections.Moreover,evenifIhadbeenabletocorrectfordetectionandthenmodelmyestimates, itwouldhavebeenverydifficulttoproperlyaccountforthecovarianceoftheestimates.AsIsearched for solutions to these problems, my despair continued to grow as I read several distance sampling papers proclaiming that the data I had worked so hard to collect might be impossible to use for my purpose. Theonly option seemed to beto study somethingelse! Andthenin2004,AndyRoyleandcolleaguespublishedtwopapersthatseemedtohavebeenwrit- ten with exactly my problem in mind. Royle (2004b, Biometrics) demonstrated how repeated count datacouldbeusedtomodelspatialvariationinabundancewhileaccountingforvariousfactorsinflu- encingdetectionprobability,andRoyleetal.(2004,Ecology)explainedhowspatialvariationinabun- dance could be modeled using distance data collected using standard point count survey methods. UnlikeallothermethodsIhadseen,therewasnoneedtodoatwo-stageanalysis,anditwasstraight- forwardtomodelcovariatesofbothabundanceanddetection.Herewerehierarchicalmodelsthatnot onlyprovidedconceptualclarity,butallowedmetomakefulluseofmydatasothatIcouldtestthe hypotheses I was interested in. There was only one problem with the exciting models that I was reading aboutdI had no clue howtofitthemtomydata.Ihadtakenacoupleofstatisticscourses,butIhadneverheardofmar- ginallikelihood,andIcertainlyhadnoideahowtowritecodetomaximizeanintegratedlikelihood function.Theverynextyear,however,MarcKe´ry,AndyRoyle,andHansSchmidpublishedapaper in Ecological Applications that provided additional details about these models, and the paper included an appendix with a short R script that demonstrated how to obtain maximum likelihood ix x FOREWORD estimates. It’s no exaggeration to say that I learned more about statistics and programming by trying to understand this one bit of code than I did from any formal education up to that point. From there, I quickly began modifying the code to make it more general and to deal with other typesofdatathatIhadgathered.Thiseventuallyledmetodevelopsomegeneralfunctions,which werecomingtogetherjustasIlearnedaboutanRpackagebeingdevelopedbyIanFisketo fitthis class of models. I offered to help, and even though I never met Ian in person, we had a couple of good years of collaboration that resulted in the R package unmarked. The reason for conveying this bit of personal history is not just to make the point that Marc and Andyhavehadahugeimpactonmyowncareer,buttoconveyastorythatIknowappliedecologists aroundtheworldcanrelateto.Simplepracticalproblemsturnouttoposeseriouschallengeswhenwe areunabletodirectlyobservetheprocessesofinterest.Indicesofabundanceandpopulationtrendsare nearly useless when we’re concerned about absolutes like extinction risk or harvest limits. Applied ecologistshaverecognizedtheseproblemsforalongtime,andhierarchicalmodelsprovideasolution byenablingresearcherstodirectlymodeltheecologicalprocess,ratherthansomepoorlydefinedin- dex,whilealsomodelingtheobservationprocess.Moreover,thesemodelsallowpractitionerstosolve problemsinsuchawaythattheresultscanbeclearlycommunicatedtomanagersandpolicymakers. Butwhydidittakesolongforthesemethods,thefoundationsofwhichweredevelopedalongtime ago,tomaketheirwayintothehandsofpractitioners?Inmyopinion,thepowerofhierarchicalmodels wouldneverhavebeenrealizedhaditnotbeenforresearcherslikeMarcandAndy,whohavedelib- eratelyworkedtomakethesetoolsaccessibletothoseofuslackingadvanceddegreesinstatistics.This bookisaphenomenalsynthesisofthateffort.Unlikemanybooksonstatisticalmodelingthatseemto havebeenwrittenbystatisticiansforstatisticians,themainaudienceofthisvolumeisclearlytheprac- ticing ecologist. The writing style is clear and engaging, and for virtually every technical problem, workedexamplesandcodeareprovided.Thisaccomplishment,ofdistillingadvancedmodelingtech- niquesintoanaccessibleformat,isinmyviewoneofthetwogreatcontributionsofthisworktoecol- ogyand related environmentalsciences. Thesecond great contributionofthisworklies outside thecontextofappliedresearch.Thehier- archicalmodelingapproachthathasbeendevelopedandillustratedhereispartofanemergingtrend, one that is far moregeneral and in someways far more consequential for ecology as a science. The methods covered in this book provide a framework for advancing knowledge of ecological systems by narrowing the chasm between theoretical and statistical models. It has always struck me as trou- bling that the mathematical models covered in ecology textbooks often fall by the wayside when we get our hands on data. As soon as the data are facing us on the computer, the instinct arises to turn toward the latest development in statistics and leave theory behind. For example, we have >100yearsoftheoryonthefactorslimitingspeciesdistributionsdfactorssuchascompetition,Allee effects,andphysiologicalconstraintsdyetwecramdata,oftencollectedforotherpurposes,intospe- ciesdistributionmodelsthatignoredemographicprocessesandbioticinteractions,nottomentionthe observationprocessesthatwillcauseseverebiasifignored.Or,weoftenhavedatafrommetapopula- tionsthatwerunthroughamachinelearningalgorithmortowhichwefitsomesortofGAMwithloads of random effects. The tools described in this book provide an alternative. They offer a framework thatallowsonetofitmetapopulationmodelstometapopulationdata,toestimatethestrengthofbiotic interactions, and to test for effects of abiotic covariates on abundance, occurrence, or population growth rates. This is the power of hierarchical modeling: that we can tailor our statistical models to the scientific questionat hand and notthe otherway around. FOREWORD xi This is not to say that this book is full of theory. Rather, it provides the tools necessary to build hierarchical models based on theory instead of relying on purely phenomenological approaches. Why is this so important at this point in time, when focus is increasingly shifting to prediction? Why don’t we just hire a team of Netflix data miners to forecast the future of ecological systems? In my view, prediction without mechanism falls well outside the realm of science. For instance, we knowthatwecandevelopgoodpredictivemodelsbysimplymodelingspatialandtemporalautocor- relation.Abundanceatonelocationcanoftenbeaccuratelypredictedasafunctionofabundanceatan adjacentlocation,justasvotinghabitsinonecountycanbepredictedfromthebehaviorofneighboring counties,andjustastheweathertodayoftentellsussomethingabouttheweathertomorrow.Butwhat islearned about the underlying processes fromfitting modelslacking mechanism?Very little,inmy estimation,whichiswhyI’mhappytohavethisnewbookthatpresentssuchapowerfulalternative. Asgreatasthehierarchicalmodelingframeworkis,Ithinkitisimportanttoemphasizethatitisnot meanttobeanalternativetoclassical methods ofexperimental designandanalysis.Infact, Iwould suggest that it is only via manipulative experiments that can we achieve the ultimate goal of causal inference. The problems we face in ecology, however, are that we often cannot bring our system into the lab, and we can’t always manipulate one component while holding the others constant. To complicatemattersfurther,processesthatholdatonepointinspaceandtimemayoperatedifferently atanother.Wearethereforeforcedtocombineexperimentalapproacheswithobservationalonesifwe wishtoadvanceknowledgeandinformconservationefforts.Onceagain,themethodspresentedinthis bookprovideaformalwayofbuildingmechanismsintoourmodelssothatwecanunifytheinsights gained from experimental studies with the information contained in field data. It is this unified approachthatIthinkoffersthegreatestpromiseforadvancingourfield,anditisexcitingtobeworking inatimewhenwefinallyhavethetoolsavailableforthetask.SoitiswithgreatpleasurethatIcongrat- ulateMarcandAndyonafantasticbook,onethat,aslargeasitis,isjustthebeginning.I’llbelooking forward tothe nextvolumeand allthe excellent work thatissure tobenefit from it. Richard Chandler UniversityofGeorgia Preface Thisisvolume1ofournewbookontheappliedhierarchicalmodelingofthethreecentralquantitiesin ecologydabundance,ordensity,occurrence,andspeciesrichnessdaswellasofparametersgoverning theirchangeovertime,especiallysurvivalandrecruitment.Hierarchicalmodelingisagrowthindustryin ecology.Inthelast10yearstherehavebeenadozenormorebooksfocusedonhierarchicalmodelingin ecology including Banerjee et al. (2004), Clark and Gelfand (2006), Clark (2007), Gelman and Hill (2007),McCarthy(2007),RoyleandDorazio(2008),Kingetal.(2009),LinkandBarker(2010),Ke´ry and Schaub (2012), Hobbs and Hooten (2015), etc. How can we possibly add 700þ more pages (and perhaps1500ifyoucountvolume2)towhatisknownonthistopic?That’sagoodquestion! Inthis bookwe cover severalclasses ofmodelsthat havepreviouslyreceivedonly cursoryorno treatmentatallinthehierarchicalmodelingliterature,andyettheyareextremelyimportantinecology (e.g., distance sampling). Moreover, we give complete recipes for analyzing these models and all otherscoveredinthebook,usingprogramRingeneralandtheRpackageunmarkedinparticular,and very extensively using the generic Bayesian modeling software BUGS. The use of unmarked is completely novel compared to these other books. Some models that we cover here and especiallyin volume2weresimplyunimaginableacoupleyearsago,e.g.,theopenhierarchicaldistancesampling models, the metacommunity abundance models and models with explicit population dynamics (i.e., the famousmodelof Dail and Madsen, 2011), which can be fittocountsand relateddata,including evendistancesamplingdata.Muchofthismaterialisextremelynew,andsomehasonlyjustappeared intheliteratureinthelastyearorso.Thus,thisbookrepresentsatimelysynthesisandextensionofthe state of hierarchical modeling in ecology that builds on previous efforts, but covers much new and importantterritory,andprovidesimplementationsusingboththelikelihood(unmarked)andBayesian (BUGS)frameworks. A BOOK OF MONOGRAPHS In a sense, Applied Hierarchical Modeling for Ecologists (AHM) is a book of books, or a book of monographs.Volume1containsthefirsttwoparts,aprelude,whichintroducesthenecessaryconcepts andtechniquesinfivechapters,followedbysixchaptersthatdealwithstaticdemographicmodelsof distribution, abundance, and species richness and other descriptors of communities and meta- communities. Volume 2 will contain two further parts on dynamic models and on advanced demographicmodelsforpopulationsandcommunities;seebelowformoreinformationonthedivision of topics betweenvolumes1 and2 of AHM andon the content that we envision for volume2. Looking back at volume 1 now, at the time of writing of this preface, we feel as if we have packaged almost a dozen independent books into this one book. There are general, introductory “monographs”ontheconceptsofdistribution,abundance,andspeciesrichnessandtheirmeasurement andmodelinginpractice(Chapter1),onhierarchicalmodelsandtheiranalysis(Chapter2),onlinear, generalized linear, and mixed models (Chapter 3), on data simulation in R (Chapter 4), and on the celebrated BUGS language and software (Chapter 5). After that, there are six comprehensive monographsondemographicmodelsfordistribution,abundance,andspeciesrichnessinthecontextof whatwecalla“meta-populationdesign,”thatis,theextremelycommonsituationwhereyoumeasure something in apopulation ora community at morethan asingle point inspace. In the prelude, and following the introductory Chapter 1, we have one monograph to cover hi- erarchical models (HMs) and their Bayesian and frequentist analyses (Chapter 2). The next xiii xiv PREFACE monograph (Chapter 3) provides a highly accessible review of that “heart” of applied statistics: linearmodels,generalizedlinearmodels(GLMs),andsimplemixedmodels,allofthemillustrated in the context of one extremely simple ecological data set. Data simulation is one of the defining featuresofthisbookbecauseitprovidessuchimmensebenefitsfortheworkofecologists(andalso for statisticians). Hence, the next monograph (Chapter 4) is dedicated to this essential topic and walks you through the R code necessary for the generation of one simple type of data set that is fundamentaltotheclassesofmodelscoveredinthisbook:thecasewhereonegoesoutandcounts birds(oranyotherspecies)atmultipleplaces(e.g.,20,100,or267)andrepeatsthesecountsateach site multiple times (e.g., 2 or 3). The BUGS model definition language is implemented in three currently used BUGS engines for Bayesian inference: WinBUGS (Lunn et al., 2000), OpenBUGS (Thomas et al., 2006), and JAGS (Plummer, 2003). It has also just been adopted in the exciting new R package NIMBLE (NIMBLE DevelopmentTeam,2015;deValpineetal.,inreview),whichisageneralmodelfittingsoftwarethat uses and extends the BUGS language for flexible specification of HMs and allows analysis of HMs with both maximum likelihood and Bayesian posterior inference. Over the first 25 years of its existence, BUGS has been instrumental in the surge of Bayesian statisticsinallkindsofsciencesincludingecology(Lunnetal.,2009).Ithasgrownbyfarintothemost importantgeneral,Bayesianmodelinglanguage,anditsuserpopulationkeepsgrowingatarapidrate (andofcoursewehopetoincreasethatrateevenmorewiththisbook).BUGSisuniqueingivingyou asa nonstatistician amodeling freedom that lets you develop, test,and fit models that you wouldn’t even have dared to dream of in the pre-BUGS era of ecological modeling (which we might call the ecological Stone Age;.). Although there are now many useful introductory books on BUGS (e.g., McCarthy, 2007; Ke´ry, 2010; Lunn et al., 2013; Korner-Nievergelt et al., 2015), we have decided to writeyetanotherpracticalBUGSintroductionandpackageitintoChapter5.Itisourlatestandbest attemptatcoveringasmuchaspossibleonthistopicandincludingsomeofthelatesttricksinBUGS modelinginamere70bookpages,illustratingtheuseofallthreeBUGSenginesandfocusingonthe models covered in Chapter 3, i.e., linear models, GLMs, and simple mixed models. By introducing BUGSforexactlythekindsofmodelsthatyouarelikelytobefamiliarwithalready,wehopetomake itespeciallyeasy for youtograspthe Bayesiansideofthe analysisandthe implementationofthese essential models inthe BUGS language. Inthesecondpartofthebook,wepresentsixmonographsthatcontainacomprehensivetreatment ofimportantclassesofmodelsforinferenceaboutdistribution,abundance,andspeciesrichness,and relateddemographicpopulationorcommunitymetricsinso-called“meta-populationdesigns”(Royle, 2004a;Ke´ryandRoyle,2010),i.e.,forthefrequentcasewhereyouareinterestedinthesethingsnotat a single place but have studied them at multiple sites. Specifically, in Chapter 6 we cover binomial mixture, or N-mixture, models (Royle, 2004b), which are a unique type of model for count data on unmarkedindividuals(thatis,youdonotneedtokeeptrackofwhichindividualiswhichacrossthe repeatedmeasurementsofabundanceatasite)andthatcontainsanexplicitmeasurementerrormodel, whichcorrectsyourinferencesforthebiasesthatwouldotherwisebecausedbyundercountingdueto imperfect detection probability. Chapter 7 covers a “sister-type” of model, the multinomial mixture model(Royle,2004a;Dorazioetal.,2005),whichonlydiffersfrombinomialmixturemodelsinthe typeofdatatowhichitisfitted:typicallyyouneedindividualrecognition,thatis,youhavecapture- recapture-type of data, but again collected not at a single site but at multiple places. Both types of mixture models havebeen around for about 10yearsnowandpreviouslythey havebeen featured in PREFACE xv someoftheabove-citedhierarchicalmodelingbooks(mostlyinRoyleandDorazio,2008),butnever beforehavetheybeencoveredinsuchdetailand,especially,inamannerthatmakesthemsoaccessible to youas anecologist. Chapters 8 and 9 are special in that they provide perhaps the first large, and yet practical and applied, synthesis in distance sampling more than 10years after the two classics by Buckland et al. (2001,2004a)werepublished.Inourtwodistancesamplingmonographs,weprovideafresh,newlook atdistancesamplinginthecontextofhierarchicalmodelsinanessentiallybook-lengthtreatment.We hopethatthiswillhelptomakethisimportanttypeofmodelevenmorewidelyunderstoodandusedby ecologists.Whilewecovermainlystaticmodelsinvolume1andthencoverdynamicmodelsinmore detailinvolume2ofAHM,wehavedeviatedslightlyfromthisruleinChapters8and9,wherewehave preferred topical unity over conceptual unity by keeping all of distance sampling (closed and open) together.Nevertheless,weplantocoverseveralmorecutting-edgeopenandothernovelextensionsof hierarchical distance sampling (HDS) models involume2. These two monographs, and more specifically the wealth of material on hierarchical distance sampling,areperhapsthosewithmostnoveltyinourbook.Thoughagaininventedjustover10years ago(around2004),HDShasrecentlyexperiencedaboostwiththewidespreadrealizationthatthistype of specification of distance sampling models enables extremely flexible modeling of spatially or temporally replicated distance sampling data or combined analyses of data sets collected under differingprotocols(“integratedmodels”),whichwasthoughtimpossiblebeforeoratleastwasnever achieved.Forinstance,itisperfectlydoable(oreventrivial)tomodelpopulationdynamics(Sollmann et al., 2015) or community size and composition (Sollmann et al., in press) from distance sampling data within the context of hierarchical models. And, the power of BUGS nowadays makes the implementation of such models possible even for ecologists, since really such models differ in only relatively minor waysfrom similarmodels for otherdata types (e.g., of the capture-recapture type). Hence, we hope that we contribute to change your view of “capture-recapture” and “distance sampling”asbeingtwowidelyseparatedfieldstoanewwayofseeingthemasreallyrelativelyminor variations on the overarching theme of hierarchical models, which have one model component for abundance,ordensity,andinanothermodelcomponentdescribethemeasurementerrorthatinduces imperfectdetectionandthereforeundercounting(Borchersetal.,2015).Theonlythingthatchanges whenyoumovefromacapture-recapturetoadistancesamplingmodelisthespecificparameterization ofthemeasurementerrorunderlyingtheobserveddataandofcoursethetypeofdatathatyouneedto estimate the parameters of that measurement error model. This wonderful, unifying power of describing statistical models in a hierarchical way lets youmuch bettergrasp the similaritiesamong large numbers of models that were often thought as totally distinct hitherto. It is one of the main themesofthisbookandoneonwhichwewillsaymuchmorethroughoutthebook.Forinstance,we hope that you will recognize that there are really only quite minor differences between a binomial mixturemodelforcountsofunmarkedindividuals,amultinomialmixturemodelforcapture-recapture data,andahierarchicaldistancesamplingmodeldtheonlydifferenceisagainthemeasurementerror model,whilethestatemodel,thatis,thedescriptionoftheessentialbiologicalquantity(abundanceor density), is exactly the sameinall three types ofmodels. Thepenultimatemonograph(Chapter10)isonoccupancymodeling(MacKenzieetal.,2002;Tyre et al., 2003). This powerful type of model for occurrence or distribution comes with an explicit measurement error component model for both false-negatives and false-positives (models by Royle andLink,2006;Aingetal.,2011;Milleretal.,2011,2013b;Sutherlandetal.,2013;Chambertetal., xvi PREFACE 2015) or with a measurement error model for false negatives only (all other types of occupancy models).Occupancymodelshavebecomehugeinecologyandhaveexperiencedasteepgrowthcurve in both the number of papers that further develop the theory of these models and especially also in studiesthatapplythisdesignandtheassociatedmodels.(Wehaveevenheardrumorsthatthevigorous growthofthefieldhas“scared”someecologyjournaleditorssothattheyputacaponthenumberof occupancy papers they acceptda strange way of stifling progress one would think.) Occupancy modelshavereceivedonebook-lengthtreatisesofar(MacKenzieetal.,2006),withasecondedition that is in preparation, and several customized software products that specialize in them, especially PRESENCE(Hines,2006)andMARK(WhiteandBurnham,1999;CoochandWhite,2014).Inthis firstAHMvolume,wedealwithsingle-speciesoccupancymodelsingreatdetailandcoversometopics (e.g.,somemodelsfordatacollectedalongspaceortime“transects”)thathaven’tbeencoveredinany bookbefore.Involume2,wewilladdseveralmoremonographsonalargevarietyofoccupancymodel types; see below. The final monograph involume 1 covers community models, that is, community or multispecies variants of all the previous models. Specifically, we cover the community variant of an occupancy model (Chapter 10) and the community variant of a binomial N-mixture model (Chapter 6). 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 andon the occupancy-basedcommunity models. Ofcourse,apartfromservingasastandaloneintroductiontothislargerangeofpowerfulanduseful hierarchical models, the material in volume 1 also lays the groundwork for more models and more advanced material in volume 2. See below for more about the division of content between the two volumes. UNIFYING THEMES AHM is not just a hodgepodge of models that have not previously been covered in detail or at all. Rather, our developmentand organization ofthese models has a number ofunifying themes that we emphasize throughout the book: (cid:129) hierarchical modeling (cid:129) data simulation (cid:129) measurement error models (cid:129) dual inference paradigmapproach (Bayesianismand frequentism) (cid:129) accessible andgentle style (including hierarchical likelihood construction and data simulation) (cid:129) “cookbookrecipes” (cid:129) predictions One, we advocate hierarchical modeling as a unifying concept and overarching principle in modelingandalsoconceptually;aswehaveemphasizedbefore,whenseenasHMsallthesemodels almostlookthesame(orverysimilar)anditisquitetrivialtomovefromonetoanother,e.g.,froma capture-recapturemodeltoadistancesamplingmodeltoanoccupancymodeloreventoacommunity