']); _gaq.push(['_gat._forceSSL']); _gaq.push(['_trackPageview']); (function () { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })();

How You Can Improve Open Source Documentation

bakedcookie

I gave a talk at the end of the Ascend Project about my troubles with Open Source Documentation. I called the talk Cookie Crumbs.  Maybe I should of named it after the three Bears and Goldilocks.  Some documentation is too little, some too much. Here is what you can do to make it just right. I am assuming that you have a git hub account and use git.

Find a project repository on git hub . Read the documentation.

Fork the repo to your git hub account.

In a terminal window on your own computer make a folder for the cloned repo.

mkdir name_of_folder

cd into that folder

cd name_of_folder

In that directory at command prompt type in the text from SSH clone url box on the forked repository page.

git clone your_fork_SSH_clone_url_code

Next so that you can push code back to git hub you want to check out a branch. Give the branch the same name as the folder.

git checkout -b name_ of_branch

This command will also switch branches, an extra bonus.

This command makes your branch the master.

git branch -D master

Open the documentation that came with the clone repo in a text editor. Documentation often ends in .md for markdown. You want to use git hub flavored markdown.

Write , code whatever you think is necessary to fix the documentation. It can be as little as spelling and grammar errors, localization or as big as a fancy new tutorial.  When you are finished make sure you save the file into the folder for the checked out branch.

Now you are ready to push the code back to git hub.

Before you push check git status and commit anything that needs committing.

git status

git commit -m”message”

git push -u origin name_of_branch

Go to your forked repository on git hub and issue a pull request for the pushed committed code back to the original repository.  Hopefully your pull request is accepted.  If not the documentation is still in your forked repository ready to be found and used by someone.

 

Git Computer Commands

A list that I wrote for myself to remember the order of git commands to be executed in a terminal window. In others words what do I type first, then second.
git comes first. It is git something not something git.
Open a terminal window. CD to the folder you want to be in.
git init
git clone
git status (I have found it a good idea to type git status after every git command.)
git add
git log
git remote
git push
git checkout
git pull
What the commands are and do can be looked up on github.

Linear Algebra

linearalgebra9781461436119

Linear algebra book written by Peter Petersen published by Springer Publisher.

This book takes a different approach in presenting linear algebra.  It has five long chapter with lots of sections. Explains using  geometric drawings.

Chapter 1.13 does Gaussian elimination.

Chapter 2 is on Linear Operations. Covers  linear differential equations. Eigenvalues including a definition of the German word eigen.  Uses Gaussian elimination instead of determinants to find eigenvalues.

2.5 shows diagonalizability with Fibonacci Sequence as an example.

Chapter 3 is on inner product spaces. Including Quaternions, Cauchy-Schwarz, Triangle Inequality, OR Factorization, and Matrix Exponentials.

Chapter 4 covers Linear Operations on Inner Products. Including Polarization and Isometrics,. 4.3 is about Spectral Theorem.

4.9 Singular Value Decomposition.

Chapter 5 is on determinants. Using a geometric approach then an Algebraic approach.  Then uses the theory applied to the study of linear differential equations.

 

 

Linear Algebra and Linear Models

linmod9781447127383

Written by R.B. Bapat, published by Springer Publishing.

A Math Book. Not a code book. Sometimes it is useful to read a Math book. Reading a Math book helps you understand what went wrong with your code when all the syntax is correct but the results are a little strange. Knowing the math behind the code helps to figure out what is going on.
Complete with proofs this book on Linear Algebra covers a lot of material.
The proofs are useful in helping understand the language and why its used in Linear Algebra.

Chapter One covers the preliminaries of Linear Algebra. Covers basis and dimension, dim.
Chapter two covers rank, nonsingulars and Frobenuis Inequality.
Chapter three covers eigenvalues for the first time. In addition

Chapter five covers eigenvalues.
Chapter four covers generalized inverses, including Moore-Penrose inverse.

Chapter seven covers General Linear Model, GLM.
Chapter eight tests of linear hypothesis. Cochran’s Theory. A nice table on ANOVA 8.1

