maxent原版英文说明.docx
《maxent原版英文说明.docx》由会员分享,可在线阅读,更多相关《maxent原版英文说明.docx(15页珍藏版)》请在冰豆网上搜索。
![maxent原版英文说明.docx](https://file1.bdocx.com/fileroot1/2023-8/3/b144870f-f105-4ba7-b55c-b505a3a3a98a/b144870f-f105-4ba7-b55c-b505a3a3a98a1.gif)
maxent原版英文说明
maxent原版英文说明
RESM575SpatialAnalysis
Spring2010
Lab6MaximumEntropy
Assigned:
MondayMarch1
Due:
MondayMarch8
20points
ThislabexercisewasprimarilywrittenbyStevenPhillips,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.
NOTEontheMaxentsoftware
Thesoftwareconsistsofajarfile,maxent.jar,whichcanbeusedonanycomputerrunningJavaversion1.4orlater.Itcanbedownloaded,alongwithassociatedliterature,fromwww.cs.princeton.edu/~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:
Toperformarun,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:
Thefile“samples\bradypus.csv”containsthepresencelocalitiesin.csvformat.Thefirstfewlinesareasfollows:
species,longitude,latitude
bradypus_variegatus,-65.4,-10.3833
bradypus_variegatus,-65.3833,-10.3833
bradypus_variegatus,-65.1333,-16.8
bradypus_variegatus,-63.6667,-17.45
bradypus_variegatus,-63.85,-17.4
Therecanbemultiplespeciesinthesamesamplesfile,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.
Doingarun
Simplypressthe“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.
Therunproducesanumberofoutputfiles,ofwhichthemostimportantisanhtmlfilecalled“bradypus.html”.Partofthisfilegivespointerstotheotheroutputs,likethis:
Lookingataprediction
Toseewhatother(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,wetlowlandareasofnorthwesternSouthAmerica,theAmazonbasin,Caribeanislands,andmuchoftheAtlanticforestsinsouth-easternBrazil.Thefilepointedtoisanimagefile(.png)thatyoucanjustclickon(inWindows)oropeninmostimageprocessingsoftware.
Thetestpointsarearandomsampletakenfromthespeciespresencelocalities.Testdatacanalternativelybeprovidedinaseparatefile,bytypingthenameofa“Testsamplefile”intheSettingspanel.Thetestsamplefilecanhavetestlocalitiesformultiplespecies.
Statisticalanalysis
The“25”weenteredfor“randomtestpercentage”toldtheprogramtorandomlysetaside25%ofthesamplerecordsfortesting.Thisallowstheprogramtodosomesimplestatisticalanalysis.Itplots(testingandtraining)omissionagainstthreshold,andpredictedareaagainstthreshold,aswellasthereceiveroperatingcurveshowbelow.TheareaundertheROCcurve(AUC)isshownhere,andiftestdataareavailable,thestandarderroroftheAUConthetestdataisgivenlateroninthewebpage.
Asecondkindofstatisticalanalysisthatisautomaticallydoneiftestdataareavailableisatestofthestatisticalsignificanceoftheprediction,usingabinomialtestofomission.ForBradypus,thisgives:
Whichvariablesmatter?
Togetasenseofwhichvariablesaremostimportantinthemodel,wecanrunajackknifetest,byselectingthe“Dojackknifetomeasurevariableimportant”checkbox.Whenwepressthe“Run”buttonagain,anumberofmodelsgetcreated.Eachvariableisexcludedinturn,andamodelcreatedwiththeremainingvariables.Thenamodeliscreatedusingeachvariableinisolation.Inaddition,amodeliscreatedusingallvariables,asbefore.Theresultsofthejackknifeappearinthe“bradypus.html”filesinthreebarcharts,andthefirstoftheseisshownbelow.
WeseethatifMaxentusesonlypre6190_l1(averageJanuaryrainfall)itachievesalmostnogain,sothatvariableisnot(byitself)agoodpredictorofthedistributionofBradypus.Ontheotherhand,Octoberrainfall(pre6190_l10)isamuchbetterpredictor.Turningtothelighterbluebars,itappearsthatnovariablehasalotofusefulinformationthatisnotalreadycontainedintheothers,asomittingeachoneinturndidnotdecreasethetraininggainmuch.
Thebradypus_variegatus.htmlfilehastwomorejackknifeplots,usingtestgainandAUCinplaceoftraininggain.Thisallowstheimportanceofeachvariabletobemeasurebothintermsofthemodelfitontrainingdata,anditspredictiveabilityontestdata.
Howdoesthepredictiondependonthevariables?
Nowpressthe“Createresponsecurves”,deselectthejackknifeoption,andrerunthemodel.Thisresultsinthefollowingsectionbeingaddedtothe“bradypus_variegatus.html”file:
Eachofthethumbnailimagescanbeclickedontogetamoredetailedplot.Lookingatfrs6190_ann,weseethattheresponseishighestforfrs6190_ann=0,andisfairlyhighforvaluesoffrs6190_annbelowabout75.Beyondthatpoint,theresponsedropsoffsharply,reaching-50atthetopofthevariable’srange.
Sowhatdothevaluesonthey-axismean?
Themaxentmodelisanexponentialmodel,whichmeansthattheprobabilityassignedtoapixelisproportionaltotheexponentialofsomeadditivecombinationofthevariables.Theresponsecurveaboveshowsthecontributionoffrs6190_anntotheexponent.Adifferenceof50intheexponentishuge,sotheplotforfrs6190_annshowsaverystrongdropinpredictedsuitabilityforlargevaluesofthevariable.
Onatechnicalnote,ifwearemodelinginteractionsbetweenvariables(byusingproductfeatures)asweareforBradypushere,thentheresponsecurveforonevariablewilldependonthesettingsofothervariables.Inthiscase,theresponsecurvesgeneratedbytheprogramhaveallothervariablessettotheirmeanonthesetofpresencelocalities.
Notealsothatiftheenvironmentalvariablesarecorrelated,astheyarehere,theresponsecurvescanbemisleading.Iftwocloselycorrelatedvariableshavestrongresponsecurvesthatarenearopposites