# How can I use one slider to manipulate two functions?

Posted 10 years ago
2154 Views
|
|
0 Total Likes
|
 EGPD[r_, \[Theta]_, \[Lambda]_] := \[Theta] (r \[Lambda] + \ \[Theta])^(r - 1) (E^(-r \[Lambda] - \[Theta]))/r! EGPDdist[\[Theta]_, \[Lambda]_, n_] :=   Table[EGPD[r, \[Theta], \[Lambda]], {r, 0, n}] // N (*  distribution of EGPD  omitting EGPD=0*) EGPDdistdrop[\[Theta]_, \[Lambda]_, n_] :=   Drop[Table[EGPD[r, \[Theta], \[Lambda]], {r, 0, n}], 1] // N (* EGPD for r>1 conditioned on r not zero *) EGPDdistcond[\[Theta]_, \[Lambda]_, n_] := EGPDdistdrop[\[Theta], \[Lambda], n]/(1 - E^(-\[Theta]))plotpdfGPD = Manipulate[  ListLogLogPlot[EGPDdistcond[\[Lambda], \[Lambda], 2000],    Joined -> True,    PlotRange -> {All, {0.0001, 1}}], {{\[Lambda], .1, "Lamda"}, 0.1,    1}]nextstage[thisstage_, \[Lambda]_] := RandomInteger[PoissonDistribution[ \[Lambda]]] nsamples = 50;samples = Manipulate[Grid[Table[    NestWhileList[nextstage[#, Lamda] &,      1, # != 0 &], {nsamples}]], {{Lamda, .5, "Lamda"}, 0.1, 1}]So here I have two manipulates, one for plotpdfGPD and the other for samples. Both have slider "lamda" that  changes from 0.1 to 1.  How can I have only one slider for both the functions? is it possible?