核密度估计中的恒定带宽 (R)

发布于 2024-11-30 04:20:22 字数 176 浏览 4 评论 0原文

我现在在 R 方面遇到了一些困难。

我所拥有的:

  • 每个三角核具有最小值的向量
  • 具有最大值的向量
  • 具有“中间”点的向量(每个三角形的选择应该在哪里)

我需要的是:

  • 密度估计(三角核ofc)

I'm having some difficulties with R right now.

What I have:

  • a vector with minimal values for each triangular kernel
  • a vector with maximal values
  • a vector with the "middle" point (where the pick of each triangular should be)

What I need:

  • a density estimate (triangular kernels ofc)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

她如夕阳 2024-12-07 04:20:22

看看您是否可以在此示例的基础上构建具有三角内核的基本密度函数的不同带宽规格:

data("faithful", package = "datasets") 
x <- faithful$waiting 
opar <- par(mfcol= c(2,2))
for (bw in c(3,6,12,18) ) {
  hist(x, xlab = "Waiting interval", ylab = "Eruption Freq", 
  probability = TRUE, main = "Density plot: Triangular kernel", 
  border = "gray", sub= bquote("Bandwidth = "*.(bw) ) ) 
  lines(density(x, width = bw, window = "triangular"), lty=3, col="red")
  }
par(opar)

See if you can build on this example of varying bandwidth specifications to the base density function with a triagular kernel:

data("faithful", package = "datasets") 
x <- faithful$waiting 
opar <- par(mfcol= c(2,2))
for (bw in c(3,6,12,18) ) {
  hist(x, xlab = "Waiting interval", ylab = "Eruption Freq", 
  probability = TRUE, main = "Density plot: Triangular kernel", 
  border = "gray", sub= bquote("Bandwidth = "*.(bw) ) ) 
  lines(density(x, width = bw, window = "triangular"), lty=3, col="red")
  }
par(opar)

Four bandwidths to triangular kernel density plot

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文