BIOS 735: Statistical Computing
Michael Wu
Lecture 18: Sorting Algorithms and Linear Algebra (1)
October 11, 2011
Michael Wu (Lecture 18)
BIOS 735
October 11, 2011
1 / 13
Runtime Analysis: Common Sorting Algorithms
Last class, we started talking about big
BIOS 735: Statistical Computing
Michael Wu
Lecture 17: Computer Arithmetic (2) and Omicron Notation
October 11, 2011
Michael Wu (Lecture 17)
BIOS 735
October 11, 2011
1 / 14
Computer Arithmetic: Example from Last Class
We can use a taylor series if |x | i
BIOS 735: Statistical Computing
Michael Wu
Lecture 16: Computer Arithmetic
October 11, 2011
Michael Wu (Lecture 16)
BIOS 735
October 11, 2011
1 / 13
Onward to Computational Statistics
Thus far, we have focused heavily on R programming:
R programming getti
BIOS 735: Statistical Computing
Michael Wu
Lecture 15: Basic GUIs
October 11, 2011
Michael Wu (Lecture 15)
BIOS 735
October 11, 2011
1 / 15
Graphical User Interfaces
A central goal of any statistical methodologist is (should be) to develop methods
that ar
BIOS 735: Statistical Computing
Michael Wu
Lecture 14: Basic R Graphics (Simple Plots)
October 11, 2011
Michael Wu (Lecture 14)
BIOS 735
October 11, 2011
1 / 14
Graphics in R
R has a lot of capabilities for making pretty pictures though some claim that MA
BIOS 735: Statistical Computing
Michael Wu
Lecture 13: Intro Creating R Packages
October 6, 2011
Michael Wu (Lecture 13)
BIOS 735
October 6, 2011
1 / 11
Comments: these notes were largely stolen from a range of online sources including
the R website, Frie
BIOS 735: Statistical Computing
Michael Wu
Lecture 12: Debugging and Timing
October 4, 2011
Michael Wu (Lecture 12)
BIOS 735
October 4, 2011
1 / 12
Debugging
(Almost) nobody is perfect: your code will have errors.
Sometimes your code dies or R tells you t
BIOS 735: Statistical Computing
Michael Wu
Lecture 11: Good Coding Practice and Development in R
September 29, 2011
Michael Wu (Lecture 11)
BIOS 735
September 29, 2011
1 / 14
Writing Code in R
Important aspects of the code that you write:
Code should work
BIOS 735: Statistical Computing
Michael Wu
(this lecture borrows heavily from Dr. Nicola Sartoris excellent tutorial)
Lecture 10: Data Analysis in R and Using Sweave
September 22, 2011
Michael Wu (Lecture 10)
BIOS 735
September 22, 2011
1/9
Data Analysis
The Interface between R and C
Q.Chad He
Department of Biostatistics
University of North Carolina at Chapel Hill
Sep 20, 2011
Interface
Outline
Motivation
A brief introduction to C
An example to call C in R
Some other issues
Interface
Why to call C in R?
R
BIOS 735: Statistical Computing
Michael Wu
Lecture 8: Function Examples
September 15, 2011
Michael Wu (Lecture 8)
BIOS 735
September 15, 2011
1/6
Writing a Function
When dening a funciton, there are three key components: the name, the arguments,
and the b
BIOS 735: Statistical Computing
Michael Wu
Lecture 7: More Text Processing, Intro to Regular Expressions, File I/O
September 13, 2011
Michael Wu (Lecture 7)
BIOS 735
September 13, 2011
1 / 16
Administrative Details
Homework 1 is out and has been updated (
BIOS 735: Statistical Computing
Michael Wu
Lecture 6: String Manipulation
September 8, 2011
Michael Wu (Lecture 6)
BIOS 735
September 8, 2011
1 / 12
String Manipulation
R is not necessarily the best tool for doing string processing (manipulation of
charac
BIOS 735: Statistical Computing
Michael Wu
Lecture 5: More Functional Programming and Intro to Programming
Structures
September 6, 2011
Michael Wu (Lecture 5)
BIOS 735
September 6, 2011
1 / 17
Functional Programming: Applying the Same Function to Vector,
BIOS 735: Statistical Computing
Michael Wu
Lecture 3: Data Frames, Factors and Tables
August 30, 2011
Michael Wu (Lecture 3)
BIOS 735
August 30, 2011
1/9
Data Frames
Practically: behave like Matrices (rows and columns), but columns can have
different mode
BIOS 735: Statistical Computing
Michael Wu
Lecture 2: Scalars, Vectors, Arrays, Matrices and Lists
August 25, 2011
Michael Wu (Lecture 2)
BIOS 735
August 25, 2011
1 / 25
R: What and why?
Scripted language for statistical data manipulation and analysis. Fo
BIOS 735: Statistical Computing
Michael Wu
Lecture 1
August 23, 2011
Statistical Computing vs. Computational Statistics?
Why am I teaching this class?
Because Michael K. asked me to.
Its important.
Computing plays a huge part in what we do, but traditiona
Bios 735: Statistical Computing
Homework 2
due: Tuesday, October 11, 2011
As discussed in class, R is a useful tool for analysis. However, we need to be careful
to ensure that our analyses are fully reproducible. A key tool in the movement
towards reprodu
Bios 735: Statistical Computing
Homework #1: part 1
due: Tuesday, September 22, 2011
1. Given a list (call it x) of vectors, each with the same mode and the same length,
write a function listToVector(x) that converts the list to a matrix.
2. Write a funct