简体   繁体   English

了解kde2d z值是什么意思?

[英]Understanding what the kde2d z values mean?

I have two data sets that I am comparing using a ked2d contour plot on a log10 scale, Here I will use an example of the following data sets, 我有两个数据集,我正在使用对数10比例尺的ked2d等高线图进行比较,在这里,我将使用以下数据集的示例,

b<-log10(rgamma(1000,6,3))
a<-log10((rweibull(1000,8,2)))
density<-kde2d(a,b,n=100)
filled.contour(density,color.palette=colorRampPalette(c('white','blue','yellow','red','darkred')))

This produces the following plot, 这将产生以下图, 在此处输入图片说明

Now my question is what does the z values on the legend actually mean? 现在我的问题是图例上的z值实际上意味着什么? I know it represents where most the data lies but 0-15 confuses me. 我知道它代表了大多数数据所在的位置,但0-15使我感到困惑。 I thought it could be a percentage but without the log10 scale I have values ranging from 0-1? 我以为可以是一个百分比,但是如果没有log10刻度,我的数值范围是0-1? And I have also produced plots with scales 1-1.2, 1-2 using my real data. 我还使用我的真实数据绘制了比例为1-1.2、1-2的图。

The colors represent the the values of the estimated density function ranging from 0 to 15 apparently. 颜色显然表示估计的密度函数的值,范围从0到15。 Just like with your other question about the odd looking linear regression I can relate to your confusion. 就像您对奇数线性回归的其他问题一样,我也可能与您的困惑有关。

You just have to understand that a density's integral over the full domain has to be 1, so you can use it to calculate the probability of an observation falling into a specific region. 您只需要了解整个域上的密度积分必须为1,因此可以使用它来计算观察值落入特定区域的概率。

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

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