Using Matrices in Go(lang)

In this post I’ll describe how to get started using gonum/matrix package for using matrices for math and stats applications. (Documentation here.) I’ll begin with a bit about setting up the Go environment drawn from the How to Write Code page on the Go website. (I highly recommend reading this if you’re unfamiliar with Go.) Next I’ll provide a commented usage case.

Continue reading Using Matrices in Go(lang)

Z-score Transform for Geostatistics

In this post I’ll present the z-score forward and backward transforms used in Sequential Gaussian Simulation, to be discussed at a later date. Some geostatistical algorithms assume that data is distributed normally, but interesting data is generally never normally distributed? Solution: force normality, or quasi-normality. All of this is loosely based on Clayton V. Deutsche’s work on the GSLIB library, and his books.

Continue reading Z-score Transform for Geostatistics

Traversing a Directory Tree in Python and Go(lang)

In this post I’ll discuss the basics of walking through a directory tree in Python and Go. If you are dealing with a smaller directory, it may be more convenient to use Python. If you are dealing with a larger directory containing hundreds of subdirectories and thousands of files, you may want to look into using Go, or another compiled language. I enjoy using Go because it compiles quickly, and it doesn’t use pointer arithmetic.

Continue reading Traversing a Directory Tree in Python and Go(lang)

Puzzle: The Wolf, the Goat, and the Cabbage

In this post I’ll present a solution to a puzzle using Python. I think the primary value of this post is that it provides an example of how to translate an objective and a set of constraints into data structures and functions that can be interpreted by a computer. This problem breaks down into two interrelated parts:

  1. Translate the problem into data structures and functions
  2. Choose a strategy for finding the solution

Continue reading Puzzle: The Wolf, the Goat, and the Cabbage

Remove a Partition on a USB Drive in Windows

If you create a bootable USB flash drive for installing linux on a machines, you may have trouble reformatting it later in Windows. It is possible to create a bootable USB in such a way that the Windows reformatting utility, obtained by right-clicking on the drive and selecting Format…, does not see the partition containing the bootloader. In such a situation, you may have a 8GB drive, but the reformatting utility only sees 6GB, and reformatting will not recover the original 8GB of space.

Continue reading Remove a Partition on a USB Drive in Windows

Using THREE.js to Visualize 3D Point Sets

In this post I’ll describe a bare bones application for inputting and displaying three dimensional data in browser. The data is input using HTML, where it is parsed with JavaScript, and then plotted using the THREE.js library. The input data is parsed using whitespace, so colleagues can copy-paste data from Excel into the fields for plotting.

Continue reading Using THREE.js to Visualize 3D Point Sets

Spatial Statistical Hypothesis Testing

In this post I’ll consider performing a local hypothesis test for a difference in means with spatial data. I do not know if this is the optimal way to go about this sort of thing, but I have not yet found another solution. I think the best way to describe the problem is to consider the artificial data, and then wade through the code.

Continue reading Spatial Statistical Hypothesis Testing

Classical Hypothesis Testing, Statistical Power, and Type-II Errors

This is one of the fundamental tasks in science. You do a study, and then you have to determine if there is a statistically meaningful difference between the test and control data. It is important to be able to understand the hypothesis testing, because a lot of interesting functions in R are hypothesis tests. I’ll consider the simple z-test for testing whether the mean of the simple is the same as the hypothesized mean of the population. We’ll see how statistical power, which is the probability of detecting a difference in means, changes with sample size and effect size, which is the size of the difference between the observed sample mean, and the hypothesized population mean. We’ll also see that the significance level \alpha is comparable to the Type-II (false negative) error rate.

Continue reading Classical Hypothesis Testing, Statistical Power, and Type-II Errors