Current location - Training Enrollment Network - Mathematics courses - What programming languages do you need to be familiar with to learn economics?
What programming languages do you need to be familiar with to learn economics?
What programming languages do you need to be familiar with to learn economics?

1) Tan You Yaser _2006

You can use excel to process and analyze data. Excel is the most basic. If you use VBA well, it will be of great help. If you want to analyze data, such as modeling, SAS is good, but it is difficult to master. If you don't have a language foundation, there are many other softwares that can do it. Many banks, securities and futures companies use oracle or DB2, and some small enterprises may use SQL, so if they want to develop in this field, they must master the knowledge of databases. After all, talents who know both finance and computers are still scarce, and many industries in China are using these large databases, such as telecommunications and medical aviation. I am afraid I can't be called a financial expert because I can't analyze financial data. Whether your analysis is accurate or not depends on your mastery of financial knowledge, especially for investment students. Many of them are applied finance majors, so there is no need to spend too much energy on CFA and ACCA, and they probably don't need it at work. It is necessary for students majoring in financial mathematics, financial engineering and actuarial science to spend some time studying. In a word, it depends on you first.

2) Programming enthusiast Ren Kun

If you want to keep up with the international academic circles, you'd better learn R. At least as far as I know, the trend of American statistical circles being occupied by R is obvious.

If you just do a simple regression, just interpret it casually and choose a stupid software. If only ready-made and mature econometric models are used for empirical research, then fool software is generally enough. If you want to take statistics and metrology as your research field or professional field, then programming is essential. Even if you are doing empirical research and involve complex data structures, knowing programming can greatly improve your productivity. In addition, R's community is more active and can keep up with the forefront.

If it involves dealing with big data, one way is to use SAS. If you don't want to use SAS, you can learn some knowledge about databases, such as putting data in SQLite database, accessing database with {RSQLite}, or transmitting data frames with {sqldf} in SQL operating environment.

If you feel that the speed of executing a task R is slow, you can use {parallel} or {parallelMap} for parallel calculation, or you can use cloud computing to process data.

If other community-related things are not implemented in the R community, such as Java, you can call Java objects with {rJava}, but the speed is a bit slow.

A better way is for me to consider working in data analysis. What software or language is the best to learn? The mentioned F# functional programming language can directly call R with RProvider, directly call Jar-packaged Java program with JavaProvider, directly call Python program with PythonProvider (soon to be released) and so on. And it is easy to integrate the resources of major communities.

At present, I have set up a Repo on GitHub: Renkun-Ken/Learner, which can learn statistics, metrology, nonparametric, data visualization and database through R. Although there is nothing at present, it can be tracked.

All the above are the programming needed for statistics and measurement related to economics. In fact, the "programming" required for statistics and measurement is relatively simple, basically processing data and measuring models provided by applications. Need more programming: first, if it involves a more advanced measurement model, it may need to be implemented by itself; Second, some Monte Carlo simulations require some programming.

From some new fields related to economics, computational economics, computational statistics and computational econometrics need strong programming ability, including algorithm implementation, algorithm analysis and so on. For example, one of the research that computational economics is doing now is agent-based computational finance, which is to build a simulated financial market. There are several assets in the market, and the fundamentals of each asset are determined by random dividends, and there are many investors who follow various logics. Investors have different beliefs about dividends, so the trading behaviors triggered by their own logic are also different. In a two-way auction market, what kind of investor composition or behavior, what kind of memory length, can reproduce the laws of asset prices or asset returns that we observe in the real financial market to the greatest extent, such as the fat tail and asymmetry of asset returns. At this time, researchers need solid financial knowledge to design a simulated financial market that is neither too simple nor too complicated, and also need corresponding programming ability to write models in programming languages. Will design many programming techniques, such as database (sometimes tracking many variables, such as investors' cash flow and wealth distribution), parallel computing (CPU multi-core parallel, multi-process parallel, cluster parallel and even GPU computing) and so on. The research in this field began in1990s.

3) Zhihu netizens think

Econometrics also has many subcategories, so please take your seats accordingly. There are many softwares used, such as STATA, MATLAB, R, SAS, etc.

Stata is the best choice for application measurement (especially cross-sectional data and panel data), because it is very convenient to manage data or run regression. At present, there are almost all available models stata in the articles on the application of micro-measurement in mainstream journals, and most of them are made by stata. And the biggest advantage is simplicity!

Eviews seems to be a good choice if you do the time series of applications. But I don't usually do this, and I don't have any say.

