Course Materials Stat 370 Spring 2017

From Sean_Carver
Revision as of 16:21, 10 February 2017 by Carver (talk | contribs) (Day 6: Tuesday, February 7, 2017)
Jump to: navigation, search

Day 1: Tuesday, January 17, 2017

We had introductions and we went over the syllabus. We talked about our goals and dreams and reasons for taking this course. We also talked about our experience with R and with programming in general.

Remember No class next Friday (Inauguration Day).

Day 2: Tuesday, January 24, 2017

We talked about getting and installing R and RStudio. We discussed some of the panels within RStudio including the editor and the console. I showed you dynamic documents with R-Markdown. We wrote an R Script, and a dynamic document. We talked about Markov chains. I presented several project ideas concerning Markov chains, including applications to baseball, and neuroscience.

Day 3: Friday, January 27, 2017

I started by discussing a default project idea (click here). You are not required to follow this suggestion. Some students are already doing something else, and that is fine. Synergies with other projects, outside of this class, are encouraged.

After I discussed this project idea, we talked about calling and writing functions, and passing arguments to functions. We discussed required/positional arguments and optional/named arguments. The function getwd() was an example of one with no arguments. We talked about getting help...from Google and from the console with the ? and ?? commands. E.g. type "?getwd" for help on getwd() or "??topic" if you don't know the exact function name. We talked about operators such as + - * / and ^. We talked about variables, though we have more to discuss here. We talked about sampling from the vector c("HomeRun", "Single", "Double", "Triple", "Out").

Day 4: Tuesday, January 31, 2017

We did an introduction to Git and GitBash today. In GitBash we learned the commands "pwd", "ls", and "cd", plus three commands specific to git, "git init", "git add [file]", and "git commit -am "[message]". The brackets [...] and what is inside is replaced by what is indicated.

We did an lecture on Markov Chains. We presented an example of a traveler randomly selecting which city to visit next depending on what city they are currently in. We discussed transition probabilities and the transition probability matrix. A matrix was a two dimensional table of numbers. The entries have a row number and a column number. The rows indicate which city you travel from and the columns indicate which city you travel to. In Markov chains the nodes are called "states". In the traveler example, these are the cities. In baseball, the states include the information about which bases have runners and the number of outs.

Please read the first 5 pages of the "Modeling Baseball Using a Markov Chain" handout.

Day 5: Friday, February 3, 2017

Today we discussed variables and types of variables. The atomic types were logical, integer, numeric (double), character, complex and raw. We made vectors and lists and matrices, and arrays, and data frames with these atomic types. We talked about coercion of variables from one type to another. For instance TRUE + TRUE + FALSE is coerced to 2. We also talked about variables whose values were functions. We then moved to work on Git. We created a GitHub account and forked Max Albert's Baseball_R repository that includes the code for our textbook. We created a new branch in our repository, made a change, then tried to push the branch to our forked repository. Pushing the branch didn't work.

Day 6: Tuesday, February 7, 2017

Today we discussed: factors, custom classes, and data frames. I showed you the default datasets in R. We spent a little more time on GitHub, including figuring out how do create new branches. Then I discussed model selection, and passed out a printout of my code called KLI in R for estimating the number of samples needed for model selection with confidence.

Day 7: Friday, February 10, 2017

Today we will have a homework assignment: Homework 01.