零对数正态总体均值比的同时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我想访问同一类的不同函数中的函数变量   创建字段/值哈希映射的java反射   java Velocity工具向后兼容性?   cmd JAVA运行时错误:发生JNI错误   java spring引导示例hateoas不工作   java为什么Android Studio和gradle可以使用不同的类路径进行单元测试?   java Selenium Firefox驱动程序初始化   java如何在jar中重新定位gradle依赖项的包   java为什么我的单线程hello world应用程序使用22个OS线程?   正则表达式替换Java字符串中的特殊字符   在任何派生类的构造函数之后运行方法的java   java从输入字符串中找出日期   带有libGdx(Java)音乐的安卓studio可以在Android模拟器上工作,但不能在桌面上工作   java我在getconnection的参数方面有错误吗?   java使用JFileChooser访问选定文件   java如何将Json解析为另一个活动   java使用Resources for html和rest server   java更新列表,列表内容来自循环中的方法   java如何在GLSL中读取完整范围的32位整数纹理