If we do theoretical measurement, stata eviews has no ready-made package. Even if stata can be programmed, its programmability is poor and not robust. So it is very convenient to know R and Matlab. Of course, you can also use Python. Sargent recently wrote a book about measuring with Python. And Julia, a mixture of these three languages, but much faster. The disadvantage is that it is too small.

If high speed is required, especially financial measurement, C, Fortran and other languages can be considered. C and Fortran are definitely the fastest. There is also a kind of cattle, which is fast, but also very small. However, the disadvantages of these languages are high learning difficulty and slow development time. Julia is said to be as fast as C, and her grammar is especially like Matlab and Python (meaning easy to learn), but it is in its infancy and is used by too few people.

If it is in the field of financial measurement, it is strongly recommended to learn SAS. SAS is the most authoritative and fastest. Of course, the biggest problem is that it is expensive and the programmability is not so good. However, the amount of financial data is very, very large, and SAS comes in handy when the general software is paralyzed.

Like myself, when I do applications, I always use stata to organize data, and I can resolutely use stata without other software. But because sometimes we do some theoretical measurement work, matlab is also essential. I am also studying Julia, because the speed of matlab is too slow. I don't usually use Python to do scientific calculations, so there are not many people and the speed is slow. It is usually used to capture data.

Finally, it makes sense why I recommend matlab instead of other software. Many models, such as spatial econometrics, Bayesian estimation, DSGE model and SVAR in macro measurement, are not available in stata and Eviews, but matlab provides a wealth of software packages, such as Dynare based on Matlab and spatial measurement software package of LeSage. , also based on matlab. So in matlab, you can find the code for almost any model you want to use, and then use it directly. Even if you can't, it's not difficult to write it yourself in matlab.

Finally, I remembered a sentence. The choice of these softwares (except stata, because stata's position in the field of applied metrology is almost irreplaceable) can be summarized in two sentences: If your own time is more precious than computer time, then learning matlab, R, even Python and Julia is the most suitable; If computer time is more precious than you, it is necessary to learn C and Fortran. Of course, unless your work is very special (such as the estimation of some large-scale structural models), generally speaking, your time is more precious.

To sum up, it is impossible to use a software for application and theory, so it is recommended to choose according to your own direction. I think stata and matlab are recommended, one is convenient, the other is flexible, both are very powerful, it is not difficult to learn, and many people use them, so it is quite convenient to communicate.

4) Netizen Zhang Zhenzhen

Data, simple excel, intuitive and convenient. More complicated ... …excel can have more than 60,000 lines at most. Are you sure you need to "learn economics" from such a large amount of data?

Complex use of R, various models, algorithms, and implementations, basically R has corresponding software packages, which can be downloaded and used directly, read more documents and practice more, and you can directly use R in actual combat without excel for about half a year. All the regression and output of my doctoral thesis are in R, and I use it in all my papers now. The substitute is Stata. That's not bad, but if you start from scratch like me, then R is highly recommended.

One disadvantage of R is that it can't do symbolic operations. This free solution includes python with scipy numpy and other packages, but I suggest you use mathematica, which has the most powerful symbolic calculation function and the best output format. You can find a Jacobian matrix to do symbolic operation and compare the results.

Python, after being familiar with R, found some functions that R could not realize. When there is actual demand, it is not too late to learn again. I don't need it right away

In addition, all economic research (I mean empiricism, you know) should use latex, which can be regarded as a programming language. Sort out mathematical formulas in word, and it won't be long before you go crazy. Ggplot2 can be used to draw in R and output to tex. It is very convenient to export ordinary data tables to tex with xtable package and regression results to tex with stargazer.

5) User Bayesian

The first thing to say is R, which is definitely the mainstream of foreign academic circles at present. There is basically nothing in the Department of Statistics except R. As a direction related to statistics, R is gradually infiltrating. Therefore, it is recommended to study.

By the way, the learning curve of R is steep, so I don't recommend people with zero foundation to start with R, otherwise their frustration will be stronger. Python is a little better, so I suggest starting with Python.

Python is not a software specially used for statistics or measurement, but a very popular general programming language. After years of development, the library is also very complete. I have tried numpy, scipy, pandas and other libraries. Compared with other general programming languages, it is still quite easy to use, but I personally feel that it is still not as good as R, such as drawing.

Ggplot2 does exist like a god, but python's library is still slightly inferior. However, apart from data processing, python can do too many things, which is also awesome. We mainly use it, such as collecting data from web pages, needing regular expressions, parsing web pages and so on. Python has many advantages over R in these aspects.

