3

我有 2 条曲线用以下 Mathematica 代码说明:

Show[Plot[PDF[NormalDistribution[0.044, 0.040], x], {x, 0, 0.5}, PlotStyle -> Red],
 Plot[PDF[NormalDistribution[0.138, 0.097], x], {x, 0, 0.5}]]

数学图形

我需要做两件事:

  1. 找到两条曲线相交处的 x 和 y 坐标
  2. 在上面的交点中找到 x 坐标右侧的红色曲线下的区域。

我以前没有在 Mathematica 中解决过这种问题,也没有在文档中找到解决方法。不确定要搜索什么。

4

1 回答 1

10

可以找到它们与 Solve 相交的位置(或者可以使用 FindRoot)。

intersect = 
 x /. First[
   Solve[PDF[NormalDistribution[0.044, 0.040], x] == 
     PDF[NormalDistribution[0.138, 0.097], x] && 0 <= x <= 2, x]]

输出[4]= 0.0995521

现在将 CDF 带到这一点。

CDF[NormalDistribution[0.044, 0.040], intersect]

输出[5]= 0.917554

不确定您是想从 x=0 还是 -infinity 开始;我的版本是后者。如果是前者,那么只需减去在 x=0 处评估的 CDF。

FindRoot 的用法是

intersect = 
 x /. FindRoot[
   PDF[NormalDistribution[0.044, 0.040], x] == 
    PDF[NormalDistribution[0.138, 0.097], x], {x, 0, 2}]

输出[6]= 0.0995521

如果您使用的不是概率分布,则可以积分到交点值。使用 CDF 是一个有用的捷径,因为我们需要集成一个 PDF。

Daniel Lichtblau Wolfram 研究

于 2011-02-03T18:00:56.333 回答