Syllabus

Software for Maximum Likelihood (RTMB version)

Author

Jim Bence

Published

4 December 2023

1 Course and Instructor Information

1.1 Instructor: Jim Bence

  • Quantitative Fisheries Center, Michigan State University
  • Office Hours: By appointment (online)
  • E-mail: bence@msu.edu

1.2 Class Times and Location:

  • Tuesday-Friday 10am - 12:30pm EST December 5-15
  • All sessions virtual (online) via Zoom via link information sent by email (if you need the link contact instructor).

1.3 Course Description

The course reviews probability theory and concepts and covers applications of fitting models by maximum likelihood using Template Model Builder (TMB) through RTMB.  RTMB is an R package that allows you to use TMB, a modern software tool for fitting of nonlinear and non-normal statistical models. TMB is particularly useful for models with random effects, including state space models, and is increasingly being used in fishery stock assessments, spatial models, and fitting of other ecological models. Developing models in TMB requires some knowledge of C++, but by using RTMB you can use TMB without learning C++ coding, although you will need to do computer programming in R.  My general expectation is you will have R and R-studio on your computer with the RTMB package installed. In general this should be straight-forward but if you run in to problems contact either the instructor or Charlie Belinsky (tech support). The class is synchronous and online.  There will be eight class meetings, each 2.5 hours in length. There is an expectation that students will review materials outside of lecture before the next lecture. While there will not be an excessive amount of outside work students should plan on ~ 1-2 hours after each session.

1.3.1 Technology requirements

The course will be taught using R Studio, R, TMB, and RTMB.  TMB will be automatically installed when you install the RTMB package. This software is all freely available.

1.5 Course Requirements

Laptop with a broadband internet connection

1.7 Course Structure and accessing class materials

Material will be presented in lecture/demo format via zoom, with hands on working sessions in breakout zoom rooms. These zoom rooms will allow the instructor to simulate like checking in with a few students at a time as exercises are worked on. Because the course materials are publically accessible, for security reasons the zoom link is not included here but is sent to enrolled students by email.

The course material will be available through a public GitHub site:

https://github.com/QFCatMSU/MLE-Software

Lectures will be recorded and loaded to:

https://mediaspace.msu.edu/channel/channelid/324238162

To access the recordings you will need your MSU ID/Guest Account

Prior to the course start you should have signed up for a guest ID for your email account. This is needed to allow you to access to the course media space (recording site) and to provide you library access.

1.8 Technical Assistance

If you need technical assistance during the course or to report a problem you can:

2 Course Objectives and Learning Outcomes

The primary learning objectives for this course are: - Develop basic background on the theory of maximum likelihood estimation including underlying probability and treatment of random effects, learn how numerical searches operate to find maximum likelihood estimates, learn about different approaches for assessing uncertainty associated with parameter estimates and quantities calculated from them, learn about how TMB operates, learn how to structure an estimation model in RTMB.

Learning outcomes:

By successfully completing this course, you should be able to:

  • Fit nonlinear models in RTMB assuming a range of different univariate and multivariate probability distributions

  • Fit models in RTMB that allow for random effects

  • Be able to assess uncertainty in through both asymptotic standard errors, profile likelihood confidence intervals, and by simulation

  • Understand the basic process of developing RTMB applications to arbitrarily complex alternative situations, although actually developing some such applications would require additional study (e.g., to learn about new probability distributions).

    You will meet the objectives listed above through a combination of the following activities in this course:

  • Attend all class sessions and participate in course activities

  • Come prepared for class sessions by reviewing prior materials and being ready with questions on areas of confusionS

    Presentation materials and recordings of the lecture parts of class essions will be made available to facilitate review. This is not a substitute for attending the interactive class sessions and students are expected to attend all sessions if at all possible and contact the instructor when a class cannot be attended.

3 Course Outline/Schedule

Important Note: This is only a preliminary plan and will be adjusted based on presentation expeirence and input from students. Refer to the course GitHub page and revieew recordings to stay up to date on what is happening if you must miss a session.

  • Session 1: Introduction
    • Introductions, statistical inference essentials, probability theory, what is maximum likelihood estimation.
    • Some basics of R for those who need it (loops, functions)
    • Hands on exercise in calculating the likelihood
    • The regression case (distinction of estimated and distributional parameters)
    • Ways of finding maximum likelihood estimates and basics of what RTMB does
  • Session 2: First use of RTMB and Derivatives
    • Walk through and modification of really simple RTMB program
    • Derivatives in more detail
    • Numerical searches and use of derivatives in searches and assessing uncertainty
  • Session 2.
    • Theory and practice fitting a nonlinear regression using RTMB.
    • Asymptotic standard errors and profile confidence intervals.
    • Using distributions other than normal
    • Example nonlinear regression by RTMB and modifications
  • Session 3.
    • Turning parameters off (not estimated) or on.
    • Bounds
    • More on uncertainty assessment in RTMB
  • Session 3b.
    • Additional examples of fitting models with different distributions (how many depends on how things progress)
  • Session 4.
    • Theory for random effects
    • Specifying random effects in RTMB
    • Worked example with a simple random effects
  • Session 5.
    • Simulation in presence of random effects in RTMB
    • Hands on work doing a complete simulation study
  • Session 6.
    • A state space example and its implementation in RTMB
    • The multivariate normal distribution and its implementation in RTMB
  • Sessions 7 and 8 will focus more on hands on applications and increasing exposure to range of models. It is likely that sessions 1-6 will not each be completed in a day so its uncertain how much more material will be presented here.

4 Course Engagement and Evaluation

This is a non-credit ungraded course. The instructor will provide certificates of completion for students who actively participate in the course, and cover all course material. Students who do not attend all sessions (or make arrangements with instructor to make sure they learn that material), or who do not engage in excercises and demonstrate that they are learning the material will not be awarded certificates of completion.

5 Course Policies

5.1 Communication and Openness

The coverage of materials will be adaptive and responsive to needs and input expressed by students. I can only do this effectively if you communicate what you understand and what needs more or different coverage. I also cannot cover additional topics of interest to you unless you let me know!

5.2 Diversity Equity and Inclusiveness

Diversity, Equity and Inclusion are important, interdependent components of everyday life and are critical to our pursuit of academic excellence. Our aim is to foster a culture where every one feels valued, supported and inspired. This includes providing opportunity and access for all people across differences of race, age, color, ethnicity, gender, sexual orientation, gender identity, gender expression, religion, national origin, migratory status, disability / abilities, political affiliation, veteran status and socioeconomic background. This statement is adapted from the college statement within which the QFC sits (See the full college statement: https://www.canr.msu.edu/news/canr-statement-on-diversity-equity-and-inclusion)

5.3 Commit to Integrity: Academic Honesty

Article 2.3.3 of the Academic Freedom Report states that “The student shares with the faculty the responsibility for maintaining the integrity of scholarship, grades, and professional standards.” In addition, the Fisheries and Wildlife Deaprtment adheres to the policies on academic honesty as specified in General Student Regulations 1.0, Protection of Scholarship and Grades; the all-University Policy on Integrity of Scholarship and Grades; and Ordinance 17.00, Examinations. (See Spartan Life: Student Handbook and Resource Guide.

5.4 Accommodations

Inform Your Instructor of Any Accommodations Needed

From the Resource Center for Persons with Disabilities (RCPD): Michigan State University is committed to providing equal opportunity for participation in all programs, services and activities. Requests for accommodations by persons with disabilities may be made by contacting the Resource Center for Persons with Disabilities at 517-884-RCPD or on the web at http://rcpd.msu.edu.