Of course, from the trend point of view, python seems to be better than R in the future. R is a group of programming statisticians, and python is a group of computer experts trying to do data processing. It seems that the foundation of python is more solid. Personal opinion, for reference only.

Stata is the best measurement software except R. I have used both of them for several years, but I still think R is better to use and it is more convenient to sort out and process data. So even in the micro-measurement field you mentioned upstairs, I prefer R.

In addition, spss or eviews, etc. , mostly used by students majoring in sensory management, has limited functions and is not recommended. I won't go into details here. Another problem with the above software is that they are all charged. Considering the future protection of intellectual property rights, it is more reliable to use free ones.

R has two main disadvantages:

1 is weak in front of big data. Sas does have advantages in this respect, but it has to be said that the syntax of sas is too anti-human and totally unacceptable. Faced with this problem, what I want to say is that you have to see how big the problem is. In my experience, it seems that the amount of data in the economy is not enough to exceed the upper limit of R. Maybe the high-frequency data of finance will be larger, and I personally have no experience. If I encounter it, I will add it. I tried 10g data. The easiest way is not to learn sas, but to buy 16g memory. :) With the current memory price, I don't think it's a big problem below 32g.

2, the performance is insufficient. Python has the same problem in this respect. The best solution is to mix c/c++, but this is a bottomless pit, which takes a lot of time and may not be able to learn well. The suggested method is to buy hardware, which is the simplest. Of course, using parallel packages is also one of the solutions. I have tried several times to cluster multiple computers in the computer room, but they were not very successful. Ask someone for advice.

You also mentioned several softwares above, and I will talk a little about some softwares I know:

Matlab: The key to a good thing is performance, which can also be solved by c/c++. But I don't like big software. In order to find the mean variance, it takes 5 minutes to start. . .

Julia: At present, X2 is still a good thing to be concerned about, and it may be young, resulting in a slightly smaller number of support libraries. However, I am optimistic about the future development, mainly absorbing the advantages of matlab, python and c/c++, writing fast and calculating fast, so I will pay close attention to it in the future.

Finally, functional programming is a good thing, but it is not optimistic about the future of pure functional programming. It embodies a rather advanced programming idea, but in practical work, there are often big performance problems. To solve this problem, functional programming and other methods are mixed, but this is the way that python, R and other software have realized, and it seems that there is no need to learn other functional programming.

6) Dr. Rong Jianxin from Shanghai University of Finance and Economics

Stata is widely used in micro-measurement, mainly direct input command regression, and there are not many places to program.

As for programming, R and Python are recommended.

R is a very good statistical analysis software, and its application in econometrics can be found in books such as Econometrics in R, Time Series Analysis and Application of Applied Econometrics in R, etc.

Python is very good at capturing data, and SciPy, a mathematical calculation package, can partially replace scientific calculation functions such as Matlab.

7) Zhihu netizen justin

Undergraduate economic statistics, because the school curriculum is wonderful, we have used:

EViews: Econometrics, Time Series and Multivariate Statistics.

Stata: econometrics.

SPSS: A special course, this great sweat, is worth reviewing statistically.

Excel: used in the introductory course of statistics for freshmen. This is also a huge pit, that is, the use of simple functions, which does not involve VBA at all.

Matlab: There is no special course in this course. It is a by-product after I finished programming in C language. Later, when I contacted R and Mathematica, I basically abandoned it.

R/S-Plus: I used S-Plus in regression analysis, but I had been using R language for a long time, and S-Plus was basically compatible, so I never used S-Plus.

Minitab: used in quality control courses, basic statistics plus some experimental design.

SAS: I taught myself several times in the laboratory and was directly impressed by its wonderful grammar. It is said that graduate students in our school have special SAS courses (similar to undergraduate SPSS courses), hehe ~

Xuezhi (Ba), a senior in our department, once complained that she used too much software, which made her feel completely crazy and gave advice to our dear dean. As a student, I also asked the dean this question. What she means is that different software has its own strengths when dealing with different data, and your course is quite easy, so learn more. In addition, different teachers have different hobbies in using software, so it is inevitable to use different software in class.

Students studying economics, Excel and SPSS, EViews (or Stata) are all very good, Stata and EViews can write some programs, and the interface operation of SPSS is also very friendly. I use R, and I will use R after learning those softwares in various classes (in fact, most of the time R already has ready-made packages, and I mostly use them directly). R is still very good, recommended.

Many predecessors have also suggested that it is good for economic students to learn programming enough, otherwise they will be a road of no return and face the danger of completely changing careers. I am a negative example (tears ~). So don't touch Python, C++ and Julia.