带有scipy.stats函数的高指数

时间:2017-02-22 19:05:30

标签: python pandas scipy double precision

我有一组数字可以变得非常小,从1e-1001e-700及更低。精度与指数无关。 我只需使用Decimal作为所有此类数字列的转换器,就可以使用Pandas加载这些数字。

问题是,即使我使用Python Decimal,我也不能使用scipy.stats.chi2.isf和类似的函数,因为它们的C代码明确使用了double。 一个可能的解决方法是我可以使用数字的log10。这里的问题是虽然logsf函数有chi2,但它log(sf(...))实现的只是sf,因此当1e-600返回0时会失败它应该返回isf之类的东西。对于@extends('layouts.masters.main') @section('page-content') @include('layouts.partials.nav') <div id="myCarousel" class="carousel slide" data-ride="carousel"> <!-- Indicators --> <ol class="carousel-indicators"> <li data-target="#myCarousel" data-slide-to="0" class="active"></li> <li data-target="#myCarousel" data-slide-to="1"></li> <li data-target="#myCarousel" data-slide-to="2"></li> <li data-target="#myCarousel" data-slide-to="3"></li> </ol> <!-- Wrapper for slides --> <div class="carousel-inner" role="listbox"> <div class="item active"> <img src="../custom/image/image-slider/1.jpg"> </div> <div class="item"> <img src="../custom/image/image-slider/2.jpg"> </div> <div class="item"> <img src="../custom/image/image-slider/3.jpg"> </div> <div class="item"> <img src="../custom/image/image-slider/4.jpg"> </div> </div> <!-- Left and right controls --> <a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev"> <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span> <span class="sr-only">Previous</span> </a> <a class="right carousel-control" href="#myCarousel" role="button" data-slide="next"> <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span> <span class="sr-only">Next</span> </a> </div> <div id="news-container"> <h2>News</h2> <div class="strike"> <span>Latest</span> </div> <div class="container"> <div class="row"> <div class="col-sm-4"> <figure> <img src="../custom/image/image-slider/3.jpg" height="300px;" width="100px;"> <figcaption> <h3>I love this title!</h3> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p> <p><a href="../news/new.php">Read More</a></p> </figcaption> </figure> </div> <div class="col-sm-4"> <figure> <img src="../custom/image/image-slider/2.jpg" height="300px;" width="100px;"> <figcaption> <h3>I love this title!</h3> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p> <p><a href="../news/new.php">Read More</a></p> </figcaption> </figure> </div> <div class="col-sm-4"> <figure> <img src="../custom/image/image-slider/1.jpg" height="300px;" width="100px;"> <figcaption> <h3>I love this title!</h3> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p> <p><a href="../news/new.php">Read More</a></p> </figcaption> </figure> </div> </div> </div> </div> <div id="about-container"> <h2>About</h2> <div class="strike"> <span>Our Story</span> </div> <p> There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc. There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, </p> </div> <div id="contact-container" style="background-color: whitesmoke;"> <h2>Contact</h2> <div class="strike"> <span>Our Contact</span> </div> <div class="container" style="padding: 35px;"> <div class="row"> <div class="col-sm-6" style="background-color: whitesmoke; padding: 10px;"> <form> <div class="form-group"> <label for="name">Name:</label> <input type="name" class="form-control" id="name" required id="name-textfield"> </div> <div class="form-group"> <label for="email">Email:</label> <input type="email" class="form-control" id="email" required id="email-textfield"> </div> <div class="form-group"> <label for="message">Message:</label> <textarea type="message" class="form-control" rows="4" cols="50" required id="message-textarea"> </textarea> </div> <button type="submit" class="btn btn-default">Send</button> </form> </div> <div class="col-sm-6" style="padding: 10px;"> <div class="form-group"> <label >Address</label> <p>O4F Vasile milea Blvd.Afi Park 2 Bucharest 6 Romania 061344</p> </div> <div class="form-group"> <label >Phone</label> <p> +46 (0)31 33 35 000</p> </div> <div class="form-group"> <label >Email</label> <p>info@sweetbasil-vail.com</p> </div> </div> </div> </div> </div> @include('layouts.partials.footer') @stop ,根本没有这样的日志功能。

我想知道是否有任何方法可以使用这些数字而不解决自己为Decimal编写所有这些函数。

1 个答案:

答案 0 :(得分:0)

您可以直接使用scipy.special(gammaln,loggamma)中的gamma函数日志来编写logsf的表达式。你可以发送一个执行用于卡方分布的logsf的拉取请求。