Much of my computing involves the free statistical computing software "R" (I am a supporting member of the R Project, and have hosted a CRAN mirror).Over the years, I have occasionally required various R functions not in R's base package, and have written my own versions. There are doubtless better versions by others, in various packages. However, I have found it helpful to have these files easily available. They can either be read into R with e.g. "source('statdist.R')", or copied-and-pasted into an interactive R shell. Note: They were just written quickly, with no guarantee of correctness -- use at your own risk!
I provide the R procedures here (released under GPL), in case anyone else finds them useful too:
- statdist.R -- a function to compute the stationary distribution of a Markov chain
- drawchain.R -- a function to draw a Markov chain diagram
- matpow.R -- compute powers of a matrix
- invgamma.R -- functions related to the Inverse Gamma distribution
- mvn.R -- functions related to the Multivariate Normal distribution
- buffon.R -- a simple function to simulate the Buffon's Needle experiment
- plotfunction.R -- an alternative routine for plotting (non-vectorised) functions of one variable
- monsolve.R -- find a positive root of a (non-vectorised) increasing function
- integrateit.R -- a simple naive integration of (non-vectorised) one-dimensional functions
- primefactors.R -- a simple recursive function to return the prime factors of a positive integer
[contact me / Computing Page / Home Page]