I have a code that illustrates a certain figure.
\documentclass{article}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}[
declare function={ Nprime(\x) = 1/(sqrt(2*pi))*exp(-0.5*(pow(\x,2)));
d2(\x,\y,\KK,\RR,\SIG) = (ln(\x/\KK)+(\RR-(pow(\SIG,2)/2)*\y))/(\SIG*(sqrt(\y)));
myfun(\x,\y,\KK,\RR,\SIG) = exp(-\RR*\y)*Nprime(d2(\x,\y,\KK,\RR,\SIG))/(\x*\SIG*sqrt(\y));
},
]
\begin{axis}[y domain=0.01:0.3,domain=95:105,view={150}{20}]
\addplot3[surf] {myfun(x,y,100,0,0.09)};
\end{axis}
\end{tikzpicture}
\end{document}
Instead of Nprime(\x) I would like to declare and integrate a cumulative distribution function `N(\x). A very close approximation of cumulative distribution function would also be fine. Everything else should remain equal. Does anybody know how to do it? Thanks in advance!!!
Here is the formula: enter link description here
Something similar is provided here enter link description here but I dont know how to integrate is according to my needs :(
Here is a modified version that doesn't work. The last part of the function, i.e. (\x*\SIG*sqrt(\y)) was removed because it is not needed in this case. Here is the code
\documentclass{article}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}[
declare function={ normcdf(\x,\m,\s) = 1/(1 + exp(-0.07056*((\x-\m)/\s)^3 - 1.5976*(\x-\m)/\s));;
d2(\x,\y,\KK,\RR,\SIG) = (ln(\x/\KK)+(\RR-(pow(\SIG,2)/2)*\y))/(\SIG*(sqrt(\y)));
myfun(\x,\y,\KK,\RR,\SIG) = exp(-\RR*\y)*normdcf(d2(\x,\y,\KK,\RR,\SIG))
},
]
\begin{axis}[y domain=0.01:0.3,domain=95:105,view={150}{20}]
\addplot3[surf] {myfun(x,y,100,0,0.09)};
\end{axis}
\end{tikzpicture}
\end{document}

myfunandd2aren't very enlightening function names)? Could you provide a link to a Wolfram Alpha plot of the desired function? – Jake Aug 01 '13 at 13:28N'andd_2, and didn't explain what the first function does, hence percusse's choice ofmyfun. Anyway, what do you mean with "difficulties integrating it into the code"? If you take the definition ofnormcdfand plug it into your code, do you get an error message? Or is the result not what you expected? – Jake Aug 01 '13 at 13:53