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. [LeetCode] Longest Uncommon Subsequence II 最长非共同子序列之二

    Given a list of strings, you need to find the longest uncommon subsequence among them. The longest u ...

  2. 【Swift】UIPresentationController的使用方法

    UIPresentationController是ios8.0的新特性哦,使用需要注意 先上一个效果图 第一步: 连线选择segue类型为,present Modally 第二步:需要演示的控制器,自 ...

  3. orabbix插件监控oracle表空间问题

    我们安装好orabbix插件后,查看Tablespaces监控项是发项值为none,第一反应是没监控成功,其实不然. 1.我们打开orabbix监控项参数的路径,下面为Tablespaces的sql代 ...

  4. linux 基本使用命令

    arch 显示机器的处理器架构(1) uname -m 显示机器的处理器架构(2) uname -r 显示正在使用的内核版本 dmidecode -q 显示硬件系统部件 - (SMBIOS / DMI ...

  5. 机器学习基石:01 The Learning Problem

    什么时候适合用机器学习算法? 1.存在某种规则/模式,能够使性能提升,比如准确率: 2.这种规则难以程序化定义,人难以给出准确定义: 3.存在能够反映这种规则的资料. 所以,机器学习就是设计算法A,从 ...

  6. burp的dns记录功能

    写个备忘. 先点copy复制url,然后生成的url就能用了. 一关就没了,比较鸡肋些,不适合持久的,适合马上就能见效果的那种.

  7. luogu 3413 SAC#1 - 萌数

    题目描述 辣鸡蒟蒻SOL是一个傻逼,他居然觉得数很萌! 好在在他眼里,并不是所有数都是萌的.只有满足“存在长度至少为2的回文子串”的数是萌的——也就是说,101是萌的,因为101本身就是一个回文数:1 ...

  8. [HNOI2012]射箭

    Description 沫沫最近在玩一个二维的射箭游戏,如下图 1 所示,这个游戏中的 x 轴在地面,第一象限中有一些竖直线段作为靶子,任意两个靶子都没有公共部分,也不会接触坐标轴.沫沫控制一个位于( ...

  9. codeforces 523D tatistics of Recompressing Videos

    一个称为DH(DogHouse)的狗的社交网络有k台专用服务器来重新上传可爱的猫的上传视频.每个视频上传后,应该在一个(任何)服务器上重新压缩,之后才可以保存在社交网络中. 我们知道每个服务器需要一秒 ...

  10. poj 1845 (逆元 + 约数和)

    题意: 求A^B的所有约数(即因子)之和,并对其取模 9901再输出. 思路: A可以表示为A=(p1^k1)*(p2^k2)*(p3^k3)*....*(pn^kn)   其中pi均为素数 那么A的 ...