# plot probability

Hi I just want to flatten a function, I tied it with Joined->True, but it did not work, hope somebody of you can help me.

This is my code:

Remove["Global*"]
m = 30; (*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;


Since I want to use a BinomialDistribution I calculated the individual probabilities through:

P = (CDF[NormalDistribution[], -(Log[
AssetV/DebtV] + (μ - 0.5*σ^2)*T)/(σ*Sqrt[
T])])


In the following I generated a table where I wanted to see the probabilities where k=n1, varies from 0 to 30 since n=30, and this is given by:

data1 = Table[
Probability[x >= n1,
x \[Distributed] BinomialDistribution[30, P]], {n1, 0, 30, 1}]


In order to plot the probabilities I entered:

Plot[Probability[x >= n1,
x \[Distributed] BinomialDistribution[30, P]], {n1, 0, 30},
PlotRange -> All, AxesLabel -> {"# of Defaults", "PD"},
Filling -> Axis]


and now I just want to flatten this function. I tried it with Joined-True, which did not work out.

I want also to show the density by:

DiscretePlot[PDF[BinomialDistribution[30, P], n1], {n1, 0, 30},
PlotRange -> All, AxesLabel -> {"# of Defaults", "PD"},
Joined -> True]


However, is there the possibility to implement data1=Table[...] into the two functions, would it be then possible to generate the plot by the ListLinePlot function?

• is your question on how to combine plots? Jul 23, 2013 at 8:26
• @Stefan no my question is, how to flatten the plot given by Plot[Probability[...]] and if it is possible to implement data1 into Plot[Probability[...]]. Jul 23, 2013 at 8:28
• @Nasser I want the results from Plot[Probability[...]] to be a combined/connected line Jul 23, 2013 at 8:28
• Perhaps Exclusions -> None is the option you're looking for? Jul 23, 2013 at 8:39

You mean like this? (no place to put in comment, will remove if not)

 data = Table[{n1,
Probability[x >= n1,
x \[Distributed] BinomialDistribution[30, P]]}, {n1, 0, 20}];
ListPlot[data, Joined -> True, Mesh -> True, PlotRange -> All,
Frame -> True, PlotStyle -> PointSize[.02], GridLines -> Automatic,
GridLinesStyle -> LightGray]
` side-by-side • @ Nasser thank you, that was exactly what I was looking for Jul 23, 2013 at 8:46