零对数正态总体均值比的同时cis

LN0SCIs的Python项目详细描述


https://img.shields.io/github/forks/badges/shields.svg?style=social&label=Forkhttps://img.shields.io/pypi/pyversions/Django.svghttps://img.shields.io/cran/v/devtools.svghttps://img.shields.io/pypi/v/nine.svghttps://github.com/DataXujing/LN0SCIs/raw/master/pic/log.png

LN0SCIS

jing xu,李新民,华良

简介

这个python包基于xu等人的关于对数正态总体均值与零之比的同时置信区间的论文。给出了多零点对数正态总体均值比的同时置信区间的构造方法。最后,我们选择了4种基于广义关键量和两步移动区间的最优方法。为了使用方便,我们制作了一个名为ln0scis的python包,它在cran上还有一个r版本的包:https://CRAN.R-project.org/package=LN0SCIs

  • 如果您是r用户,可以通过github在r内核中安装:
    • devtools::安装github('dataxujing/ln0scis')
  • 或者也可以通过cran安装:
    • 安装.packages('ln0scis')
  • 如果您是python用户,则可以
    • pip安装ln0scis

方法

我们在ln0scis包中提供了四个主要函数:fgw()、fgh()、moverw()和moverh(),如果您想深入了解这四种方法,可以阅读我们的论文:带零对数正态总体平均数比的同时置信区间。我们信任github的代码。如果你想知道如何实现它们,你可以阅读源代码。

示例

  • fgw()
from LN0SCIs import *
#Example1:
alpha = 0.05
p = np.array([0.2,0.2,0.2])
n = np.array([30,30,30])
mu = np.array([0,0,0])
sigma = np.array([1,1,1])
N = 1000
FGW(n,p,mu,sigma,N)
#Example2:
p = np.array([0.1,0.1,0.1,0.1])
n = np.array([30,30,30,30])
mu = np.array([0,0,0,0])
sigma = np.array([1,1,1,1])
C2 = np.array([[-1,1,0,0],[-1,0,1,0],[-1,0,0,1],[0,-1,1,0],[0,-1,0,1],[0,0,-1,1]])
N = 1000
FGW(n,p,mu,sigma,N,C2 = C2)
====================Method: FGW=====================
The Simultaneous Confidence Intervals are:
     The1th CIs            The2th CIs            The3th CIs
0  【-0.843638,0.789044】  【-0.629208,1.075959】  【-0.604469,1.158544】
**********************Time**************************
The cost time is:0 secs
====================Method: FGW=====================
The Simultaneous Confidence Intervals are:
     The1th CIs           The2th CIs           The3th CIs  \
0  【-0.912169,1.578679】  【-1.02404,0.812882】  【-0.83778,1.382352】

     The4th CIs            The5th CIs           The6th CIs
0  【-1.597962,0.650222】  【-1.337939,1.203199】  【-0.546039,1.25945】
**********************Time**************************
The cost time is:0 secs
  • fgh()
alpha = 0.05
p = np.array([0.2,0.2,0.2])
n = np.array([30,30,30])
mu = np.array([0,0,0])
sigma = np.array([1,1,1])
N = 1000
FGH(n,p,mu,sigma,N)
#Example2:
p = np.array([0.1,0.1,0.1,0.1])
n = np.array([30,30,30,30])
mu = np.array([0,0,0,0])
sigma = np.array([1,1,1,1])
C2 = np.array([[-1,1,0,0],[-1,0,1,0],[-1,0,0,1],[0,-1,1,0],[0,-1,0,1],[0,0,-1,1]])
N = 1000
FGH(n,p,mu,sigma,N,C2 = C2)
====================Method: FGH=====================
The Simultaneous Confidence Intervals are:
     The1th CIs            The2th CIs            The3th CIs
0  【-0.992276,1.455247】  【-0.703231,1.372774】  【-1.005873,1.124758】
**********************Time**************************
The cost time is:0 secs
====================Method: FGH=====================
The Simultaneous Confidence Intervals are:
    The1th CIs            The2th CIs            The3th CIs  \
0  【-1.62426,0.624984】  【-1.514528,0.553936】  【-1.565943,0.911157】

    The4th CIs            The5th CIs           The6th CIs
