Press "Enter" to skip to content

Month: November 2012

Even more minor updates

A few more quick updates to stay on the Monday/Thursday update schedule. I'll try to get some actual content up next week, but it might end up being placeholder comics.

I went through and updated all the media links from the website reorganisation by hand. There was probably an easier way, but I wanted to get it done.

Mendeley has been working well for organizing PDFs. I'm getting close to deciding to start relying on it. (I still want to try out some more features, though.)

The projects I'm working on for my REM courses are slowly coming along, as is updating the artwork for my advisor's grant. The DokuWiki I set up as a research logbook is working well. A little clunkier than I'd hoped (particularly with regard to tables), but I'm getting the hang of it. I've found a couple of useful plugins, and there are quite a few promising ones out there. I'll likely do a post about my research process in a few months as I settle in to a productive routine.

Lastly, this seems as good a time as any to mention a statistics comic that might be of interest. On 23 July 1994, Dilbert was about the median. It is a pretty decent comic that I've used before in teaching. However, I'm not able to post it here. I've secured permission either implicitly or explicitly to post all the comics on here, but Universal Uclick, the company that syndicates Dilbert, charges $50 to license the comic for use on a blog. This seems pretty reasonable I suppose, but I make nothing off this website and can't justify the expense. I would link to the comic, but Universal Uclick has a linking policy with which I have a philosophical disagreement. It isn't too difficult to find, though, and it is a good comic for teaching.

Also,  Happy Thanksgiving.

Leave a Comment

A few quick updates

I don't have anything exciting to post today, but I do want to keep up with my Monday/Thursday update cycle which dictates that something be posted today. So, here it goes:

Current Projects

  • I'm currently just doing some minor work for my advisor's grant
  • I'm working on a simulation study for class (quasi-experimental design)
  • I'm working on a proposal for a simulation study for a class (item response theory)
  • All of the other little side projects I'm always doing

Website Updates

  • I had originally install WordPress into my website's root folder. I finally got around to reorganizing the public_html folder this weekend.
    • I followed the instructions here and it worked pretty seamlessly. I was pleased
    • I also created made the path public_html/www.douglaswhitaker.com/wordpress and was able to make things work pretty easily by changing subdomain options in cPanel.
    • (Edit: I see some dead links and images now because wp-content is now at wordpress/wp-content. I'll update those later tonight.)
  • I installed DokuWiki at logbook.douglaswhitaker.com as private research logbook (works in progress, notes, etc.). It seems to work pretty well so far. I went with this over something like MediaWiki because the idea of plain text files storing the content was appealing (as opposed to a not-easily-read-by-humans database such as MySQL).

Other Quick Thoughts

  • I'm installing Cygwin with the hopes of being able to use curlftpfs+rsync to automatically backup my websites (I'm currently just periodically logging in via ftp and copying files over). We'll see how this goes. (Inspired by this thread on StackOverflow.)
  • I really dislike how Cygwin doesn't have broad-but-not-every-package groups of packages to add. I keep having to re-launch the setup.exe and add things in that I overlooked because of my inexperience. Only way to learn I guess.
  • Wikis are awesome. DokuWiki seems to work well for this goal (particularly because I might want to use it for collaborations in the foreseeable future), but for a single-user, offline Wiki I've had success with TiddlyWiki. I don't use it much now, but that's more for a lack of time to do the projects I was using it for and less to do with the software (which was quite good).
  • I'm trying to use Mendeley Desktop to organize my references. So far it is promising, but I'm not sold yet. (Not thrilled that it isn't open source and that one needs an (albeit free) account to use it.)
  • I judged a middle school science fair. It was... almost what I expected. Not many students seemed to understand variability or sampling error (about what I thought), but three of the 20 or so projects I looked at were really phenomenal. I'd love to keep doing this judging if I have time.
  • I've got some larger posts in the works, and enough comic posts in a scratch file to keep me going for a while, but I prefer to do comics no more often than every-other-post. But still, whatever it takes to keep the Monday/Thursday update cycle going.
Leave a Comment

Monte Carlo Tree Search in R

While I was working on my master's degree I took an introductory course in Monte Carlo methods (STA 6866 at UF). As is typical of grad school, a final project was required - in this case something related to a Monte Carlo method not covered in the course (we used Introduction to Monte Carlo Methods in R by Robert and Casella). I chose to do a brief report on and implementation of Monte Carlo Tree Search (MCTS).

The purpose of this post is not to introduce MCTS, but rather to post what I did for the project in case others find it useful. MCTS is a method that can be used to create an artificial intelligence (AI) for games (both video games and traditional games). As a proof-of-concept, I implemented MCTS as an AI for a game of Connect Four. (It was really 'Connect Three' on a 4x4 board due to computational constraints, but the concept remains the same and the code should generalize easily.) Connect Four is not an ideal use for the MCTS AI because it is a solved game (unlike Go or Chess). I chose to use Connect Four because it is easy to code in R, easy to play, and the purpose is to demonstrate the MCTS method for AI and not to create a truly competitive AI.

The relevant files are:

  • An R file that explains how to use the game and AI (OPEN-ME.R)
  • R code for the Connect Three/Four/K game (can choose Player 1 vs. Player 2, Player 1 vs. AI, or AI vs. AI) (connect-game-code.R)
  • R code for the MCTS AI (mcts-ai-avec-block.R contains deterministic code to make the AI play defensively if Player 1 can win in one move to make play more realistic; mcts-ai-sans-block.R does not contain the blocking code)
  • R code for a 'naive' AI (selects from the available moves without doing any weighting, coded for comparison purposes) (naive-ai.R)
  • A helper file previously detailed (pprint.R)
  • A file containing 25000 simulated games (giving this to the MCTS AI improves its performance) (BLR-4x4-AI1-24k.txt)
  • The report I wrote about MCTS for the class (pdf)

The report I wrote for class can be download here, and all of the other files are in one zip archive. If you found this useful, I'd love to hear about it. If you want me to do something else with this, also let me know.

A snippet of an a game being played in R.Update - December 8, 2014

It looks like the statistics department finally took down my old homepage. I've uploaded the files to this website instead. It may be worth repeating that this work was work done for a class, and, while I enjoyed doing it and learned a lot, I make no guarantees about the code or report.

1 Comment

A comic for bootstrapping

I figured that it would be good to spice things up with a webcomic from a source other than xkcd, Dinosaur Comics, or Tree Lobsters. This comic about bootstrapping is from the Irregular Webcomic!, a webcomic I only discovered after specifically looking for comics related to statistics.

Comic #2653
"No. 2653" - Copyright CC BY-NC-SA 3.0 by David Morgan-Mar, irregularwebcomic.net
keywords: bootstrap; bootstrapping; Poisson distribution; stochastic process;

One reason I am particularly fond of Irregular Webcomic! is the thorough explanations provided on comics that may not be accessible to all. If you follow the image link to the website, there is a good explanation of what the bootstrap process is.

Leave a Comment