http://blog.csdn.net/pipisorry/article/details/52227580

Statsmodels

Statsmodels is a Python package that provides a complement to scipy for statistical computations including descriptive statistics and estimation of statistical models.

statsmodels原名叫scikits.statsmodels,已经改成了statsmodels。

其中也有时间序列分析的模块[ Time Series analysis tsa]

statsmodels主要功能features

regression: Generalized least squares (including weighted least squares and least squares with autoregressive errors), ordinary least squares.
    glm: Generalized linear models with support for all of the one-parameter exponential family distributions.
    discrete choice models: Poisson, probit, logit, multinomial logit
    rlm: Robust linear models with support for several M-estimators.
    tsa: Time series analysis models, including ARMA, AR, VAR
    nonparametric : (Univariate) kernel density estimators
    datasets: Datasets to be distributed and used for examples and in testing.
    PyDTA: Tools for reading Stata .dta files into numpy arrays.
    stats: a wide range of statistical tests
    sandbox: There is also a sandbox which contains code for generalized additive models (untested), mixed effects models, cox proportional hazards model (both are untested and still dependent on the nipy formula framework), generating descriptive statistics, and printing table output to ascii, latex, and html. There is also experimental code for systems of equations regression, time series models, panel data estimators and information theoretic measures. None of this code is considered "production ready".

安装

pip install statsmodels

需要的依赖有:

Python >= 2.6, including Python 3.x

NumPy >= 1.5.1

SciPy >= 0.9.0

Pandas >= 0.7.1

Patsy >= 0.3.0

Cython >= 20.1, Needed if you want to build the code from github and not a source distribution. You must use Cython >= 0.20.1 if you’re on Python 3.4. Earlier versions may work for Python < 3.4.

如果安装不上就源码安装:

git clone git://github.com/statsmodels/statsmodels.git

cd statsmodels

python setup.py install

virtualenv中安装出错

error: Command "x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -I/home/piting/ENV/ubuntu_env/lib/python3.4/site-packages/numpy/core/include -I/usr/include/python3.4m -I/home/piting/ENV/ubuntu_env/include/python3.4m -c statsmodels/nonparametric/_smoothers_lowess.c -o build/temp.linux-x86_64-3.4/statsmodels/nonparametric/_smoothers_lowess.o" failed with exit status 1

需要安装sudo apt-get install python3-dev[python-dev]

python-dev: Header files and a static library for Python

[Installation]

皮皮blog

statsmodels的使用

熵计算模块

如renyi熵的计算

from statsmodels.sandbox.infotheo import renyientropy
renyientropy(ij[np.nonzero(ij)] / sum(ij), alpha=q, logbase=math.e)

from: http://blog.csdn.net/pipisorry/article/details/52227580

ref: [statsmodels/statsmodels github]

[homepage Statsmodels]

[Statsmodels’s Documentation]

[statsmodels源码]

