简体   繁体   English

从 CDF 曲线中选取值

[英]Pick values from a CDF curve

everyone, I have a generic values distribution.大家,我有一个通用的值分布。 I post the graph.我发布图表。

在此处输入图像描述

Is there a way to generate a CDF from these values?有没有办法从这些值生成 CDF? Using sns I can create a graph:使用 sns 我可以创建一个图表:

在此处输入图像描述

My goal is to assign a value to the y-axis and take a value from the x-axis from the CDF.我的目标是为 y 轴分配一个值,并从 CDF 的 x 轴中获取一个值。 I'm searching online but can't find a method that doesn't require going through curve normalisation.我正在网上搜索,但找不到不需要通过曲线归一化的方法。

I'm not sure of the exact data format, but something like numpy.cumsum will take a numpy array that represents a PDF and turn it into an array that represents the CDF.我不确定确切的数据格式,但像numpy.cumsum这样的东西将采用一个代表 PDF 的 numpy 数组,并将其转换为代表 CDF 的数组。

From there, with your array of p and cdf it is straightforward to find the p value that gives the cdf (which is what I understand you are looking for) with some interpolation with "nearest" as the type of interpolation (see the documentation on scipy.interpolate.interp1d for example).从那里,使用你的pcdf数组,可以直接找到给出cdfp值(这是我所理解的你正在寻找的)和一些以“最近”作为插值类型的插值(参见文档例如scipy.interpolate.interp1d )。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM