other

Miscellaneous

Everything that's not in another project.

Increasing probability of success

Problem You run a series of trials. Trials are independent of each other and any other results. The probability of success on a trial starts at 2% and increases linearly / additively by 3% after each failure. The probability of success resets to 2% after a success; but this is irrelevant as you only run trials until you obtain a single success. Should you be interested in multiple successes then merely repeat the entire experiment exactly.

Miscellaneous useful code

R code Download code freely, but please remember where you got it. NB: Right click -> Save As Draw nice correlograms of a time series. Infinite hypothesis test problem generator. Function for finding the shortest interval from bootstraps or HPD interval from simulations. Function for calculating the sample skewness. Function that calculates the symmetric matrix square root of a positive definite matrix (such as covariance matrices). Example of using the manipulate function on a 2D graph.

Multiple lines on a graph example

What are we doing and why? We are just going to draw a graph in R with multiple lines on one graph. This is interesting because the way base R draws graphs is a bit strange to people who are used to other packages. Some explanation is useful. Specific example In this example we are going to use the lengths of the 25 most popular movies of each year from 1931 to 2013, as explained here bu Randy Olson.