Introduction to the R Language
|
|
|
- Marybeth Walters
- 9 years ago
- Views:
Transcription
1 Introduction to the R Language Functions Biostatistics
2 Functions Functions are created using the function() directive and are stored as R objects just like anything else. In particular, they are R objects of class function. f <- function(<arguments>) { ## Do something interesting } Functions in R are first class objects, which means that they can be treated much like any other R object. Importantly, Functions can be passed as arguments to other functions Functions can be nested, so that you can define a function inside of another function The return value of a function is the last expression in the function body to be evaluated.
3 Function Arguments Functions have named arguments which potentially have default values. The formal arguments are the arguments included in the function definition The formals function returns a list of all the formal arguments of a function Not every function call in R makes use of all the formal arguments Function arguments can be missing or might have default values
4 Argument Matching R functions arguments can be matched positionally or by name. So the following calls to sd are all equivalent > mydata <- rnorm(100) > sd(mydata) > sd(x = mydata) > sd(x = mydata, na.rm = FALSE) > sd(na.rm = FALSE, x = mydata) > sd(na.rm = FALSE, mydata) Even though it s legal, I don t recommend messing around with the order of the arguments too much, since it can lead to some confusion.
5 Argument Matching You can mix positional matching with matching by name. When an argument is matched by name, it is taken out of the argument list and the remaining unnamed arguments are matched in the order that they are listed in the function definition. > args(lm) function (formula, data, subset, weights, na.action, method = "qr", model = TRUE, x = FALSE, y = FALSE, qr = TRUE, singular.ok = TRUE, contrasts = NULL, offset,...) The following two calls are equivalent. lm(data = mydata, y ~ x, model = FALSE, 1:100) lm(y ~ x, mydata, 1:100, model = FALSE)
6 Argument Matching Most of the time, named arguments are useful on the command line when you have a long argument list and you want to use the defaults for everything except for an argument near the end of the list Named arguments also help if you can remember the name of the argument and not its position on the argument list (plotting is a good example).
7 Argument Matching Function arguments can also be partially matched, which is useful for interactive work. The order of operations when given an argument is 1 Check for exact match for a named argument 2 Check for a partial match 3 Check for a positional match
8 Defining a Function f <- function(a, b = 1, c = 2, d = NULL) { } In addition to not specifying a default value, you can also set an argument value to NULL.
9 Lazy Evaluation Arguments to functions are evaluated lazily, so they are evaluated only as needed. f <- function(a, b) { a^2 } f(2) This function never actually uses the argument b, so calling f(2) will not produce an error because the 2 gets positionally matched to a.
10 Lazy Evaluation Another example f <- function(a, b) { print(a) print(b) } > f(45) [1] 45 Error in print(b) : argument "b" is missing, with no defaul > Notice that 45 got printed first before the error was triggered. This is because b did not have to be evaluated until after print(a). Once the function tried to evaluate print(b) it had to throw an error.
11 The... Argument The... argument indicate a variable number of arguments that are usually passed on to other functions.... is often used when extending another function and you don t want to copy the entire argument list of the original function myplot <- function(x, y, type = "l",...) { plot(x, y, type = type,...) } Generic functions use... so that extra arguments can be passed to methods (more on this later). > mean function (x,...) UseMethod("mean")
12 The... Argument The... argument is also necessary when the number of arguments passed to the function cannot be known in advance. > args(paste) function (..., sep = " ", collapse = NULL) > args(cat) function (..., file = "", sep = " ", fill = FALSE, labels = NULL, append = FALSE)
13 Arguments Coming After the... Argument One catch with... is that any arguments that appear after... on the argument list must be named explicitly and cannot be partially matched. > args(paste) function (..., sep = " ", collapse = NULL) > paste("a", "b", sep = ":") [1] "a:b" > paste("a", "b", se = ":") [1] "a b :"
14 A Diversion on Binding Values to Symbol How does R know which value to assign to which symbol? When I type > lm <- function(x) { x * x } > lm function(x) { x * x } how does R know what value to assign to the symbol lm? Why doesn t it give it the value of lm that is in the stats package?
15 A Diversion on Binding Values to Symbol When R tries to bind a value to a symbol, it searches through a series of environments to find the appropriate value. When you are working on the command line and need to retrieve the value of an R object, the order is roughly 1 Search the global environment for a symbol name matching the one requested. 2 Search the namespaces of each of the packages on the search list The search list can be found by using the search function. > search() [1] ".GlobalEnv" "package:stats" "package:graphi [4] "package:grdevices" "package:utils" "package:datase [7] "package:methods" "Autoloads" "package:base"
16 Binding Values to Symbol The global environment or the user s workspace is always the first element of the search list and the base package is always the last. The order of the packages on the search list matters! User s can configure which packages get loaded on startup so you cannot assume that there will be a set list of packages available. When a user loads a package with library the namespace of that package gets put in position 2 of the search list (by default) and everything else gets shifted down the list. Note that R has separate namespaces for functions and non-functions so it s possible to have an object named c and a function named c.
17 Scoping Rules The scoping rules for R are the main feature that make it different from the original S language. The scoping rules determine how a value is associated with a free variable in a function R uses lexical scoping or static scoping. A common alternative is dynamic scoping. Related to the scoping rules is how R uses the search list to bind a value to a symbol Lexical scoping turns out to be particularly useful for simplifying statistical computations
18 Lexical Scoping Consider the following function. f <- function(x, y) { x^2 + y / z } This function has 2 formal arguments x and y. In the body of the function there is another symbol z. In this case z is called a free variable. The scoping rules of a language determine how values are assigned to free variables. Free variables are not formal arguments and are not local variables (assigned insided the function body).
19 Lexical Scoping Lexical scoping in R means that the values of free variables are searched for in the environment in which the function was defined. What is an environment? An environment is a collection of (symbol, value) pairs, i.e. x is a symbol and 3.14 might be its value. Every environment has a parent environment; it is possible for an environment to have multiple children the only environment without a parent is the empty environment A function + an environment = a closure or function closure.
20 Lexical Scoping Searching for the value for a free variable: If the value of a symbol is not found in the environment in which a function was defined, then the search is continued in the parent environment. The search continues down the sequence of parent environments until we hit the top-level environment; this usually the global environment (workspace) or the namespace of a package. After the top-level environment, the search continues down the search list until we hit the empty environment. If a value for a given symbol cannot be found once the empty environment is arrived at, then an error is thrown.
21 Lexical Scoping Why does all this matter? Typically, a function is defined in the global environment, so that the values of free variables are just found in the user s workspace This behavior is logical for most people and is usually the right thing to do However, in R you can have functions defined inside other functions Languages like C don t let you do this Now things get interesting In this case the environment in which a function is defined is the body of another function!
22 Lexical Scoping make.power <- function(n) { pow <- function(x) { x^n } pow } This function returns another function as its value. > cube <- make.power(3) > square <- make.power(2) > cube(3) [1] 27 > square(3) [1] 9
23 Exploring a Function Closure What s in a function s environment? > ls(environment(cube)) [1] "n" "pow" > get("n", environment(cube)) [1] 3 > ls(environment(square)) [1] "n" "pow" > get("n", environment(square)) [1] 2
24 Lexical vs. Dynamic Scoping y <- 10 f <- function(x) { y <- 2 y^2 + g(x) } g <- function(x) { x * y } What is the value of f(3)
25 Lexical vs. Dynamic Scoping With lexical scoping the value of y in the function g is looked up in the environment in which the function was defined, in this case the global environment, so the value of y is 10. With dynamic scoping, the value of y is looked up in the environment from which the function was called (sometimes referred to as the calling environment). In R the calling environment is known as the parent frame So the value of y would be 2.
26 Lexical vs. Dynamic Scoping When a function is defined in the global environment and is subsequently called from the global environment, then the defining environment and the calling environment are the same. This can sometimes give the appearance of dynamic scoping. > g <- function(x) { + a <- 3 + x + a + y + } > g(2) Error in g(2) : object "y" not found > y <- 3 > g(2) [1] 8
27 Other Languages Other languages that support lexical scoping Scheme Perl Python Common Lisp (all languages converge to Lisp)
28 Consequences of Lexical Scoping In R, all objects must be stored in memory All functions must carry a pointer to their respective defining environments, which could be anywhere
29 Application: Optimization Why is any of this information useful? Optimization routines in R like optim, nlm, and optimize require you to pass a function whose argument is a vector of parameters (e.g. a log-likelihood) However, an object function might depend on a host of other things besides its parameters (like data) When writing software which does optimization, it may be desirable to allow the user to hold certain parameters fixed
30 Maximizing a Normal Likelihood Write a constructor function make.negloglik <- function(data, fixed=c(false,false)) { params <- fixed function(p) { params[!fixed] <- p mu <- params[1] sigma <- params[2] a <- -0.5*length(data)*log(2*pi*sigma^2) b <- -0.5*sum((data-mu)^2) / (sigma^2) -(a + b) } } Note: Optimization functions in R minimize functions, so you need to use the negative log-likelihood.
31 Maximizing a Normal Likelihood > set.seed(1); normals <- rnorm(100, 1, 2) > nll <- make.negloglik(normals) > nll function(p) { params[!fixed] <- p mu <- params[1] sigma <- params[2] a <- -0.5*length(data)*log(2*pi*sigma^2) b <- -0.5*sum((data-mu)^2) / (sigma^2) -(a + b) } <environment: 0x165b1a4> > ls(environment(nll)) [1] "data" "fixed" "params"
32 Estimating Parameters > optim(c(mu = 0, sigma = 1), nll)$par mu sigma Fixing σ = 2 > nll <- make.negloglik(normals, c(false, 2)) > optimize(nll, c(-1, 3))$minimum [1] Fixing µ = 1 > nll <- make.negloglik(normals, c(1, FALSE)) > optimize(nll, c(1e-6, 10))$minimum [1]
33 Plotting the Likelihood nll <- make.negloglik(normals, c(1, FALSE)) x <- seq(1.7, 1.9, len = 100) y <- sapply(x, nll) plot(x, exp(-(y - min(y))), type = "l") nll <- make.negloglik(normals, c(false, 2)) x <- seq(0.5, 1.5, len = 100) y <- sapply(x, nll) plot(x, exp(-(y - min(y))), type = "l")
34 Plotting the Likelihood exp( (y min(y))) x
35 Plotting the Likelihood exp( (y min(y))) x
36 Lexical Scoping Summary Objective functions can be built which contain all of the necessary data for evaluating the function. No need to carry around long argument lists useful for interactive and exploratory work. Code can be simplified and cleaned up and compartmentalized. Reference: Robert Gentleman and Ross Ihaka (2000). Lexical Scope and Statistical Computing, JCGS, 9,
Controlling and Managing Your R Workspace
1 Controlling and Managing Your R Workspace This guide provides an overview of the R Workspace and R Environment including its basic logic and structure. The goal is to develop an understanding of how
R Language Fundamentals
R Language Fundamentals Data Types and Basic Maniuplation Steven Buechler Department of Mathematics 276B Hurley Hall; 1-6233 Fall, 2007 Outline Where did R come from? Overview Atomic Vectors Subsetting
C++ INTERVIEW QUESTIONS
C++ INTERVIEW QUESTIONS http://www.tutorialspoint.com/cplusplus/cpp_interview_questions.htm Copyright tutorialspoint.com Dear readers, these C++ Interview Questions have been designed specially to get
Semantic Analysis: Types and Type Checking
Semantic Analysis Semantic Analysis: Types and Type Checking CS 471 October 10, 2007 Source code Lexical Analysis tokens Syntactic Analysis AST Semantic Analysis AST Intermediate Code Gen lexical errors
Mean, Median, Standard Deviation Prof. McGahagan Stat 1040
Mean, Median, Standard Deviation Prof. McGahagan Stat 1040 Mean = arithmetic average, add all the values and divide by the number of values. Median = 50 th percentile; sort the data and choose the middle
2 Sample t-test (unequal sample sizes and unequal variances)
Variations of the t-test: Sample tail Sample t-test (unequal sample sizes and unequal variances) Like the last example, below we have ceramic sherd thickness measurements (in cm) of two samples representing
Package uptimerobot. October 22, 2015
Type Package Version 1.0.0 Title Access the UptimeRobot Ping API Package uptimerobot October 22, 2015 Provide a set of wrappers to call all the endpoints of UptimeRobot API which includes various kind
public static void main(string[] args) { System.out.println("hello, world"); } }
Java in 21 minutes hello world basic data types classes & objects program structure constructors garbage collection I/O exceptions Strings Hello world import java.io.*; public class hello { public static
The R Environment. A high-level overview. Deepayan Sarkar. 22 July 2013. Indian Statistical Institute, Delhi
The R Environment A high-level overview Deepayan Sarkar Indian Statistical Institute, Delhi 22 July 2013 The R language ˆ Tutorials in the Astrostatistics workshop will use R ˆ...in the form of silent
TI-Inspire manual 1. Instructions. Ti-Inspire for statistics. General Introduction
TI-Inspire manual 1 General Introduction Instructions Ti-Inspire for statistics TI-Inspire manual 2 TI-Inspire manual 3 Press the On, Off button to go to Home page TI-Inspire manual 4 Use the to navigate
Stack Allocation. Run-Time Data Structures. Static Structures
Run-Time Data Structures Stack Allocation Static Structures For static structures, a fixed address is used throughout execution. This is the oldest and simplest memory organization. In current compilers,
Package EstCRM. July 13, 2015
Version 1.4 Date 2015-7-11 Package EstCRM July 13, 2015 Title Calibrating Parameters for the Samejima's Continuous IRT Model Author Cengiz Zopluoglu Maintainer Cengiz Zopluoglu
Moving from CS 61A Scheme to CS 61B Java
Moving from CS 61A Scheme to CS 61B Java Introduction Java is an object-oriented language. This document describes some of the differences between object-oriented programming in Scheme (which we hope you
R Language Definition
R Language Definition Version 3.2.3 (2015-12-10) DRAFT R Core Team This manual is for R, version 3.2.3 (2015-12-10). Copyright c 2000 2015 R Core Team Permission is granted to make and distribute verbatim
Package MDM. February 19, 2015
Type Package Title Multinomial Diversity Model Version 1.3 Date 2013-06-28 Package MDM February 19, 2015 Author Glenn De'ath ; Code for mdm was adapted from multinom in the nnet package
The C Programming Language course syllabus associate level
TECHNOLOGIES The C Programming Language course syllabus associate level Course description The course fully covers the basics of programming in the C programming language and demonstrates fundamental programming
TI-Inspire manual 1. I n str uctions. Ti-Inspire for statistics. General Introduction
TI-Inspire manual 1 I n str uctions Ti-Inspire for statistics General Introduction TI-Inspire manual 2 General instructions Press the Home Button to go to home page Pages you will use the most #1 is a
Not agree with bug 3, precision actually was. 8,5 not set in the code. Not agree with bug 3, precision actually was
Task 1 Task 2 Task 3 Feedback Presence SUM Matrikkel Rühm [5] [1] [2] [1] [1] [10] Feedback to students A64129 1. rühm 0 0 No submission found A72068 1. rühm 5 1 2 1 1 For Bug 3. Actually the variable
HYPOTHESIS TESTING: POWER OF THE TEST
HYPOTHESIS TESTING: POWER OF THE TEST The first 6 steps of the 9-step test of hypothesis are called "the test". These steps are not dependent on the observed data values. When planning a research project,
Programming Languages CIS 443
Course Objectives Programming Languages CIS 443 0.1 Lexical analysis Syntax Semantics Functional programming Variable lifetime and scoping Parameter passing Object-oriented programming Continuations Exception
E(y i ) = x T i β. yield of the refined product as a percentage of crude specific gravity vapour pressure ASTM 10% point ASTM end point in degrees F
Random and Mixed Effects Models (Ch. 10) Random effects models are very useful when the observations are sampled in a highly structured way. The basic idea is that the error associated with any linear,
5 Correlation and Data Exploration
5 Correlation and Data Exploration Correlation In Unit 3, we did some correlation analyses of data from studies related to the acquisition order and acquisition difficulty of English morphemes by both
NewsletterAdmin 2.4 Setup Manual
NewsletterAdmin 2.4 Setup Manual Updated: 7/22/2011 Contact: [email protected] Contents Overview... 2 What's New in NewsletterAdmin 2.4... 2 Before You Begin... 2 Testing and Production...
Lecture 2 Notes: Flow of Control
6.096 Introduction to C++ January, 2011 Massachusetts Institute of Technology John Marrero Lecture 2 Notes: Flow of Control 1 Motivation Normally, a program executes statements from first to last. The
Inside the Java Virtual Machine
CS1Bh Practical 2 Inside the Java Virtual Machine This is an individual practical exercise which requires you to submit some files electronically. A system which measures software similarity will be used
Machine-Code Generation for Functions
Machine-Code Generation for Functions Cosmin Oancea [email protected] University of Copenhagen December 2012 Structure of a Compiler Programme text Lexical analysis Binary machine code Symbol sequence
Package cpm. July 28, 2015
Package cpm July 28, 2015 Title Sequential and Batch Change Detection Using Parametric and Nonparametric Methods Version 2.2 Date 2015-07-09 Depends R (>= 2.15.0), methods Author Gordon J. Ross Maintainer
Answer Key for California State Standards: Algebra I
Algebra I: Symbolic reasoning and calculations with symbols are central in algebra. Through the study of algebra, a student develops an understanding of the symbolic language of mathematics and the sciences.
STEP BY STEP to Build the Application 1. Start a. Open a MvvmLight (WPF4) application and name it MvvmControlChange.
Application Description This MVVM WPF application includes a WPF Window with a contentcontrol and multiple UserControls the user can navigate between with button controls. The contentcontrols will have
Python Lists and Loops
WEEK THREE Python Lists and Loops You ve made it to Week 3, well done! Most programs need to keep track of a list (or collection) of things (e.g. names) at one time or another, and this week we ll show
Introduction to Web Services
Department of Computer Science Imperial College London CERN School of Computing (icsc), 2005 Geneva, Switzerland 1 Fundamental Concepts Architectures & escience example 2 Distributed Computing Technologies
Computational Mathematics with Python
Boolean Arrays Classes Computational Mathematics with Python Basics Olivier Verdier and Claus Führer 2009-03-24 Olivier Verdier and Claus Führer Computational Mathematics with Python 2009-03-24 1 / 40
Sudoku puzzles and how to solve them
Sudoku puzzles and how to solve them Andries E. Brouwer 2006-05-31 1 Sudoku Figure 1: Two puzzles the second one is difficult A Sudoku puzzle (of classical type ) consists of a 9-by-9 matrix partitioned
How To Program In Scheme (Prolog)
The current topic: Scheme! Introduction! Object-oriented programming: Python Functional programming: Scheme! Introduction Next up: Numeric operators, REPL, quotes, functions, conditionals Types and values
csce4313 Programming Languages Scanner (pass/fail)
csce4313 Programming Languages Scanner (pass/fail) John C. Lusth Revision Date: January 18, 2005 This is your first pass/fail assignment. You may develop your code using any procedural language, but you
An overview of FAT12
An overview of FAT12 The File Allocation Table (FAT) is a table stored on a hard disk or floppy disk that indicates the status and location of all data clusters that are on the disk. The File Allocation
Implementing Specialized Data Capture Applications with InVision Development Tools (Part 2)
Implementing Specialized Data Capture Applications with InVision Development Tools (Part 2) [This is the second of a series of white papers on implementing applications with special requirements for data
Semester Review. CSC 301, Fall 2015
Semester Review CSC 301, Fall 2015 Programming Language Classes There are many different programming language classes, but four classes or paradigms stand out:! Imperative Languages! assignment and iteration!
First Java Programs. V. Paúl Pauca. CSC 111D Fall, 2015. Department of Computer Science Wake Forest University. Introduction to Computer Science
First Java Programs V. Paúl Pauca Department of Computer Science Wake Forest University CSC 111D Fall, 2015 Hello World revisited / 8/23/15 The f i r s t o b l i g a t o r y Java program @author Paul Pauca
3.GETTING STARTED WITH ORACLE8i
Oracle For Beginners Page : 1 3.GETTING STARTED WITH ORACLE8i Creating a table Datatypes Displaying table definition using DESCRIBE Inserting rows into a table Selecting rows from a table Editing SQL buffer
Functional Programming
FP 2005 1.1 3 Functional Programming WOLFRAM KAHL [email protected] Department of Computing and Software McMaster University FP 2005 1.2 4 What Kinds of Programming Languages are There? Imperative telling
Relational Databases
Relational Databases Jan Chomicki University at Buffalo Jan Chomicki () Relational databases 1 / 18 Relational data model Domain domain: predefined set of atomic values: integers, strings,... every attribute
JavaScript. JavaScript: fundamentals, concepts, object model. Document Object Model. The Web Page. The window object (1/2) The document object
JavaScript: fundamentals, concepts, object model Prof. Ing. Andrea Omicini II Facoltà di Ingegneria, Cesena Alma Mater Studiorum, Università di Bologna [email protected] JavaScript A scripting language:
Business Application
137 Germain CRT Validation Rules for Siebel CRM 7.7,7.8,8.0,8.1,8.2 Validation Rule Name Validation Rule Description Business Application Siebel Repository Level Improve CPU Improve Memory GS-SBL-REP-JDBC-1001
Introduction to Hypothesis Testing
I. Terms, Concepts. Introduction to Hypothesis Testing A. In general, we do not know the true value of population parameters - they must be estimated. However, we do have hypotheses about what the true
High-Level Programming Languages. Nell Dale & John Lewis (adaptation by Michael Goldwasser)
High-Level Programming Languages Nell Dale & John Lewis (adaptation by Michael Goldwasser) Low-Level Languages What are disadvantages of low-level languages? (e.g., machine code or assembly code) Programming
Storage Classes CS 110B - Rule Storage Classes Page 18-1 \handouts\storclas
CS 110B - Rule Storage Classes Page 18-1 Attributes are distinctive features of a variable. Data type, int or double for example, is an attribute. Storage class is another attribute. There are four storage
13 Classes & Objects with Constructors/Destructors
13 Classes & Objects with Constructors/Destructors 13.1 Introduction In object oriented programming, the emphasis is on data rather than function. Class is a way that binds the data & function together.
Exercise 1: Python Language Basics
Exercise 1: Python Language Basics In this exercise we will cover the basic principles of the Python language. All languages have a standard set of functionality including the ability to comment code,
Java Memory Model: Content
Java Memory Model: Content Memory Models Double Checked Locking Problem Java Memory Model: Happens Before Relation Volatile: in depth 16 March 2012 1 Java Memory Model JMM specifies guarantees given by
1 Introduction. 2 An Interpreter. 2.1 Handling Source Code
1 Introduction The purpose of this assignment is to write an interpreter for a small subset of the Lisp programming language. The interpreter should be able to perform simple arithmetic and comparisons
Assignment 2: Option Pricing and the Black-Scholes formula The University of British Columbia Science One CS 2015-2016 Instructor: Michael Gelbart
Assignment 2: Option Pricing and the Black-Scholes formula The University of British Columbia Science One CS 2015-2016 Instructor: Michael Gelbart Overview Due Thursday, November 12th at 11:59pm Last updated
The Needle Programming Language
The Needle Programming Language The Needle Programming Language 1 What is Needle? Needle is an object-oriented functional programming language with a multimethod-based OO system, and a static type system
Classes and Objects in Java Constructors. In creating objects of the type Fraction, we have used statements similar to the following:
In creating objects of the type, we have used statements similar to the following: f = new (); The parentheses in the expression () makes it look like a method, yet we never created such a method in our
Time Series Analysis
Time Series Analysis [email protected] Informatics and Mathematical Modelling Technical University of Denmark DK-2800 Kgs. Lyngby 1 Outline of the lecture Identification of univariate time series models, cont.:
A binary search tree or BST is a binary tree that is either empty or in which the data element of each node has a key, and:
Binary Search Trees 1 The general binary tree shown in the previous chapter is not terribly useful in practice. The chief use of binary trees is for providing rapid access to data (indexing, if you will)
Boolean Expressions, Conditions, Loops, and Enumerations. Precedence Rules (from highest to lowest priority)
Boolean Expressions, Conditions, Loops, and Enumerations Relational Operators == // true if two values are equivalent!= // true if two values are not equivalent < // true if left value is less than the
Computational Mathematics with Python
Numerical Analysis, Lund University, 2011 1 Computational Mathematics with Python Chapter 1: Basics Numerical Analysis, Lund University Claus Führer, Jan Erik Solem, Olivier Verdier, Tony Stillfjord Spring
Computational Mathematics with Python
Computational Mathematics with Python Basics Claus Führer, Jan Erik Solem, Olivier Verdier Spring 2010 Claus Führer, Jan Erik Solem, Olivier Verdier Computational Mathematics with Python Spring 2010 1
6. Control Structures
- 35 - Control Structures: 6. Control Structures A program is usually not limited to a linear sequence of instructions. During its process it may bifurcate, repeat code or take decisions. For that purpose,
Logistic Regression. Jia Li. Department of Statistics The Pennsylvania State University. Logistic Regression
Logistic Regression Department of Statistics The Pennsylvania State University Email: [email protected] Logistic Regression Preserve linear classification boundaries. By the Bayes rule: Ĝ(x) = arg max
Visual Basic Programming. An Introduction
Visual Basic Programming An Introduction Why Visual Basic? Programming for the Windows User Interface is extremely complicated. Other Graphical User Interfaces (GUI) are no better. Visual Basic provides
CS 1133, LAB 2: FUNCTIONS AND TESTING http://www.cs.cornell.edu/courses/cs1133/2015fa/labs/lab02.pdf
CS 1133, LAB 2: FUNCTIONS AND TESTING http://www.cs.cornell.edu/courses/cs1133/2015fa/labs/lab02.pdf First Name: Last Name: NetID: The purpose of this lab is to help you to better understand functions:
Sources: On the Web: Slides will be available on:
C programming Introduction The basics of algorithms Structure of a C code, compilation step Constant, variable type, variable scope Expression and operators: assignment, arithmetic operators, comparison,
10 Listing data and basic command syntax
10 Listing data and basic command syntax Command syntax This chapter gives a basic lesson on Stata s command syntax while showing how to control the appearance of a data list. As we have seen throughout
IF The customer should receive priority service THEN Call within 4 hours PCAI 16.4
Back to Basics Backward Chaining: Expert System Fundamentals By Dustin Huntington Introduction Backward chaining is an incredibly powerful yet widely misunderstood concept, yet it is key to building many
Dataframes. Lecture 8. Nicholas Christian BIOST 2094 Spring 2011
Dataframes Lecture 8 Nicholas Christian BIOST 2094 Spring 2011 Outline 1. Importing and exporting data 2. Tools for preparing and cleaning datasets Sorting Duplicates First entry Merging Reshaping Missing
Lecture 3: Linear methods for classification
Lecture 3: Linear methods for classification Rafael A. Irizarry and Hector Corrada Bravo February, 2010 Today we describe four specific algorithms useful for classification problems: linear regression,
Chapter 5 More SQL: Complex Queries, Triggers, Views, and Schema Modification
Chapter 5 More SQL: Complex Queries, Triggers, Views, and Schema Modification Copyright 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 5 Outline More Complex SQL Retrieval Queries
IVI Configuration Store
Agilent Developer Network White Paper Stephen J. Greer Agilent Technologies, Inc. The holds information about IVI drivers installed on the computer and configuration information for an instrument system.
Chapter 15 Functional Programming Languages
Chapter 15 Functional Programming Languages Introduction - The design of the imperative languages is based directly on the von Neumann architecture Efficiency (at least at first) is the primary concern,
Learn Perl by Example - Perl Handbook for Beginners - Basics of Perl Scripting Language
Learn Perl by Example - Perl Handbook for Beginners - Basics of Perl Scripting Language www.freebsdonline.com Copyright 2006-2008 www.freebsdonline.com 2008/01/29 This course is about Perl Programming
Package neuralnet. February 20, 2015
Type Package Title Training of neural networks Version 1.32 Date 2012-09-19 Package neuralnet February 20, 2015 Author Stefan Fritsch, Frauke Guenther , following earlier work
Exception Handling. Overloaded methods Interfaces Inheritance hierarchies Constructors. OOP: Exception Handling 1
Exception Handling Error handling in general Java's exception handling mechanism The catch-or-specify priciple Checked and unchecked exceptions Exceptions impact/usage Overloaded methods Interfaces Inheritance
No no-argument constructor. No default constructor found
Every software developer deals with bugs. The really tough bugs aren t detected by the compiler. Nasty bugs manifest themselves only when executed at runtime. Here is a list of the top ten difficult and
Sample- for evaluation purposes only. Advanced Crystal Reports. TeachUcomp, Inc.
A Presentation of TeachUcomp Incorporated. Copyright TeachUcomp, Inc. 2011 Advanced Crystal Reports TeachUcomp, Inc. it s all about you Copyright: Copyright 2011 by TeachUcomp, Inc. All rights reserved.
Exploratory Data Analysis and Plotting
Exploratory Data Analysis and Plotting The purpose of this handout is to introduce you to working with and manipulating data in R, as well as how you can begin to create figures from the ground up. 1 Importing
Two Related Samples t Test
Two Related Samples t Test In this example 1 students saw five pictures of attractive people and five pictures of unattractive people. For each picture, the students rated the friendliness of the person
Package HadoopStreaming
Package HadoopStreaming February 19, 2015 Type Package Title Utilities for using R scripts in Hadoop streaming Version 0.2 Date 2009-09-28 Author David S. Rosenberg Maintainer
Journal of Statistical Software
JSS Journal of Statistical Software October 2006, Volume 16, Code Snippet 3. http://www.jstatsoft.org/ LDheatmap: An R Function for Graphical Display of Pairwise Linkage Disequilibria between Single Nucleotide
WHERE DOES THE 10% CONDITION COME FROM?
1 WHERE DOES THE 10% CONDITION COME FROM? The text has mentioned The 10% Condition (at least) twice so far: p. 407 Bernoulli trials must be independent. If that assumption is violated, it is still okay
Creating Basic Excel Formulas
Creating Basic Excel Formulas Formulas are equations that perform calculations on values in your worksheet. Depending on how you build a formula in Excel will determine if the answer to your formula automatically
Surround SCM Best Practices
Surround SCM Best Practices This document addresses some of the common activities in Surround SCM and offers best practices for each. These best practices are designed with Surround SCM users in mind,
Stat 20: Intro to Probability and Statistics
Stat 20: Intro to Probability and Statistics Lecture 16: More Box Models Tessa L. Childers-Day UC Berkeley 22 July 2014 By the end of this lecture... You will be able to: Determine what we expect the sum
Psychology 205: Research Methods in Psychology
Psychology 205: Research Methods in Psychology Using R to analyze the data for study 2 Department of Psychology Northwestern University Evanston, Illinois USA November, 2012 1 / 38 Outline 1 Getting ready
Experimental Design. Power and Sample Size Determination. Proportions. Proportions. Confidence Interval for p. The Binomial Test
Experimental Design Power and Sample Size Determination Bret Hanlon and Bret Larget Department of Statistics University of Wisconsin Madison November 3 8, 2011 To this point in the semester, we have largely
Lesson 1: Comparison of Population Means Part c: Comparison of Two- Means
Lesson : Comparison of Population Means Part c: Comparison of Two- Means Welcome to lesson c. This third lesson of lesson will discuss hypothesis testing for two independent means. Steps in Hypothesis
Working with Databases
Chapter 22 Working with Databases Facebook has a database of every member s account information, friends list, and posts. Amazon has a database of just about everything you can buy. Google has a database
CmpSci 187: Programming with Data Structures Spring 2015
CmpSci 187: Programming with Data Structures Spring 2015 Lecture #12 John Ridgway March 10, 2015 1 Implementations of Queues 1.1 Linked Queues A Linked Queue Implementing a queue with a linked list is
Package tvm. R topics documented: August 21, 2015. Type Package Title Time Value of Money Functions Version 0.3.0 Author Juan Manuel Truppia
Type Package Title Time Value of Money Functions Version 0.3.0 Author Juan Manuel Truppia Package tvm August 21, 2015 Maintainer Juan Manuel Truppia Functions for managing cashflows
CS412/CS413. Introduction to Compilers Tim Teitelbaum. Lecture 20: Stack Frames 7 March 08
CS412/CS413 Introduction to Compilers Tim Teitelbaum Lecture 20: Stack Frames 7 March 08 CS 412/413 Spring 2008 Introduction to Compilers 1 Where We Are Source code if (b == 0) a = b; Low-level IR code
Calculating P-Values. Parkland College. Isela Guerra Parkland College. Recommended Citation
Parkland College A with Honors Projects Honors Program 2014 Calculating P-Values Isela Guerra Parkland College Recommended Citation Guerra, Isela, "Calculating P-Values" (2014). A with Honors Projects.
Name: Class: Date: 9. The compiler ignores all comments they are there strictly for the convenience of anyone reading the program.
Name: Class: Date: Exam #1 - Prep True/False Indicate whether the statement is true or false. 1. Programming is the process of writing a computer program in a language that the computer can respond to
COMP 356 Programming Language Structures Notes for Chapter 10 of Concepts of Programming Languages Implementing Subprograms.
COMP 356 Programming Language Structures Notes for Chapter 10 of Concepts of Programming Languages Implementing Subprograms 1 Activation Records activation declaration location Recall that an activation
