fuxinya
V2EX  ›  数学

求正态分布标准差σ

  •  
  •   fuxinya · Feb 21, 2021 · 4087 views
    This topic created in 2081 days ago, the information mentioned may be changed or developed.

    已知某正态分布μ=550, 落在 518~560 区间的累计概率为 80%, 求σ

    有没有大神给出求解公式?

    或使用Java求解

    13 replies  •  2025-08-20 12:06:33 +08:00
    Ultraman
    Ultraman
    Feb 21, 2021❤️1
    2
    @Ultraman #1 对不起,,请忽略我😶
    fuxinya
    fuxinya
    OP
    Feb 21, 2021
    3
    @Ultraman 查表也可 只要误差不大就行
    ipwx
    ipwx
    Feb 21, 2021
    4
    给楼主一个思路:用 Erf 写出你的方程,然后用牛顿迭代法解。
    ipwx
    ipwx
    Feb 21, 2021
    5


    这个是要解的方程。在你的问题里,mu=550,l=518,r=560,p=0.8
    ipwx
    ipwx
    Feb 21, 2021❤️1
    6
    顺便多说一嘴:如果是单边或者对称的就容易多了。因为单边的话,把 erf 函数放到一边,然后直接用 erf 反函数就行了。C 语言和 numpy 都有 erf 和 erf 反函数的数值实现的。。。可惜你是双边不对称
    fuxinya
    fuxinya
    OP
    Feb 21, 2021
    7
    @ipwx 感谢解答, 刚查资料也看见了 erf 反函数 这就去试试
    lcdtyph
    lcdtyph
    Feb 21, 2021❤️2
    8
    能调 mathematica 的话可以直接直接

    G[x_] := CDF[NormalDistribution[550, sigma], x];
    FindRoot[G[560] - G[518] == 0.8 , {sigma, 1}]

    解出来 sigma=11.7233
    ipwx
    ipwx
    Feb 21, 2021
    9
    @lcdtyph Mathematica 果然牛逼,自动帮搞定各种求根。
    lcdtyph
    lcdtyph
    Feb 21, 2021❤️1
    10
    @ipwx
    是的,符号运算太强大了
    同样功能的代码我用 matlab 写起来这个别扭
    fuxinya
    fuxinya
    OP
    Feb 21, 2021
    11
    @lcdtyph 666
    SharkU
    SharkU
    Feb 21, 2021❤️1
    12
    自己写的 Matlab 代码
    % main script
    tolerance = 1e-8;
    residual = Inf;
    sigma = 15;
    h = 1e-6;
    while residual > tolerance
    der = (cdfeq(sigma+h) - cdfeq(sigma-h))/h;
    sigma = sigma -cdfeq(sigma)/der
    residual = abs(cdfeq(sigma));
    end

    % cdfeq function
    function output = cdfeq( sigma)
    % 方程: f(sigma) - 0.8 = 0
    output = normcdf(560, 550, sigma) - normcdf(518, 550, sigma) - 0.8;
    end
    huangwu5717
    huangwu5717
    Aug 20, 2025
    13
    计算 Z 值,然后查 Z table 行不行,z table: https://zscorecalculator.net/ztable
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1310 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 20:05 · PVG 04:05 · LAX 12:05 · JFK 15:05
    ♥ Do have faith in what you're doing.