views:

69

answers:

3

I've got some free time and I'm looking to learn a programming language or two that I can use for computational modeling (I'm in cognitive science & psychology). I'm not sure if I'll end up doing neural nets, machine learning, AI, or something altogether different, so I'm just looking for a good, broad base to start with, like a nudge in the right direction. All I know is a little C, so I have a ways to go.

Could you recommend any programming languages that are commonly used in labs doing computational work? I'm hoping to use what I learn in graduate training in a couple of years.

I also need to pick up a little more math, like differential equations and basic linear algebra. Do you suppose I'd need anything else?

Thanks a lot.

+1  A: 
  • FORTRAN is still very common in scientific applications.
  • LISP is a very good choice (especially for AI)
  • These days Python is getting very trendy in academic circles.

tl;dr: Learn Lisp. You won't regret it.

DrJokepu
+1 - Python is ***absolutely*** appropriate for said application and is also very easy to learn.
Aviral Dasgupta
@DrJokepu: Thanks for the tips. My only concern is that learning Common Lisp might be a waste since I've heard it doesn't get much use anymore. I want to learn a language I'd end up using in the lab too.@aviraldg: Yes, leaning strongly towards Python now. Thank you!
Ter
A: 

Well, you could try using Google to get a picture. "neural network python" gets 29 hits. "neural network c++" gets 94,000 hits. "neural network lisp" gets four hits (!). Clearly this is not a real solution to the problem, but it might give some hints as to what language should be used.

Kinopiko
What does that mean? A whole lot of nothing. Just means that *most* people use C++ to implement NNs but that doesn't mean it's the easiest to use for said purpose... The OPs primary goal is simulation, not efficient code. But I agree .. LISP is very inappropriate for this.
Aviral Dasgupta
I agree with you, it doesn't carry a lot of weight. But it's one way of grubbing for information in the absence of solid facts.
Kinopiko
+1  A: 

I have worked (until very recently), in exactly your field, Cognitive Science research. Here are my suggestions, in order of importance:

  1. Matlab - In addition to being a solid language for implementing neural network models and similar, a good chunk of laboratory experiments are implemented using the Psychtoolbox system, a Matlab package originally designed for psychophysics research, but also usable for things like eyetracking, fMRI, and simple behavioral studies. It's also an excellent choice for things like function optimization and model fitting. If you end up doing AI, Matlab is a fairly common choice.
  2. R - This is the newish up-and-comer (with a growing presence here on SO!). It's your best bet for a programming language with libraries for data manipulation and analysis, statistics, and graphing. It has better support for modern statistics (mixed-effects models, Bayesian approaches) than commercial stats packages. On the other hand, it's a functional language designed for and written by statisticians, and it can be rather difficult to learn.
  3. Python - Python also has a significant community of scientific and numerical users, and some good libraries. But I know of only a few researchers in cognitive science who use it, so you'll be lonely for a while. It's a much cleaner language to learn than R, though, and is just as good as R at data manipulation and simpler statistics. I suspect it's more common in AI.
  4. Java - If you end up working in AI, or building larger-scale models (used by many researchers) for cognitive science, you will likely be building things with GUIs, and Java is a standard for that.

And a few languages that you might learn, but can probably avoid if you wish.

  1. Perl - Perl is a great language for slinging data around. It suffers from the same "too many ways of doing things" issue as R, and doesn't have much support for statistical data analysis. On the other hand, if you've got a giant set of data files generated by your eyetracking system and you need to convert them into a format that SPSS can use, Perl is a good choice if you don't know R.
  2. Visual Basic - A very common system for constructing psych experiments is E-Prime, which is a drag-and-drop overlay on Visual Basic for Applications. Simple stuff you can do with no programming, but complicated stuff requires working in possibly the crappiest programming language ever to get wide-spread use.
  3. C++ - If you end up doing the AI track, you'll definitely end up learning C++. Otherwise, it's not worth the trouble.
Harlan
Great to meet another cog person! I'll focus on MATLAB and Python for now (PsychToolbox and PsychoPy look like excellent substitutes for SuperLab Pro). I definitely intend to pick up R later on as well.Thanks a lot!
Ter