0  【-0.66646,1.010746】  【-0.829753,1.269381】  【-0.762683,1.07889】
**********************Time**************************
The cost time is:0 secs
  • moverw()
alpha = 0.05
p = np.array([0.2,0.2,0.2])
n = np.array([30,30,30])
mu = np.array([0,0,0])
sigma = np.array([1,1,1])
N = 1000
MOVERW(n,p,mu,sigma,N)
#Example2:
p = np.array([0.1,0.1,0.1,0.1])
n = np.array([30,30,30,30])
mu = np.array([0,0,0,0])
sigma = np.array([1,1,1,1])
C2 = np.array([[-1,1,0,0],[-1,0,1,0],[-1,0,0,1],[0,-1,1,0],[0,-1,0,1],[0,0,-1,1]])
N = 1000
MOVERW(n,p,mu,sigma,N,C2 = C2)
====================Method: FGH=====================
The Simultaneous Confidence Intervals are:
     The1th CIs            The2th CIs            The3th CIs
0  【-1.103496,1.211033】  【-1.030952,0.888781】  【-1.314926,1.059975】
**********************Time**************************
The cost time is:0 secs
====================Method: FGH=====================
The Simultaneous Confidence Intervals are:
    The1th CIs            The2th CIs            The3th CIs  \
0  【-1.68825,0.349316】  【-1.270833,1.236153】  【-1.304731,1.053776】

     The4th CIs            The5th CIs            The6th CIs
0  【-0.349427,1.679719】  【-0.364992,1.484843】  【-1.294225,1.071433】
**********************Time**************************
The cost time is:0 secs
  • 移动右侧()
alpha = 0.05
p = np.array([0.2,0.2,0.2])
n = np.array([30,30,30])
mu = np.array([0,0,0])
sigma = np.array([1,1,1])
N = 1000
MOVERH(n,p,mu,sigma,N)
#Example2:
p = np.array([0.1,0.1,0.1,0.1])
n = np.array([30,30,30,30])
mu = np.array([0,0,0,0])
sigma = np.array([1,1,1,1])
C2 = np.array([[-1,1,0,0],[-1,0,1,0],[-1,0,0,1],[0,-1,1,0],[0,-1,0,1],[0,0,-1,1]])
N = 1000
MOVERH(n,p,mu,sigma,N,C2 = C2)
====================Method: FGH=====================
The Simultaneous Confidence Intervals are:
     The1th CIs            The2th CIs          The3th CIs
0  【-1.013305,0.765726】  【-1.152934,0.823283】  【-0.914194,0.8239】
**********************Time**************************
The cost time is:0 secs
====================Method: FGH=====================
The Simultaneous Confidence Intervals are:
     The1th CIs            The2th CIs           The3th CIs  \
0  【-0.681666,1.693927】  【-0.750657,1.458978】  【-1.21012,0.855608】

     The4th CIs            The5th CIs            The6th CIs
0  【-1.302431,1.003355】  【-1.762379,0.407925】  【-1.527028,0.467458】
**********************Time**************************
The cost time is:0 secs

支持

在Python2.7、3.5、3.6上测试

你可以登录徐静的主页https://dataxujing.coding.mehttps://dataxujing.github.io找到作者,如果你想了解更多关于混合分布同时置信区间的知识,你应该读一读徐静、李新民、华亮的论文《零对数正态总体均值比的模拟置信区间》。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java Jgit对于给定的存储库,我们如何确定新提交的列表,以及每个提交来自哪个分支?   从MS Access数据库添加java ComboBoxItem   如何禁止Java列表中不同类的实例?   java在没有Web的JAXR上使用Shiro过滤器。xml   由于java原因,无法在Ubuntu上安装Netbeans 8.2。awt。未找到恐怖和辅助技术   java JUnit对RuntimeException的处理(特别是)   java空集合在Apache CXF服务(JAXWS)中被转换为null   java CannotAcquireLockException问题   sql如何在数据库中对(Java)枚举建模(使用SQL92)   安卓在Java中获取友好url后面的文件名   java如何访问数组名以获取列表?   javascript Java Nashorn longBitsToDouble   java控制台<init>错误   java将一个LinkedList追加/连接到另一个LinkedList的最有效方式是什么?   Java for正在跳过的循环   java帮助创建带有动画的复杂Swing GUI   java Android编辑文本。setHint在片段中不工作