{"id":2447,"date":"2018-11-12T22:05:43","date_gmt":"2018-11-12T22:05:43","guid":{"rendered":"http:\/\/blogs.oregonstate.edu\/gemmlab\/?p=2447"},"modified":"2018-11-12T22:05:43","modified_gmt":"2018-11-12T22:05:43","slug":"hundreds-and-hundreds-and-hundreds-of-models-an-ecologists-love-for-programming","status":"publish","type":"post","link":"https:\/\/blogs.oregonstate.edu\/gemmlab\/2018\/11\/12\/hundreds-and-hundreds-and-hundreds-of-models-an-ecologists-love-for-programming\/","title":{"rendered":"Hundreds and hundreds and hundreds of models: An ecologist\u2019s love for programming"},"content":{"rendered":"<p><strong>By <a href=\"https:\/\/mmi.oregonstate.edu\/people\/dawn-barlow\">Dawn Barlow<\/a>, PhD student, Department of Fisheries &amp; Wildlife, Geospatial Ecology of Marine Megafauna Lab<\/strong><\/p>\n<p>When people hear that I study <a href=\"https:\/\/mmi.oregonstate.edu\/gemm-lab\/research-projects\/ecology-blue-whales-new-zealand\">blue whales<\/a>, they often ask me questions about what it\u2019s like to be close to the largest animal on the planet, where we do fieldwork, and what data we are interested in collecting. While <a href=\"http:\/\/blogs.oregonstate.edu\/gemmlab\/2017\/02\/22\/best-field-season-ever\/\">I love time at sea<\/a>, my view on a daily basis is rarely like this:<\/p>\n<figure id=\"attachment_2449\" aria-describedby=\"caption-attachment-2449\" style=\"width: 660px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/blogs.oregonstate.edu\/gemmlab\/files\/2018\/11\/RHIB_sunset_STB-e1542049099443.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-2449\" src=\"http:\/\/blogs.oregonstate.edu\/gemmlab\/files\/2018\/11\/RHIB_sunset_STB-1024x683.jpg\" alt=\"\" width=\"660\" height=\"440\" \/><\/a><figcaption id=\"caption-attachment-2449\" class=\"wp-caption-text\">Our small research vessel at sunset in New Zealand&#8217;s South Taranaki Bight at the end of a day of blue whale survey. Photo by D. Barlow.<\/figcaption><\/figure>\n<p>More often than not, it looks something like this:<a href=\"http:\/\/blogs.oregonstate.edu\/gemmlab\/files\/2018\/11\/R_screenshot-e1542049276319.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-2451\" src=\"http:\/\/blogs.oregonstate.edu\/gemmlab\/files\/2018\/11\/R_screenshot-1024x558.png\" alt=\"\" width=\"660\" height=\"360\" \/><\/a><\/p>\n<p>In my application letter to Dr. Leigh Torres, I wrote something along the lines of \u201cwhile I relish remote fieldwork, I also find great satisfaction in the analysis process.\u201d This statement is increasingly true for me as I grow more proficient in statistical modeling and computer programming. When excitedly telling my family about how I am trying to <a href=\"http:\/\/blogs.oregonstate.edu\/gemmlab\/2018\/07\/23\/cloudy-with-a-chance-of-blue-whales\/\">model relationships between oceanography, krill, whales, and satellite imagery<\/a>, I was asked what I meant by \u201cmodel\u201d. Put simply, a model is a formula or equation that we can use to describe a pattern. I have been told, \u201call models are wrong, but some models work.\u201d What does this mean? While we may never know exactly every pattern of whale feeding behavior, we can use the data we have to describe some of the important relationships. If our model performance is very good, then we have likely described most of what drives the patterns we see. If model performance is poor, then there is more to the pattern that we have not yet captured in either our data collection or in our analytical methods. Another common saying about models is, \u201cA model is only ever as good as the data you put into it.\u201d While we worked hard during field seasons to <a href=\"http:\/\/blogs.oregonstate.edu\/gemmlab\/2017\/02\/12\/love-plan-comes-together\/\">collect a myriad of data<\/a> about what could be influencing blue whale distribution patterns, we inevitably could not capture everything, nor do we know everything that should be measured.<\/p>\n<p>So, how do you go about finding the \u2018best\u2019 model? This question is what I\u2019ve been grappling with over the last several weeks. My goal is to describe the patterns in the krill that drive patterns in whale distribution, the patterns in oceanography that drive patterns in the krill, and the patterns in the oceanography that drive patterns in whale distribution. The thing is, we have many metrics to describe oceanographic patterns (surface temperature, mixed layer depth, strength of the thermocline, integral of fluorescence, to name just a few), as well as several metrics to describe the krill (number of aggregations, aggregation density, depth, and thickness). When I multiplied out how many possible combinations of predictor variables and parameters we\u2019re interested in modeling, I realized this meant running nearly 300 models in order to settle on the best ten. This is where programming comes in, I told myself, and caught my breath.<\/p>\n<p>I\u2019ve always loved languages. When I was much younger, I thought I might want to study linguistics. As a graduate student in wildlife science, the language I\u2019ve spent the most time learning, and come to love, is the statistical programming language <a href=\"https:\/\/www.r-project.org\/about.html\">R<\/a>. Just like any other language, R has syntax and structure. Like any other language, there are many ways in which to articulate something, to make a particular point or reach a particular end goal. Well-written code is sometimes described as \u201celegant\u201d, much like a well-articulated piece of writing. While I certainly do not consider myself \u201cfluent\u201d in R, it is a language I love learning. I like to think that the R scripts I write are an attempt to eloquently uncover and describe ecological patterns.<\/p>\n<p>Rather than running 300 models one by one, I wrote an R script to run many models at a time, and then sort the outputs by model performance. I may look at the five best models of 32 options in order to select one. But this is where Leigh reminds me to step back from the programming for a minute and put my ecologist hat back on. Insight on the part of the modeler is needed in order to discern between what are real ecological relationships and what are spurious correlations in the data. It may not be quite as simple as choosing the model with the highest explanatory power when my goal is to make ecological inferences.<\/p>\n<p>So, where does this leave me? Hundreds of models later, I am still not entirely sure which ones are best, although I\u2019ve narrowed it down considerably. My programming proficiency and confidence continue to grow, but that only goes so far in ecology. Knowledge of my study system is equally important. So my workflow lately goes something like this: write code, try to interpret model outputs, consider what I know about the oceanography of my study region, re-write code, re-interpret the revised results, and so on. Hopefully this iterative process is bringing us gradually closer to an understanding of the ecology of blue whales on a foraging ground\u2026 stay tuned.<\/p>\n<figure id=\"attachment_1865\" aria-describedby=\"caption-attachment-1865\" style=\"width: 660px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/blogs.oregonstate.edu\/gemmlab\/files\/2018\/02\/lunge2-e1517899825463.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-1865\" src=\"http:\/\/blogs.oregonstate.edu\/gemmlab\/files\/2018\/02\/lunge2-1024x637.jpg\" alt=\"\" width=\"660\" height=\"411\" \/><\/a><figcaption id=\"caption-attachment-1865\" class=\"wp-caption-text\">A blue whale lunges on an aggregation of krill in New Zealand&#8217;s South Taranaki Bight. Drone piloted by Todd Chandler.<\/figcaption><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>By Dawn Barlow, PhD student, Department of Fisheries &amp; Wildlife, Geospatial Ecology of Marine Megafauna Lab When people hear that I study blue whales, they often ask me questions about what it\u2019s like to be close to the largest animal on the planet, where we do fieldwork, and what data we are interested in collecting. &hellip; <a href=\"https:\/\/blogs.oregonstate.edu\/gemmlab\/2018\/11\/12\/hundreds-and-hundreds-and-hundreds-of-models-an-ecologists-love-for-programming\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Hundreds and hundreds and hundreds of models: An ecologist\u2019s love for programming<\/span><\/a><\/p>\n","protected":false},"author":8072,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[712807],"tags":[712808,1667,712899,712774,677522,513,200562,799,5],"class_list":["post-2447","post","type-post","status-publish","format-standard","hentry","category-new-zealand-blue-whales","tag-blue-whale","tag-data-analysis","tag-dawn-barlow","tag-distribution","tag-foraging-ecology","tag-marine-mammals","tag-new-zealand","tag-oceanography","tag-science"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/blogs.oregonstate.edu\/gemmlab\/wp-json\/wp\/v2\/posts\/2447","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.oregonstate.edu\/gemmlab\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.oregonstate.edu\/gemmlab\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/gemmlab\/wp-json\/wp\/v2\/users\/8072"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/gemmlab\/wp-json\/wp\/v2\/comments?post=2447"}],"version-history":[{"count":5,"href":"https:\/\/blogs.oregonstate.edu\/gemmlab\/wp-json\/wp\/v2\/posts\/2447\/revisions"}],"predecessor-version":[{"id":2455,"href":"https:\/\/blogs.oregonstate.edu\/gemmlab\/wp-json\/wp\/v2\/posts\/2447\/revisions\/2455"}],"wp:attachment":[{"href":"https:\/\/blogs.oregonstate.edu\/gemmlab\/wp-json\/wp\/v2\/media?parent=2447"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/gemmlab\/wp-json\/wp\/v2\/categories?post=2447"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/gemmlab\/wp-json\/wp\/v2\/tags?post=2447"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}