统计处理包Statsmodels: statistics in python的更多相关文章

  1. Statistics in Python

    Statistics in Python Materials for the “Statistics in Python” euroscipy 2015 tutorial. Requirements ...

  2. Python一键转Jar包,Java调用Python新姿势!

    粉丝朋友们,不知道大家看故事看腻了没(要是没腻可一定留言告诉我^_^),今天这篇文章换换口味,正经的来写写技术文.言归正传,咱们开始吧! 本文结构: 需求背景 进击的Python Java和Pytho ...

  3. R语言︱常用统计方法包+机器学习包(名称、简介)

    一.一些函数包大汇总 转载于:http://www.dataguru.cn/thread-116761-1-1.html 时间上有点过期,下面的资料供大家参考基本的R包已经实现了传统多元统计的很多功能 ...

  4. [oBIX包使用教程] 使用 Python 通过 oBIX 协议访问 Niagara 数据

    oBIX 全称是 Open Building Information Exchange,它是基于 RESTful Web Service 的接口的标准,用于构建控制系统.oBIX是在专为楼宇自动化设计 ...

  5. python在cmd上导包成功,但是python charm上面就提示找不到

    失败 成功 原因:我的python file名称和numpy 的名字一样了,把python file 的名字改了就好了

  6. socket(TCP-粘包)通讯之Python实现

    所谓粘包问题主要还是C/S两端数据传输时 因为接收方不知道消息之间的界限,不知道一次性提取多少字节的数据所造成的 根本原因:粘包是由TCP协议本身造成的,TCP为提高传输效率,发送方往往要收集到足够多 ...

  7. hanlp自然语言处理包的基本使用--python

    hanlp拥有:中文分词.命名实体识别.摘要关键字.依存句法分析.简繁拼音转换.智能推荐. 这里主要介绍一下hanlp的中文分词.命名实体识别.依存句法分析,这里就不介绍具体的hanlp的安装了,百度 ...

  8. Python 统计代码的行数,Python脚本 统计代码

    # coding=utf-8 import os import time # 需要统计的文件夹或者文件,这是在windows下运行的,如果使用Linux系统可以使用 basedir = '/app/l ...

  9. 如何统计序列中元素的频度---Python数据结构与算法相关问题与解决技巧

    实际案例: 1. 某随机序列 [12,5,6,4,6,5,5,7]中,找到出现次数最高的3个元素,它们出现的次数是多少? 2. 对于某英文文章的单词,进行词频统计,找到出现次数最高的10个单词,它们出 ...

随机推荐

  1. Python模块 - configparser

    configparser模块用来对配置文件进行操作 1.获取所有块 import configparser config = configparser.ConfigParser() config.re ...

  2. mybatis学习三

    Mybatis与pageHelper分页:    分页分为假分页和真分页对应的专业术语叫做逻辑分页和物理分页    逻辑分页:将所有的数据从数据库查询出来,根据需求截取符合要求的数据返回,方便统一但效 ...

  3. swoole_event_add实现异步

    swoole提供了swoole_event_add函数,可以实现异步.此函数可以用在Server或Client模式下. 实现异步tcp客户端 示例: <?php $start_time = mi ...

  4. [COGS 1799][国家集训队2012]tree(伍一鸣)

    Description 一棵n个点的树,每个点的初始权值为1.对于这棵树有q个操作,每个操作为以下四种操作之一: + u v c:将u到v的路径上的点的权值都加上自然数c: - u1 v1 u2 v2 ...

  5. ●HDU 6021 MG loves string

    题链: http://acm.hdu.edu.cn/showproblem.php?pid=6021 题解: 题意:对于一个长度为 N的由小写英文字母构成的随机字符串,当它进行一次变换,所有字符 i ...

  6. hdu 5475(线段树)

    题意: 两个操作:① 当为1时 ,乘上后面的数 ② 当为2时,除以第x次乘的数 还说了2操作后面的n不会重复(就这明显看出线段树- -,然而并没有看出来,还是靠的队友) 1则对每个节点赋值,2则将相应 ...

  7. bzoj2823[AHOI2012]信号塔

    2823: [AHOI2012]信号塔 Time Limit: 10 Sec  Memory Limit: 128 MBSubmit: 1190  Solved: 545[Submit][Status ...

  8. bzoj1791: [Ioi2008]Island 岛屿 单调队列优化dp

    1791: [Ioi2008]Island 岛屿 Time Limit: 20 Sec  Memory Limit: 162 MBSubmit: 1826  Solved: 405[Submit][S ...

  9. SQL Server 连接 MySQL

    1.在SQL SERVER服务器上安装MYSQL ODBC驱动; 驱动下载地址:http://dev.mysql.com/downloads/connector/odbc/ 2.安装好后,在管理工具- ...

  10. 笔记8 AOP练习2

    场景描述: 一张唱片有好多磁道,假设每个磁道只有一首歌,现在需要记录每首歌的播放次数,然后输出. 主要业务:歌曲播放 辅助功能:记录播放次数(切面) 1.创建唱片接口,CompactDiscs.jav ...