STAT 598Z - Introduction to Statistical Computing

(Jan 13, 2020 - May 02, 2020)

Syllabus Computer language/software: R
Textbooks:
  1. The R Student Companion by Brian Dennis, Chapman and Hall/CRC; see also Supplemental Website
  2. The C Programming Language (2nd Edition) by Brian W. Kernighan and Dennis M. Ritchie.

Description:

The course (offered in Spring 2014 and 2020) starts from the beginning of computing and assumes that the students have no computer programming background. It focuses on (1) computing concepts and programming skills in R at the level of the textbook entitled The R Student Companion by Brian Dennis, (2) basic computing concepts and programming skills in C, and (3) using R packages for data analysis.

Homework Assignments (Submit your your homework to Blackboard Learn at http://mycourses.purdue.edu):

Lectures (R Code):
    Part I

  1. 01/13/2020, Chapter 1 (BD). Installation and invocation of R, input/command and output (1, "hello world!", ls(...), help(...), and quit(...)), basic binary operators (+, -, *, /, ^), R objects (and object reference by name), and the function plot(...) for creating scatter or X-Y plots.

  2. Chapter 2 (BD). R scripts: create and save, run (using GUI and the source(...) function/command, find errors, use ls(...), objects(..), rm(...) functions, add comments, and derive and implement the LS methods for the linear model y = a + b*x + e.
  3. 01/29/2020, Chapter 3 (BD). R functions and evironments (and namespaces).
  4. Chapters 4 and 5 (BD).
    • Save and read the ERP data, read.table and write.table (see also readLines, writeLines, and scan functions) for input and output,
    • R expression, promise, lazy evaluation, and the substitute function,
    • R structures, matrices, and data frames (see also typeof and class functions).
  5. Chapters 6 (Loops) and 7 (Logic and Control) (BD).
    • Logical vectors and logical comparison operators (<, >, <=, >=, ==, !=, ampersand & for and , vertical bar | for or, exclamation ! for negation)
    • if(cond) expr
    • if(cond) cons.expr else alt.expr
    • for(var in seq) expr
    • while(cond) expr
    • repeat expr
    • break
    • next
  6. 02/19/2020, packages

    package.R

  7. 02/21/2020, plots and ggplot (R for data science)

    ggplot2.R

  8. 02/24/2020, R Markdown and Regular Expressions

    regex.R


    ... Under Construction...

    Examples: Fibonacci sequence, search path, Newton-Raphson and Line-search methods, [and the EM algorithm for bivariate normal incomplete data.]
  9. 02/26/2020, Chapters 11 (Matrix Arithmetic) and 12 (Systems of Linear Equations) (BD). R functions [and the Sweep operator]
  10. 03/04/2020, Chapter 14 (Probability and Simulation) (BD). R functions, the Acceptance and Rejection algorithm, [and the Metropolis-Hastings algorithm]

    Part II

  11. 03/11/2020, Parallel computing in R.
    • Creating an map of the world [of a single R session] by using the functions library(), attach(), search(), as.environment(), environment(), parent.env(), getNamespace(), loadedNamespaces(), and getNamespaceImports().
    • Visualizing R in action with the functions eval(), evalq(), local(), with(), quote(), bquote(), and parent.frame().
    • Input/Output with socketConnection.
    • Mastering inter-process communication (IPC) with the functions showConnections(), socketConnection(), socketSelect(), fifo(), writeLines(), readLines(), serialize(), and unserialize().
    • Installation of the experimental R package called DISC (for distributed iterative statistical computing); see the instruction, prepared by Glen DePalma.
  12. 03/25/2020, Parallel computing in R.
    • DISC: Master (and masterProxy), user, monitor, slave, fileServer, and slave process sessions.
  13. 04/01/2020, Parallel computing in R.
    • DISC: Distributed data mechanism, iterator and its applications, including mapReduce and iterativeMapReduce.

    Part III
  14. 04/08/2020, Programming in C: basics.
  15. 04/15/2020, Programming in C: calling C functions from R.
  16. 04/22/2020, Programming in C: intensive computional algorithms.
  17. 04/29/2020, JAVA and R: Rserve etc.