Chapter nine Linear Mixed Models.

 

Guide to Programming and Algorithms using R

algor9781447153276

Good book of useful algorithms programmed using R.

Written by Ozgur Ergul, published by Springer Publishing 2013.

I like how the book starts with cooking an omelette as an example of algorithm development.

Chapter 3.2.3 covers the Towers of Hanoi with detailed instructions and R code.

Chapter 4.5.1 is about the Traveling Salesman problem.

Chapter 6 has various sorting algorithms, Bubble sort, Insertion sort, and Quick sort. Table 6.1 is a comparison of the sorting methods.

Now I don’t have to figure out how to turn JAVA code into R code.

Chapter 7 has solutions of  linear systems of equations. Gaussian elimination, LU Factorization, Pivoting, Cholesky Factorization, and Gauss-Jordan elimination.

The book goes on with more useful information of file Processing.

Text Analysis with R for Students of Literature

 

text9783319031637Text Analysis with R for Students of Literature by Matthew L. Jockers, published by Springer.

This is a well written book on the topic of Text Analysis.  There is enough information to give you a good start using R.  Followed by easy to understand details about text analysis.

Covered in Chapter 6 type token ratio, TTR.

Chapter 7 hapex legomena, words that appear in frequency.

Chapter 8, KWIC Key word context. Including how to make a corpus.

Chapter 11, covers clustering. Chapter 12, classification Shows how to do crosstabs with xtabs function. Also SVM support Vector Machine.

Chapter 13 covers topic modeling.

This is a good book to have if you are doing text analysis.

 

Solving Differential Equations in R

difqr9783642280696

 

Solving Differential Equations in R
by Karline Soetaert, Jeff Cash and Francesca Mazzia
Published by Springer Press

The books’ package on CRAN is diffEq.

I happily read through this book on a Sunday afternoon. It is a straight forward book to use if you already understand differential equations and can program in R.  If either topic is new to you , learn them first then tackle this book.

It is much easier to code Euler’s and Newton’s method in R than the C and FORTRAN the code I originally used for these methods.

My favorite bit of code is the Elastica Problem in Chapter 11. The problem is a system of five differential equations describing an elastica in the x,y plane. Uses package bvpSolve. The package for solving boundary value problems.

Figure 2.4 page 37 is a nice chart of the main Families of IVP, Initial Value Problems solutions.

This book gives you the tools you need to solve differential equations in R.

 

An Introduction to Statistical Learning

statlearn9781461471370

with Applications in R
Series: Springer Texts in Statistics, Vol. 103
James, G., Witten, D., Hastie, T., Tibshirani, R.

The stated purpose of this book is to facilitate the transition of statistical learning to mainstream. To achieve this the book has it’s own website statlearning.com.  The website includes the R code for the book. The R package for the book is ISLR, which includes the data used in the book.

Introduction to Statistical learning does not replace Elements of Statistical Learning.  Instead it adds information by including more detail and R code to some of the topics in Elements of Statistical Learning.

The labs in the book are self contained and the code for them is on the website under the chapter headings.

Chapter 2.1.5 covers regression versus classification problems with good explanations  on what techniques to use for different types of data.

Good discussion on how use K-Nearest Neighbor, a non-parametric method.

Chapter 3.3.3 Potential Problems, covers common issues in fitting a linear regression model.

Chapter 7 covers splines in great detail. Then chapter 7 goes over Generalized Additive Models, GAM.

I am having a lot of fun playing with the code that goes with book.  I am glad that this was written.

Objects

I enjoy object oriented programming. How I can turn something into an object then do things with it, apply methods and other useful things with out explicitly typing long line of code like FORTRAN.
The other day I made a coding mistake in R.
example Take a data frame called dogfood and turn it into an object.
dog <- data(dogfood)

The correct way is:
dog <- data.frame(dogfood)

Upside down Bonnie to remind me not to forget part of the code

IMG_7645_edited-1