统计处理包Statsmodels: statistics in python
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
statsmodels的使用
熵计算模块
如renyi熵的计算
from statsmodels.sandbox.infotheo import renyientropyrenyientropy(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: statistics in python的更多相关文章
- Statistics in Python
Statistics in Python Materials for the “Statistics in Python” euroscipy 2015 tutorial. Requirements ...
- Python一键转Jar包,Java调用Python新姿势!
粉丝朋友们,不知道大家看故事看腻了没(要是没腻可一定留言告诉我^_^),今天这篇文章换换口味,正经的来写写技术文.言归正传,咱们开始吧! 本文结构: 需求背景 进击的Python Java和Pytho ...
- R语言︱常用统计方法包+机器学习包(名称、简介)
一.一些函数包大汇总 转载于:http://www.dataguru.cn/thread-116761-1-1.html 时间上有点过期,下面的资料供大家参考基本的R包已经实现了传统多元统计的很多功能 ...
- [oBIX包使用教程] 使用 Python 通过 oBIX 协议访问 Niagara 数据
oBIX 全称是 Open Building Information Exchange,它是基于 RESTful Web Service 的接口的标准,用于构建控制系统.oBIX是在专为楼宇自动化设计 ...
- python在cmd上导包成功,但是python charm上面就提示找不到
失败 成功 原因:我的python file名称和numpy 的名字一样了,把python file 的名字改了就好了
- socket(TCP-粘包)通讯之Python实现
所谓粘包问题主要还是C/S两端数据传输时 因为接收方不知道消息之间的界限,不知道一次性提取多少字节的数据所造成的 根本原因:粘包是由TCP协议本身造成的,TCP为提高传输效率,发送方往往要收集到足够多 ...
- hanlp自然语言处理包的基本使用--python
hanlp拥有:中文分词.命名实体识别.摘要关键字.依存句法分析.简繁拼音转换.智能推荐. 这里主要介绍一下hanlp的中文分词.命名实体识别.依存句法分析,这里就不介绍具体的hanlp的安装了,百度 ...
- Python 统计代码的行数,Python脚本 统计代码
# coding=utf-8 import os import time # 需要统计的文件夹或者文件,这是在windows下运行的,如果使用Linux系统可以使用 basedir = '/app/l ...
- 如何统计序列中元素的频度---Python数据结构与算法相关问题与解决技巧
实际案例: 1. 某随机序列 [12,5,6,4,6,5,5,7]中,找到出现次数最高的3个元素,它们出现的次数是多少? 2. 对于某英文文章的单词,进行词频统计,找到出现次数最高的10个单词,它们出 ...
随机推荐
- ABP领域层知识回顾之---仓储
1. 前言 在上一篇博文中 http://www.cnblogs.com/xiyin/p/6810350.html 我们讲到了ABP领域层的实体,这篇博文继续讲ABP的领域层,这篇博文的主题是ABP ...
- [HNOI 2014]世界树
Description 题库链接 给出一棵 \(n\) 个节点的树, \(q\) 次询问,每次给出 \(k\) 个关键点.树上所有的点会被最靠近的关键点管辖,若距离相等则选编号最小的那个.求每个关键点 ...
- delete和delete[]的区别(转载)
一直对C++中的delete和delete[]的区别不甚了解,今天遇到了,上网查了一下,得出了结论.做个备份,以免丢失. C++告诉我们在回收用 new 分配的单个对象的内存空间的时候用 delete ...
- POJ 3276 Face The Right Way
Description Farmer John has arranged his N (1 ≤ N ≤ 5,000) cows in a row and many of them are facing ...
- Codeforces Round #419 D. Karen and Test
Karen has just arrived at school, and she has a math test today! The test is about basic addition an ...
- 【AIM Tech Round 4 (Div. 2) D Prob】
·题目:D. Interactive LowerBound ·英文题,述大意: 有一个长度为n(n<=50000)的单链表,里面的元素是递增的.链表存储在一个数组里面,给出长度n.表 ...
- 智能指针之 auto_ptr
C++的auto_ptr所做的事情,就是动态分配对象以及当对象不再需要时自动执行清理,该智能指针在C++11中已经被弃用,转而由unique_ptr替代, 那这次使用和实现,就具体讲一下auto_pt ...
- C++内存机制中内存溢出、内存泄露、内存越界和栈溢出的区别和联系
当我们在用C++做底层驱动的时候,经常会遇到内存不足的警告,究其原因,往往是因为内存出现溢出,泄露或者越界等原因.那么他们之间有什么联系吗? 内存溢出(out of memory) 是指程序在申请内存 ...
- Delphi下DLL编程知识(转)
一. DLL和系统变量 在 System 单元声明的变量中,有几个对DLL编程有特殊影响.IsLibrary 可以检测代码是执行在应用程序中还是执行在DLL中,在应用程序中 IsLibrar ...
- js删除数组中的元素delete和splice的区别
例如有一个数组是 :var textArr = ['a','b','c','d']; 这时我想删除这个数组中的b元素: 方法一:delete 删除数组 delete textArr[1] 结果为: ...