/
Overview of the overlap package Mike Meredith and Martin Ridout September    Introduction Overview of the overlap package Mike Meredith and Martin Ridout September    Introduction

Overview of the overlap package Mike Meredith and Martin Ridout September Introduction - PDF document

calandra-battersby
calandra-battersby . @calandra-battersby
Follow
530 views
Uploaded On 2014-12-19

Overview of the overlap package Mike Meredith and Martin Ridout September Introduction - PPT Presentation

Modern cameras record the time of the photo and the use of this to investigate diel activity patterns was immediately recognised Gri64259ths and van Schaik 1993 Initially this resulted in broad classi64257cation of taxa as diurnal nocturnal crepuscu ID: 26230

Modern cameras record the

Share:

Link:

Embed:

Download Presentation from below link

Download Pdf The PPT/PDF document "Overview of the overlap package Mike Mer..." is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.


Presentation Transcript

OverviewoftheoverlappackageMikeMeredithandMartinRidoutMay22,20201IntroductionCameratraps{cameraslinkedtodetectorssothatthey rewhenananimalispresent{areamajorsourceofinformationontheabundanceandhabitatpreferencesofrareorshyforestanimals.Moderncamerasrecordthetimeofthephoto,andtheuseofthistoinvestigatediel1activitypatternswasimmediatelyrecognised(GrithsandvanSchaik,1993).Initiallythisresultedinbroadclassi cationoftaxaasdiurnal,nocturnal,crepuscular,orcathemeral(vanSchaikandGriths,1996).Morerecently,researchershavecomparedactivitypatternsamongspeciestoseehowoverlappingpatternsmayrelatetocompetitionorpredation(LinkieandRidout,2011;Carveretal.,2011;Rameshetal.,2012;Carteretal.,2012;Kamleretal.,2012;Rossetal.,2013;Azevedoetal.,2018).RidoutandLinkie(2009)presentedmethodsto tkerneldensityfunctionstotimesofobservationsofanimalsandtoestimatethecoecientofoverlapping,aquantitativemeasurerangingfrom0(nooverlap)to1(identicalactivitypatterns).Thecodetheyusedformsthebasisoftheoverlappackage.Althoughmotivatedbytheanalysisofcameratrapdata,overlapcouldbeappliedtodatafromothersourcessuchasdataloggers,provideddatacollectioniscarriedoutaroundtheclock.Norisitlimitedtodielcycles:tidalcyclesorseasonalcycles,suchasplant oweringorfruitingoranimalbreedingseasonscouldalsobeinvestigated.2Kerneldensitycurves2.1ExampledatasetTodemonstratetheuseofthesoftwarewewillusecamera-trappingdatafromKerinci-SeblatNationalParkinSumatra,Indonesia(RidoutandLinkie,2009).�library(overlap)�data(kerinci)�head(kerinci)ZoneSpsTime11tiger0.17521tiger0.78731tiger0.24741tiger0.59151tiger0.50061tiger0.564�table(kerinci$Zone) 1Weuse\diel"for24-hourcycles,andreserve\diurnal"tomean\notnocturnal".1 0.00 0.04 0.08 tig2 Time Density 0:00 6:00 12:00 18:00 24:00 1234104425280289�summary(kerinci$Sps)boarcloudedgoldenmacaquemuntjacsambartapirtiger288610427320025181201�range(kerinci$Time)[1]0.0030.990Thedataprovidetime-of-capturedatafrom4ZoneswithintheParkfor8species:wildpig(\boar"),cloudedleopard,goldencat,pig-tailedmacaque,commonmuntjac,sambardeer,tapir,andtiger.Theunitoftimeistheday,sovaluesrangefrom0to1.Packageoverlapworksentirelyinradians: ttingdensitycurvesusestrigonometricfunctions(sin,cos,tan),sothisspeedsupbootstrapsandsimulations.Theconversionisstraightforward:�timeRad-kerinci$Time*2*pi2.2FittingkerneldensityWewillextractthedatafortigersinZone2(whichhasthemostobservations)andplotakerneldensitycurve:ကtig2-timeRad[kerinci$Zone==2&kerinci$Sps=='tiger']ကdensityPlot(tig2,rug=TRUE) Figure1:FittedkerneldensitycurvefortigersinZone3,usingdefaultsmoothingparameters.Figure1showstheactivitypatternfrom21:00to03:00,areminderthatthedensityiscircular.UnliketheusualdensityplotthatusesaGaussiankernel,weuseavonMiseskernel,correspondingtoacirculardistribution.2 0.00 0.04 tig2 Time Density 0:00 6:00 12:00 18:00 24:00 adjust = 2 0.00 0.06 tig2 Time Density 0:00 6:00 12:00 18:00 24:00 adjust = 0.2 TheactualdataareshownatthefootofFigure1asa`rug'.Densityestimationinvolvessmoothingtheinformationinthedata,andthedegreeofsmooth-ingiscontrolledbytheargumentadjusttothedensityPlotfunction.Increasingadjustabovethedefaultvalueof1givesa attercurve,reducingitgivesamore`spiky'curve,asshowninFigure2.Thechoiceofadjusta ectstheestimateofoverlap,aswediscussbelow. Figure2:Kerneldensitycurves ttedwithdi erentsmoothingadjustments.3QuantifyingoverlapVariousmeasuresofoverlaphavebeenputforward:seeRidoutandLinkie(2009)forareview.WeusethecoecientofoverlappingproposedbyWeitzman(1970).3.1CoecientofoverlappingAsshowninFigure3,thecoecientofoverlapping,,isthearealyingunderbothofthedensitycurves.(Rememberthattheareaunderadensitycurveis,byde nition,one.)Mathematically,ifthetwodensitycurvesaref(x)andg(x),thisis:(f;g)=Zminff(x);g(x)gdx(1)Thisworksifweknowthetruedensitydistributions,f(x)andg(x);butweusuallyonlyhavesamplesandneedtoestimatefromthese.3 3.2EstimatorsFivegeneralnonparametricestimatorsofthecoecientofoverlappingwereproposedbySchmidandSchmidt(2006).Forcirculardistributions,the rsttwoareequivalentandthethirdisunworkable(RidoutandLinkie,2009).Weretain^1,^4and^5.The rst,^1,matchesthede nitioninequation(1),butinpracticeitisestimatednumeri-cally,takingalargenumberofvalues,t1;t2;:::;tT,equallyspacedbetween0and2(ti=2i=T)andsumming:^1=1 TTXi=1minf^f(ti);^g(ti)g(2)For^4and^5,wecomparethedensitiesattheobservedvalues,x1;:::;xnforonespeciesandy1;:::;ymfortheother:^4=1 2 1 nnXi=1min(1;^g(xi) ^f(xi))+1 mmXi=1min(1;^f(yi) ^g(yi))!(3)^5=1 nnXi=1In^f(xi)^g(xi)o+1 mmXi=1In^g(yi)^f(yi)o(4)whereI(:)is1iftheconditionintheparenthesisistrue,0otherwise.Theterms^f(:)and^g(:)refertothe ttedkerneldensityfunctions,andassuchtheyarea ectedbythechoiceofthesmoothingconstant,adjust.Onthebasisofsimulations,RidoutandLinkie(2009)recommendusingadjust=0.8toestimate^1,adjust=1for^4,andadjust=4for^5.(Notethatadjustintheoverlapfunctionscorrespondsto1=cinRidoutandLinkie(2009)).Thesearethedefaultvaluesusedinoverlapfunctions.3.3ChoiceofestimatorRidoutandLinkie(2009)carriedoutsimulationswithavarietyofscenarioswherethetrueoverlapwasknown,andcomparedtheresultingestimateswiththetruth,calculatingtherootmeansquarederror(RMSE)foreachestimator.Thepresentauthorshavecarriedoutfurthersimulationsinthesamemanner.Wefoundthatthebestestimatordependedonthesizeofthesmallerofthetwosamples:Whenthesmallersamplewaslessthan50,^1performedbest,while^4wasbetterwhenitwasgreaterthan75.Innocasewas^5foundtobeuseful.Itisunstable,inthatsmall,incrementalchangesinthedataproducediscontinuouschangesintheestimate,anditcangiveestimatesgreaterthanone.3.4ExamplesWewillseehowthisworkswiththekerincidataset.WewillextractthedatafortigersandmacaquesforZone2,calculatetheoverlapwithallthreeestimators,andplotthecurves:�tig2-timeRad[kerinci$Zone==2&kerinci$Sps=='tiger']ကmac2-timeRad[kerinci$Zone==2&kerinci$Sps=='macaque']ကmin(length(tig2),length(mac2))[1]83ကtigmac2est-overlapEst(tig2,mac2,type="Dhat4")ကtigmac2est4 0.00 0.04 0.08 0.12 Zone 2 Time Density 0:00 6:00 12:00 18:00 24:00 Tigers Macaques Dhat40.4205464�overlapPlot(tig2,mac2,main="Zone2")�legend('topright',c("Tigers","Macaques"),lty=c(1,2),col=c(1,4),bty='n') Figure3:ActivitycurvesfortigersandmacaquesinZone2.Thecoecientofoverlappingequalstheareabelowbothcurves,shadedgreyinthisdiagram.Bothofthesesampleshavemorethan75observations,sowechosetousethe^4estimate,Dhat4intheRcode,givinganestimateofoverlapof0.42.4Con denceintervalsToestimatecon denceintervalsweneedtoknowthesamplingdistributionwhichourcoecientofoverlappingisdrawnfrom,ie,thedistributionwewouldgetifwehadaverylargenumberofindependentsamplesfromnature.Thebestwaytoinvestigatethisistouseabootstrap.4.1ThebootstrapTheusualbootstrapmethodtreatstheexistingsampleasrepresentativeofthepopulation,andgeneratesalargenumberofnewsamplesbyrandomlyresamplingobservationswithreplacementfromtheoriginalsample.Forthecaseofestimatingactivitypatterns,thismaynotworkverywell:supposeouroriginalsampleforanocturnalspecieshasobservationsrangingfrom20:58to03:14;resamplingwillneveryieldanobservationoutsidethatrange,whileafreshsamplefromnaturemaydoso.Analternativeisasmoothedbootstrap.Webeginby ttingakerneldensitytotheoriginaldatathendrawrandomsimulatedobservationsfromthisdistribution.Facedwithoriginalvaluesbetween20:58and03:14,mostsimulatedobservationswouldfallinthesamerange,butafewwillfalloutside.Intheoverlappackage,wegeneratebootstrapsampleswithbootstrap,whichhasasmoothargument;ifsmooth=TRUE(thedefault),smoothedbootstrapsamplesaregenerated.Forthis5 example,wewillgeneratejust1000bootstrapestimatesfortigersandmacaquesinZone2;forarealanalysis10,000bootstrapsampleswouldbebetter:�tigmac2-bootstrap(tig2,mac2,1000,type="Dhat4")#takesafewsecondsက(BSmean-mean(tigmac2))[1]0.4747555Notethatthebootstrapmean, BS,di ersfrom^:0.47versus0.42.Thedi erence, BS�^,isthebootstrapbias,andweneedtotakethisintoaccountwhencalculatingthecon denceinterval.Ifthebootstrapbiaswereagoodestimateoftheoriginalsamplingbias,abetterestimatorofwouldbe~=2^� BS.Oursimulationsshowthat~resultsinhigherRMSEthantheoriginal^,sowedonotrecommendapplyingthiscorrection.4.2ExtractingtheCIOnewaytoestimatethecon denceintervalissimplytolookattheappropriatepercentilesofthesetofbootstrapestimates(interpolatingbetweenvaluesifnecessary):fora95%con denceintervalthesewouldbethe2.5%and97.5%percentiles.Thisispercintheoutputfromoverlap'sbootCIfunction.WenotedattheendofSection4.1that,onaverage,thebootstrapvaluesdi erfromtheestimate:thisisthebootstrapbias.Therawpercentilesproducedbypercneedtobeadjustedtoaccountforthisbias.Theappropriatecon denceintervalisperc�( BS�^);thisisbasic0inthebootCIoutput.Analternativeapproachistousethestandarddeviationofthebootstrapresults,(sBS),asanestimateofthespreadofthesamplingdistribution,andthencalculatethecon denceintervalas^z =2sBS.Usingz0:025=1:96givestheusual95%con denceinterval.Thisisnorm0inthebootCIoutput.Thisprocedureassumesthatthesamplingdistributionisnormal.Ifthat'sthecase,norm0willbeclosetobasic0,butifthedistributionisskewed{asitwillbeif^iscloseto0or1{basic0isthebetterestimator.Forthetiger-macaquedatafromZone2wehavethefollowingestimatesofa95%con denceinterval:�bootCI(tigmac2est,tigmac2)loweruppernorm0.26859860.4640759norm00.32280770.5182851basic0.26770850.4622655basic00.32461810.5191751perc0.37882720.5733842bootCIproducestwofurtherestimators:basicandnorm.Theseareanalogoustobasic0andnorm0butareintendedforusewiththebias-correctedestimator,~.Theymatchthebasicandnormcon denceintervalsproducedbyboot.ciinpackageboot.Thecoecientofoverlappingtakesvaluesintheinterval[0,1].Allthecon denceintervalestimatorsexceptpercinvolveadditivecorrectionswhichmightresultinvaluesoutsideofthisrange.Thiscanbeavoidedbycarryingoutthecorrectionsonalogisticscaleandback-transforming.ThisisdonebybootCIlogit:�bootCIlogit(tigmac2est,tigmac2)6 loweruppernorm0.28185520.4643805norm00.32809590.5189280basic0.28156050.4634323basic00.32893700.5192916perc0.37882720.5733843Inthisexample,theCIsarewellawayfrom0or1,sothedi erenceissmall(andpercisexactlythesameasthere'snocorrectionanyway).4.3ChoiceofCImethodIfaseriesofX%con denceintervalsarecalculatedfromindependentsamplesfromapopulation,wewouldexpectX%ofthemtoincludethetruevalue.Whenrunningsimulationsweknowthetruevalueandcanchecktheactualproportionofcon denceintervalswhichcontainthetruevalue:thisisthecoverageoftheestimator.Ideallythecoverageshouldequalthenominalcon denceinterval,ie,95%coveragefora95%con denceinterval.Weranalargenumberofsimulationswithdi erenttruedistributionsandsamplesizes(seeRidoutandLinkie(2009)fordetails).Foreachscenario,weranbothsmoothedandunsmoothedbootstraps,extractedallnine95%con denceintervals,andcheckedthecoverageforeach.Eachestimatorgavearangeofcoverages.Welookedforamethodwhichgavemediancoverageclosesttothenominal95%andallormostvaluesabove90%.Thiswassatis edbythebasic0estimatorwithsmoothedbootstraps.Withsmallsamples(smallersample75)and&#x]TJ/;ø 9;&#x.962; Tf;&#x 10.;Ч ;� Td;&#x [00;0:8,coveragesometimesfellbelow90%,butnoneoftheotheroptionsfaredbetter.5SummaryofrecommendationsˆUsethe^4estimator(Dhat4)ifthesmallersamplehasmorethan75observations.Oth-erwise,usethe^1estimator(Dhat1).ˆUseasmoothedbootstrapanddoatleast1000resamples,preferably10,000.ˆUsethebasic0outputfrombootCIasyourcon denceinterval;beawarethatthiscon- denceintervalwillbetoonarrowifyouhaveasmallsampleandiscloseto1.6Caveats6.1PoolingdataPooleddatagivehigherestimatesofoverlapthantheoriginal,unpooleddata(RidoutandLinkie,2009).Supposewe ndaspeciesofbatthatemergesimmediatelyaftersunsetandahawkwhichgoestoroostjustbeforesunset:theiractivitypatternsdonotoverlapandpresumablythehawkwillnotbefeedingonthebats.Butthetimeofsunsetchanges;datafromDecemberonlyorfromJuneonlyshownooverlap,butthepooleddatado,andthisapparentoverlapisanartefactofpooling.Thisisaclear-cutexample.Ingeneral,di erencesinactivitypatternsacrosssitesortimeperiodswillbesmaller,butanyheterogeneitywillin atetheoverlapestimatesfrompooleddata.Careisneededwhencomparingcoecientsofoverlapamongstudyareasorperiodsofvaryingextentordegreeofheterogeneity.Onewaytomitigatethesedi erencesistomap"clocktime"to"suntime"(Nouvelletetal.,2012).ThenewfunctionsunTimeallowsthistobedone,seeitshelppage.Azevedoetal.(2018)usedthisapproachfortheirstudyofpuma.7 6.2What\activity"isobserved?Cameratrapssetalonganimaltrails{astheyoftenare{recordinstancesofanimalsmovingalongtrails.Theresulting\activitypattern"referstowalkingontrails,andoverlapindicatestheextenttowhichtwospeciesarewalkingontrailsatthesameperiodoftheday.Abrowsingherbivoreandthecarnivorestalkingitareprobablyboth\inactive"bythisde nition.Inviewofthis,conclusionsaboutspeciesinteractionsneedtobedrawnwithcare.InastudyinLaoPDR,Kamleretal.(2012)foundthatdholeandpigwereactiveduringthedayanddeeratnight.Thismightsuggestthatdholefeedonpigratherthandeer.Butexaminationofdholefaecesshowedthatdholeconsumedmainlydeerandverylittlepig.7ReferencesAzevedoFC,LemosFG,Freitas-JuniorMC,RochaDG,AzevedoFCC(2018).\Pumaactivitypatternsandtemporaloverlapwithpreyinahuman-modi edlandscapeatSoutheasternBrazil."JournalofZoology,0(0),0.CarterNH,ShresthaBK,KarkiJB,PradhanNMB,LiuJ(2012).\Coexistencebetweenwildlifeandhumansat nespatialscales."ProceedingsoftheNationalAcademyofSciences,109(38),15360{15365.CarverBD,KennedyML,HoustonAE,FranklinSB(2011).\Assessmentoftemporalpartition-inginforagingpatternsofsyntopicVirginiaopossumsandraccoons."JournalofMammalogy,92(1),134{139.GrithsM,vanSchaikCP(1993).\Camera-trapping:anewtoolforthestudyofelusiverainforestanimals."TropicalBiodiversity,1,131{135.KamlerJF,JohnsonA,VongkhamhengC,BousaA(2012).\Thediet,preyselection,andactivityofdholes(Cuonalpinus)innorthernLaos."JournalofMammalogy,93(3),627{633.LinkieM,RidoutMS(2011).\Assessingtiger-preyinteractionsinSumatranrainforests."Jour-nalofZoology,284(3),224{229.NouvelletP,RasmussenGSA,MacdonaldDW,CourchampF(2012).\Noisyclocksandsilentsunrises:measurementmethodsofdailyactivitypattern."JournalofZoology,286(3),179{184.RameshT,KalleR,SankarK,QureshiQ(2012).\Spatio-temporalpartitioningamonglargecarnivoresinrelationtomajorpreyspeciesinWesternGhats."JournalofZoology,287(4),269{275.RidoutMS,LinkieM(2009).\Estimatingoverlapofdailyactivitypatternsfromcameratrapdata."JournalofAgricultural,Biological,andEnvironmentalStatistics,14(3),322{337.RossJ,HearnAJ,JohnsonPJ,MacdonaldDW(2013).\Activitypatternsandtemporalavoid-ancebypreyinresponsetoSundacloudedleopardpredationrisk."JournalofZoology,290(2),96{106.SchmidF,SchmidtA(2006).\Nonparametricestimationofthecoecientofoverlapping|theoryandempiricalapplication."ComputationalStatisticsandDataAnalysis,50,1583{1596.8 vanSchaikCP,GrithsM(1996).\ActivityperiodsofIndonesianrainforestmammals."Biotropica,28(1),105{112.WeitzmanMS(1970).\MeasureoftheOverlapofIncomeDistributionofWhiteandNegroFamiliesintheUnitedStates."Technicalreport22,U.S.DepartmentofCommerce,BureauoftheCensus,Washington,DC.9