My PRK eye surgery experience

In this post I’ll describe my PRK eye surgery experience and recovery.  I decided to post my story because leading up to my surgery I read many rosy stories online of fairly quick recovery timelines (ie; people being able to drive a day or few after surgery), and my recovery definitely does not fit that mould.  It doesn’t mean that I am unhappy with my decision to get surgery, but I think it’s good to be aware that PRK can potentially come with a fairly extended recovery period, and people considering it should conservatively book at least a week off of work, and expect their vision to be highly variable for several weeks.

Continue reading

Visits: 24746

Visual analytics application for rise/set azimuth of celestial bodies by latitude

I have created an online analytics application that calculates the rise/set azimuths of the Sun and Moon at various times in their calendrical cycle (which for the Sun takes one year, and for the Moon takes on average 18.6 years), along with the rise/set azimuths of all bright stars.  The application allows the user to select on the latitude of the site of interest, and also the date it was built (from 5000 BCE to 2000 CE).  It also allows the user to correct for the elevation angle of the horizon… particularly in hilly terrain, this can change the rise/set azimuth of celestial bodies significantly.  The application uses the Python pyephem package to calculate the rise/set azimuths, and the azimuths are corrected for refraction.

The application can be found at

An application with a more restricted range in latitude to latitudes in the Northern Hemisphere, which can be a bit easier to use for fine latitude adjustment for locations in that hemisphere can be found at

Note that “sunrise” and “moonrise” are calculated for the top of the disk hitting the horizon.  The Sun and the Moon each subtend approximately half a degree of arc, so to obtain the rise azimuth angle for the entire disk to just be visible, add 0.5 degrees to the elevation angle of the horizon in the application.



Visits: 3468

Graphical Monte Carlo method: choosing ranges over which to sample parameters

In this module we will discuss how to choose ranges over which to sample parameters using the graphical Monte Carlo method for fitting the parameters of a mathematical model to data.  We will also discuss the importance of using the Normal negative log-likelihood statistic (equivalent to Least Squares) when doing Least Squares fitting, rather than the Least Squares statistic itself.

Continue reading

Visits: 3667

Contagion models with non-exponentially distributed sojourn times in the infectious state

Compartmental models of infectious disease transmission inherently assume that the time spent (“sojourn time”) in the infectious state is Exponentially distributed.  As we will discuss in this module, this is a highly unrealistic assumption.  We will show that the “linear chain rule” can be used to incorporate more realistic probability distributions for state sojourn times into compartmental mathematical models.

Continue reading

Visits: 2981

Example LaTex and BibTex documents

In this module, I provide an example LaTex document that cites references within a BibTex file, and also includes examples of how to include equations, figures, and tables.

The files for this worked example can be found in my GitHub repository


The repository contains the main LaTex document example_latex.tex, along with the bibtex file example_latex.bib.  In order to compile the document, you also need to download the example_latex_histogram_plot.eps, which is the figure included in the file.  To compile the document, run LaTex once, then BibTex, then LaTex twice (which should resolve all references).

This should produce the file example_latex.pdf

Note that the encapsulated postscript (EPS) figure for the paper was produced with the R script example_latex.R  (you need to install the R extrafont library before running the script) The R script also shows you how to automatically output results from your analysis code that can be included as \newcommands in your latex file that allow you to copy and paste the results to your LaTex file so that reference those results in the text of your paper without having to manually transcribe numbers (which can lead to unnecessary transcription errors).

Visits: 2055

Data and R code repositories in GitHub

GitHub is a web-based version-control and collaboration platform for software developers.

Git, an open source code management system, is used to store the source code for a project and track the complete history of all changes to that code. It allows developers to collaborate on a project more effectively by providing tools for managing possibly conflicting changes from multiple developers. GitHub allows developers to change, adapt and improve software from its public repositories for free.  Repositories can have multiple collaborators and can be either public or private.

Continue reading

Visits: 3716