简体   繁体   中英

Migrating from Stata to Python

Some coworkers who have been struggling with Stata 11 are asking for my help to try to automate their laborious work. They mainly use 3 commands in Stata:

tsset (sets a time series analysis)

as in: tsset year_column, yearly

varsoc (Obtain lag-order selection statistics for VARs)

as in: varsoc column_a column_b

vec (vector error-correction model)

as in: vec column_a column_b, trend(con) lags(1) noetable


Does anyone know any scientific library that I can use through python for this same functionality?

我相信scikits.timeserieseconpy / pytrix都实现了矢量自动回归方法,但我还没有完成他们的步伐。

scikits.timeseries is mainly for data handling and has only some statistical, econometric analysis and no vectorautoregression. pytrix has some econometrics functions but also no VAR. (At least last time I looked.)

scikits.statsmodels and pandas both have VAR, pandas also does the data handling for time series. I haven't seen any vector error correction models in python yet, but scikits.statsmodels is getting close.

http://groups.google.ca/group/pystatsmodels?hl=en&pli=1

Check out scikits.statsmodels.tsa.api.VAR (may need to get the latest development version--use Google) and, in check out the documentation for it:

http://statsmodels.sourceforge.net/devel/vector_ar.html#var

These models integrate with pandas also. I'll be working in the coming months to improve integration of pandas with the rest of statsmodels

Vector Error Correction Models have not been implemented yet but are on the TODO list!

使用Rpy2并调用R var包。

I have absolutely no clue what any of those do, but NumPy and SciPy. Maybe Sage or SymPy.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM