47

我正在努力成为一名科学程序员。我有足够的数学和统计背景,但缺乏编程背景。我发现学习如何使用一门语言进行科学编程非常困难,因为大多数 SP 的参考资料几乎是微不足道的。

我的工作涉及统计/财务建模,而没有物理模型。目前,我在 numpy 和 scipy 中广泛使用 Python。完成 R/Mathematica。我知道足够的 C/C++ 来阅读代码。没有Fortran经验。

我不知道这是否是科学程序员的好语言列表。如果是这样,那么在科学环境中学习这些语言的语法设计模式的好阅读清单是什么?

4

17 回答 17

38

At some stage you're going to need floating point arithmetic. It's hard to do it well, less hard to do it competently, and easy to do it badly. This paper is a must read:

What Every Computer Scientist Should Know About Floating-Point Arithmetic

于 2009-11-04T08:24:03.310 回答
25

I thoroughly recommend

Scientific and Engineering C++: An Introduction with Advanced Techniques and Examples by Barton and Nackman

Don't be put off by its age, it's excellent. Numerical Recipes in your favourite language (so long as it is C,C++ or Fortran) is compendious, and excellent for learning from, not always the best algorithms for each problem.

I also like

Parallel Scientific Computing in C++ and MPI: A Seamless Approach to Parallel Algorithms and their Implementation by Karniadakis

The sooner you start parallel computing the better.

于 2009-11-04T08:58:13.867 回答
12

My first suggestion is that you look at the top 5 universities for your specific field, look at what they're teaching and what the professors are using for research. That's how you can discover the relevant language/approach.

Also have a look at this stackoverflow question ("practices-for-programming-in-a-scientific-environment").

You're doing statistical/finance modeling? I use R in that field myself, and it is quickly becoming the standard for statistical analysis, especially in the social sciences, but in finance as well (see, for instance, http://rinfinance.com). Matlab is probably still more widely used in industry, but I have the sense that this may be changing. I would only fall back to C++ as a last resort if performance is a major factor.

Look at these related questions for help finding reading materials related to R:

In terms of book recommendations related to statistics and finance, I still think that the best general option is David Ruppert's "Statistics and Finance" (you can find most of the R code here and the author's website has matlab code).

Lastly, if your scientific computing isn't statistical, then I actually think that Mathematica is the best tool. It seems to get very little mention amongst programmers, but it is the best tool for pure scientific research in my view. It has much better support for things like integration and partial differential equations that matlab. They have a nice list of books on the wolfram website.

于 2009-11-04T05:27:35.773 回答
10

在语言方面,我认为你的报道很好。Python 非常适合进行实验和原型设计,Mathematica 非常适合帮助解决理论问题,如果您需要进行认真的数字运算,C/C++ 就在那里。

我还建议您对汇编语言和函数式语言(例如 Haskell)有所了解,这并不是真正要使用的,而是因为它们对您的编程技能和风格以及它们带回家的概念的影响给你。他们也可能有一天会派上用场。

我还认为学习并行编程(并发/分布式)至关重要,因为这是获得科学问题有时所必需的那种计算能力的唯一方法。在这方面,接触函数式编程会很有帮助,无论您是否真的使用函数式语言来解决问题。

不幸的是,我在阅读方式上没有太多建议,但您可能会发现The Scientist and Engineer's Guide to Digital Signal Processing很有帮助。

于 2009-11-04T04:59:02.623 回答
7

I'm a scientific programmer who just entered the field in the past 2 years. I'm into more biology and physics modeling, but I bet what you're looking for is pretty similar. While I was applying to jobs and internships there were two things that I didn't think would be that important to know, but caused me to end up missing out on opportunities. One was MATLAB, which has already been mentioned. The other was database design -- no matter what area of SP you're in, there's probably going to be a lot of data that has to be managed somehow.

The book Database Design for Mere Mortals by Michael Hernandez was recommended to me as being a good start and helped me out a lot in my preparation. I would also make sure you at least understand some basic SQL if you don't already.

于 2009-12-17T23:48:44.160 回答
6

我会建议任何有用的数字食谱书(选择一种语言)。

根据您使用的语言或者您是否要进行可视化,可能会有其他建议。

我非常喜欢的另一本书是Didier Besset的面向对象的数值方法实现。他展示了如何在 Java 和 smalltalk 中做许多方程式,但更重要的是,他在帮助展示如何优化方程式以在计算机上使用以及如何处理由于计算机限制而导致的错误方面做得非常出色。

于 2009-11-04T05:06:29.583 回答
4

Donald Knuth's book on seminumerical algorithms.

于 2009-11-04T10:25:17.270 回答
4

MATLAB is widely used in engineering for design, rapid development, and even production applications (my current project has a MATLAB-generated DLL for doing some advanced number crunching that was easier to do than in our native C++, and our FPGAs use MATLAB-generated cores for signal processing too, which is much easier than coding the same by hand in VHDL). There's also a financial toolbox for MATLAB that may be of interest to you.

This is not to say that MATLAB is the best choice for your field, but at least in engineering, it's widely used and not going anywhere soon.

于 2009-11-04T19:42:41.393 回答
4

One issue scientific programmers face is maintaining a repository of code (and data) that others can use to reproduce your experiments. In my experience this is a skill not required in commercial development.

Here are some readings on this:

These are in the context of computational biology but I assume it applies to most scientific programming.

Also, look at Python Scripting for Computational Science.

于 2009-12-10T14:20:57.243 回答
3

对于科学环境中的通用 C++, Andrei Alexandrescu 的Modern C++ Design可能是关于常见设计模式的标准书籍。

于 2009-11-04T05:10:13.903 回答
2

Once you are up and running, I would strongly recommend reading this blog.

It describes how you use C++ templates to provide type safe units. So for example, if you multiply velocity by time you get a distance etc.

于 2009-11-04T10:20:40.207 回答
2

Reading source-code helps a lot, too. Python is great in this sense. I have learnt a great amount of information just by digging through the source codes of scientific Python tools. On top of this following your favourite tools' mailing-lists and forums can enhance your skills further.

于 2009-12-27T04:48:15.070 回答
0

这可能有用:数学建模的性质

于 2009-11-04T05:22:50.243 回答
0

Donald Knuth: Seminumerical Algorithms, Volume 2 of The Art of Computer Programming

Press, Teukolsky, Vetterling, Flannery: Numerical Recipes in C++ (the book is great, just beware of the license)

Modern C++ Design

and have a gander at the source code for the GNU Scientific Library.

于 2009-12-10T14:23:58.650 回答
0

Writing Scientific Software: A Guide to Good Style is a good book with overall advice for modern scientific programming.

于 2010-05-20T18:13:46.170 回答
-1

For Java I recommend a look at Unit-API
Implementations are Eclipse UOMo (http://www.eclipse.org/uomo) or JScience.org (work in progress for Unit-API, earlier implementations of JSR-275 exist)

于 2011-01-23T12:09:37.687 回答