2011-02-03 93 views
3

我有下面的Mathematica代碼2條所示曲線:查找2條曲線與區域的交叉點的曲線下到交點W的右/數學

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}]] 

Mathematica graphics

我需要做2事情:

  1. 找到x和y座標兩條曲線相交,並
  2. 將R下查找區域ed曲線在 以上路口的x座標右側。

我以前沒有在Mathematica中做過這類問題,也沒有找到在文檔中做到這一點的方法。不確定搜索什麼。

回答

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或負無窮大;我的版本做後者。如果前者只是減去在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 Research

+0

謝謝。有趣的是(至少在我的機器上)FindRoot的使用運行速度比Solve快得多。 – Jagra 2011-02-03 18:30:22