I want to plot the PDF of binomial distributed function and a mixed binomial distributed function, therefore I entered for the binomial distribution function the following:
Remove["Global`*"];
m = 45; (*number of banks*)
n = 5;(*number of defaults*)
AssetV = 100;(*asset value at T*)
DebtV = 80;(*debt value at T*)
μ = 0.2;(*annual drift*)
σ = 0.3;(*annual volatility*)
T = 5;(*years*)
ρ = 0.8; (*asset correlation*)
(*calculation of the individual default probabiltiy p^*, which is \
determined based on the Merton model*)
P* = (CDF[
NormalDistribution[], -(Log[
AssetV/DebtV] + (μ - 0.5*σ^2)*T)/(σ*Sqrt[
T])])
(*generating data table, which captures the probabilities that the \
number of defaults will be greater than n1, whereas n1 encompasses \
the range from 0 to m by the step of 1 (integer)*)
dataBD = Table[
Probability[x >= n1,
x \[Distributed] BinomialDistribution[m, P*]], {n1, 0, m,
1}]
now I want to plot everything:
pdfBD = DiscretePlot[
PDF[BinomialDistribution[m, P*], n1], {n1, 0, m},
PlotRange -> All, AxesLabel -> {"# of Defaults", "PD"},
Joined -> True, ImageSize -> 500]
so I get this plot
now I want to consider the mixed binomial distribution, determiend by the following code:
dataMBD =
Table[1 -
CDF[NormalDistribution[], ((1/
Sqrt[ρ])*(((Sqrt[
1 - ρ])*(InverseCDF[
NormalDistribution[], (n1/m)]) + (InverseCDF[
NormalDistribution[], (CDF[
NormalDistribution[], -(Log[
AssetV/DebtV] + (μ - 0.5*σ^2)*
T)/(σ*Sqrt[T])])]))))], {n1, 0, m, 1}]
However, if I want to see its PDF and if I therefore enter this command it does not work:
DiscretePlot[PDF[dataMBD, n1], {n1, 0, m, 1}]
Is the error within the command above, or is there a fundamental problem based on wrong understanding?
hope somebody can help me. thanks.
dataMBD
is not a pmf (or pdf as you call it). It is just a table of values {1, 0.99, 0.98, ..., 0.96, ..., 0.74, ..., 0}. It is not a distribution.PDF[dataMBD, blah]
makes no sense. $\endgroup$