全部版块 我的主页
论坛 金融投资论坛 六区 金融学(理论版) 量化投资
12872 12
2014-09-09
In mathematics, the error function (also called the Gauss error function) is a special function (non-elementary) of sigmoid shape that occurs in probability, statistics, and partial differential equations describing diffusion. It is defined as:

   


    The complementary error function, denoted erfc, is defined as

   


    Which also defines erfcx, the scaled complementary error function(which can be used instead of erfc to avoid arithmetic underflow).


    The imaginary error function, denoted erfi, is defined as

,   



    Where D(x) is the Dawson function (which can be used instead of erfi to avoid arithmetic overflow).When the error function is evaluated for arbitrary complex arguments z, the resulting complex error function is usually discussed in scaled form as the Faddeeva function:       




2篇关于误差函数的文献







    由于MATLAB的所有版本已经拥有erf、erfc及其逆函数的代码,但是只有R2014a才有erfi函数的代码,下面将给出erfi函数的MATLAB(R2014a)代码。   

本帖隐藏的内容

function ans=erfi(x)
% %erfi(x). The Imaginary error function, as it is defined in Mathematica
% %erfi(z)==erf(iz)/i (z could be complex) using
% %the incomplete gamma function in matlab: gammainc
% %Using "@": erfi = @(x) real(-sqrt(-1).*sign(x).*gammainc(-x.^2,1/2))
% %Note: limit(x->0) erfi(x)/x -> 2/sqrt(pi)
%
% %Example 1:
% x=linspace(0.001,6,100);
% y=exp(-x.^2).*erfi(x)./2./x;
% figure(1), clf;plot(x,y*sqrt(pi))
%
% %Example 2:
% [x,y]=meshgrid(linspace(-3,3,180),linspace(-3,3,180));
% z=x+i*y;
% figure(1), clf;contourf(x,y,log(erfi(z)))
% axis equal;axis off
xc=5.7;%cut for asymptotic approximation (when x is real)
ans=~isreal(x).*(-(sqrt(-x.^2)./(x+isreal(x))).*gammainc(-x.^2,1/2))+...
    isreal(x).*real(-sqrt(-1).*sign(x).*((x<xc).*gammainc(-x.^2,1/2))+...
    (x>=xc).*exp(x.^2)./x/sqrt(pi));




其数值形式的MATLAB Code
function f=erfi1(y)
fun=inline('exp(x.^2)*2/sqrt(pi)','x');
f=quadl(fun,0,y);







   







二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2014-9-9 22:36:17
互相交流!!!!
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2014-9-9 22:51:12
fantuanxiaot 发表于 2014-9-9 22:36
互相交流!!!!
求matlab 2014a 下载地址!
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2014-9-9 22:57:36
离歌レ笑 发表于 2014-9-9 22:51
求matlab 2014a 下载地址!
http://www.ed2000.com/ShowFile.asp?FileID=515482
评论可以看https://bbs.pinggu.org/thread-3157394-1-1.html


二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2014-9-9 23:02:34
离歌レ笑 发表于 2014-9-9 22:51
求matlab 2014a 下载地址!
我没有下载2014a 但是代码我是在

http://www.mathworks.cn/matlabce ... 18238-erfi-function

这里找到的
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2014-9-10 00:14:07
顶一个啦!!!!
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群