1RESM575SpatialAnalysisSpring2010Lab6MaximumEntropyAssigned:MondayMarch1Due:MondayMarch820pointsThislabexercisewasprimarilywrittenbyStevenPhillips,MiroDudikandRobSchapire,withsupportfromAT&TLabs-Research,PrincetonUniversity,andtheCenterforBiodiversityandConservation,AmericanMuseumofNaturalHistory.Thislabexerciseisbasedontheirpaperanddata:StevenJ.Phillips,RobertP.Anderson,RobertE.Schapire.Maximumentropymodelingofspeciesgeographicdistributions.EcologicalModelling,Vol190/3-4pp231-259,2006.MygoalistogiveyouabasicintroductiontouseoftheMaxEntprogramformaximumentropymodelingofspecies’geographicdistributions.TheenvironmentaldataconsistofclimaticandelevationaldataforSouthAmerica,togetherwithapotentialvegetationlayer.ThesamplespeciestheauthorsusedwillbeBradypusvariegatus,thebrown-throatedthree-toedsloth.NOTEontheMaxentsoftwareThesoftwareconsistsofajarfile,maxent.jar,whichcanbeusedonanycomputerrunningJavaversion1.4orlater.Itcanbedownloaded,alongwithassociatedliterature,from~schapire/maxent.IfyouareusingMicrosoftWindows(asweassumehere),youshouldalsodownloadthefilemaxent.bat,andsaveitinthesamedirectoryasmaxent.jar.Thewebsitehasafilecalled“readme.txt”,whichcontainsinstructionsforinstallingtheprogramonyourcomputer.Thesoftwarehasalreadybeendownloadedandinstalledonthemachinesin317Percival.Firstgototheclasswebsiteanddownloadthemaxent-tutorial-data.zipfile.Extractittothec:/tempfolderwhichwillcreateac:/temp/tutorial-datadirectory.Findthemaxentdirectoryonthec:/driveofyourcomputerandsimplyclickonthefilemaxent.bat.Thefollowingscreenwillappear:2Toperformarun,youneedtosupplyafilecontainingpresencelocalities(“samples”),adirectorycontainingenvironmentalvariables,andanoutputdirectory.Inourcase,thepresencelocalitiesareinthefile“c:\temp\tutorial-data\samples\bradypus.csv”,theenvironmentallayersareinthedirectory“layers”,andtheoutputsaregoingtogointhedirectory“outputs”.Youcanentertheselocationsbyhand,orbrowseforthem.Whilebrowsingfortheenvironmentalvariables,rememberthatyouarelookingforthedirectorythatcontainsthem–youdon’tneedtobrowsedowntothefilesinthedirectory.AfterenteringorbrowsingforthefilesforBradypus,theprogramlookslikethis:3Thefile“samples\bradypus.csv”containsthepresencelocalitiesin.csvformat.Thefirstfewlinesareasfollows:species,longitude,latitudebradypus_variegatus,-65.4,-10.3833bradypus_variegatus,-65.3833,-10.3833bradypus_variegatus,-65.1333,-16.8bradypus_variegatus,-63.6667,-17.45bradypus_variegatus,-63.85,-17.4Therecanbemultiplespeciesinthesamesamplesfile,inwhichcasemorespecieswouldappearinthepanel,alongwithBradypus.Othercoordinatesystemscanbeused,otherthanlatitudeandlongitude,aslongasthesamplesfileandenvironmentallayersusethesamecoordinatesystem.The“x”coordinateshouldcomebeforethe“y”coordinateinthesamplesfile.Thedirectory“layers”containsanumberofasciirastergrids(inESRI’s.ascformat),eachofwhichdescribesanenvironmentalvariable.Thegridsmustallhavethesamegeographicboundsandcellsize.MAKESUREYOURASCIIFILESHAVETHE.ascEXTENSION!!!!!!!!!Oneofourvariables,“ecoreg”,isacategoricalvariabledescribingpotentialvegetationclasses.Youmusttelltheprogramwhichvariablesarecategorical,ashasbeendoneinthepictureabove.DoingarunSimplypressthe“Run”button.Aprogressmonitordescribesthestepsbeingtaken.Aftertheenvironmentallayersareloadedandsomeinitializationisdone,progresstowardstrainingofthemaxentmodelisshownlikethis:The“gain”startsat0andincreasestowardsanasymptoteduringtherun.Maxentisamaximum-likelihoodmethod,andwhatitisgeneratingisaprobabilitydistributionoverpixelsinthegrid.Notethatitisn’tcalculating“probabilityofoccurrence”–itsprobabilitiesaretypicallyverysmallvalues,astheymustsumto1overthewholegrid.Thegainisameasureofthelikelihoodofthesamples;forexample,ifthegainis2,itmeansthattheaveragesamplelikelihoodisexp(2)≈7.4timeshigherthanthatofarandombackgroundpixel.Theuniformdistributionhasgain0,soyoucaninterpretthegainasrepresentinghowmuchbetterthedistributionfitsthesamplepointsthantheuniformdistributiondoes.Thegainiscloselyrelatedto“deviance”,asusedinstatistics.4Therunproducesanumberofoutputfiles,ofwhichthemostimportantisanhtmlfilecalled“bradypus.html”.Partofthisfilegivespointerstotheotheroutputs,likethis:LookingatapredictionToseewhatother(moreinteresting)contenttherecanbeinc:\temp\tutorial-data\outpus\bradpus_variegatus.html,wewillturnonacoupleofoptionsandrerunthemodel.Pressthe“Makepicturesofpredictions”button,thenclickon“Settings”,andtype“25”inthe“Randomtestpercentage”entry.Lastly,pressthe“Run”buttonagain.Youmayhavetosay“ReplaceAll”forthisnewrun.Aftertheruncompletes,thefilebradypus.htmlcontainsthispicture:Theimageusescolorstoshowpredictionstrength,withredindicatingstrongpredictionofsuitableconditionsforthespecies,yellowindicatingweakpredictionofsuitableconditions,andblueindicatingveryunsuitableconditions.ForBradypus,weseestrongpredictionthroughmostoflowlandCentralAmerica,wetlowlandareasofnorthwestern5SouthAmerica,theAmazonbasin,Caribeanislands,andmuchoftheAtlanticforestsinsouth-easternBrazil.Thefilepointedtoisanimagefile(.png)thatyou