需要帮助绘制图表

需要帮助绘制图表

我需要帮助绘制接下来的两个图表。我不知道如何将所有这些公式组合起来制作图表。我需要一个图表,其中 S(即股票价格)的值在范围 (500,1500) 内不同。看涨期权和看跌期权的公式是

$\pi_C = exp(-r(T-t_0))(FN(d_1)-KN(d_2))$
$\pi_p = exp(-r(T-t_0))(KN(-d_2)-FN(-d_1))$ 

我需要哪些图表

其中 F 是 $F = S*exp(r(T-t_0))$

$d_1 = \frac{\ln\left({\frac{F}{K}}\right) + \frac{1}{2}\sigma^2(T-t_0)}{\sigma\sqrt{T-t_0}}$
$d_2 = \frac{\ln\left({\frac{F}{K}}\right) - \frac{1}{2}\sigma^2(T-t_0)}{\sigma\sqrt{T-t_0}}$

固定值为K = 1000T =1,,,,,t_0 = 0代表r = 0.02累积标准\sigma = 0.2N态(高斯)分布。

\documentclass[a4 paper, 12pt]{article}
\usepackage{pgfplots}
\setlength{\baselineskip}{17pt}
\usepackage{geometry}
\usepackage[croatian]{babel}
\usepackage[utf8]{inputenc}
\usepackage[unicode]{hyperref}
\usepackage{floatrow}
\usepackage[final]{pdfpages}
\geometry{a4paper,
left=25mm,right=20mm,top=25mm,bottom=25mm}
\usepackage{multirow}
\usepackage{tabularx,ragged2e,booktabs,caption}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{pgfplots}
\usepackage{graphicx}
\usepackage{siunitx}
\usepackage{mathtools}
\usepackage{chngcntr}
\usepackage{tikz}
\usetikzlibrary{datavisualization}
\usetikzlibrary{datavisualization.formats.functions}
\counterwithin{figure}{section}
\counterwithin{table}{section}
\usepackage{enumitem}
\usepackage{subfig}
\usepackage{array}
\usepackage{lipsum}
\graphicspath{{images/}}
\theoremstyle{plain}
\newtheorem{defn}{Definicija}[section]
\newtheorem{nap}{Napomena}[section]
\newtheorem{thm}{Teorem}[section]
\newtheorem{prop}{Propozicija}[section]
\newtheorem{krl}{Korolar}[section]
\newtheorem{lema}{Lema}[section]
\theoremstyle{definition}
\newtheorem{pr}{Primjer}[section]
\numberwithin{equation}{section}
\begin{document}

\begin{tikzpicture}
\begin{axis}[
    declare function={
        K=1000;
        r=0.02;
        sigma=0.2;
        T=1;
        t0=0;
        F(\x)=(\x)*exp(r(T-t0));
        d1=(ln(F/K)+0.5*sigma*sigma*(T-t0))/(sigma*sqrt(T-t0));
        d2=(ln(F/K)-0.5*sigma*sigma*(T-t0))/(sigma*sqrt(T-t0));
        pi_c= exp(-r(T-t0))*(F*N(d1)-K*N(d2));
        pi_p= exp(-r(T-t0))*(K*N(-d2)-F*N(-d1));
    },
]

    \addplot+ ;
\end{axis}
\end{tikzpicture}

\end{document}

编辑:我添加了绘图代码。N 将是标准正态的累积分布函数,我不知道如何制作它。N(x) 的公式是 $\frac{1}{\sqrt{2\pi}}\int_{-\infty}^{x} exp{\frac{-t^2}{2}}dt$,我需要 pi_c 和 pi_p 的图形

相关内容