(*^ ::[ Information = "This is a Mathematica Notebook file. It contains ASCII text, and can be transferred by email, ftp, or other text-file transfer utility. It should be read or edited using a copy of Mathematica or MathReader. If you received this as email, use your mail application or copy/paste to save everything from the line containing (*^ down to the line containing ^*) into a plain text file. On some systems you may have to give the file a name ending with ".ma" to allow Mathematica to recognize it as a Notebook. The line below identifies what version of Mathematica created this file, but it can be opened using any other version as well."; FrontEndVersion = "Macintosh Mathematica Notebook Front End Version 2.2"; MacintoshStandardFontEncoding; fontset = title, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeTitle, center, M7, bold, e8, 24, "Times"; fontset = subtitle, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeTitle, center, M7, bold, e6, 18, "Times"; fontset = subsubtitle, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeTitle, center, M7, italic, e6, 14, "Times"; fontset = section, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, grayBox, M22, bold, a20, 18, "Times"; fontset = subsection, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, blackBox, M19, bold, a15, 14, "Times"; fontset = subsubsection, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, whiteBox, M18, bold, a12, 12, "Times"; fontset = text, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; fontset = smalltext, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 10, "Times"; fontset = input, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeInput, M42, N23, bold, L-5, 12, "Courier"; fontset = output, output, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, L-5, 12, "Courier"; fontset = message, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, R65535, L-5, 12, "Courier"; fontset = print, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, L-5, 12, "Courier"; fontset = info, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, B65535, L-5, 12, "Courier"; fontset = postscript, PostScript, formatAsPostScript, output, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeGraphics, M7, l34, w282, h287, 12, "Courier"; fontset = name, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, italic, 10, "Geneva"; fontset = header, inactive, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; fontset = leftheader, inactive, L2, 12, "Times"; fontset = footer, inactive, noKeepOnOnePage, preserveAspect, center, M7, 12, "Times"; fontset = leftfooter, inactive, L2, 12, "Times"; fontset = help, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 10, "Times"; fontset = clipboard, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; fontset = completions, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; fontset = special1, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; fontset = special2, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; fontset = special3, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; fontset = special4, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; fontset = special5, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; paletteColors = 128; automaticGrouping; currentKernel; ] :[font = input; preserveAspect] (* This notebook illustrates the use of packages for creating and manipulating Bayesian networks, Temporal Bayesian networks, and their Markov process equivalents. *) :[font = input; preserveAspect] Needs["Dynamics`Packages`BayesianNetworks`"] :[font = input; preserveAspect] ResetBayesianNetworks[] ; :[font = input; preserveAspect] network1 = CreateBayesianNetwork[3] ; :[font = input; preserveAspect; startGroup] CurrentBayesianNetwork[] :[font = output; output; inactive; preserveAspect; endGroup] BayesianNetwork[1] ;[o] BayesianNetwork[1] :[font = input; preserveAspect; startGroup] Pr[1] :[font = print; inactive; preserveAspect; endGroup] Warning! Undefined probability. Pr[{1, True},{}] :[font = input; preserveAspect; startGroup] Pr[1,2] :[font = print; inactive; preserveAspect; endGroup] Warning! Undefined probability. Pr[{1, True},{{2, True}}] :[font = input; preserveAspect; startGroup] Pr[!1,2] = 0.8 :[font = output; output; inactive; preserveAspect; endGroup] 0.8 ;[o] 0.8 :[font = input; preserveAspect; startGroup] Pr[!1,2] :[font = output; output; inactive; preserveAspect; endGroup] 0.8 ;[o] 0.8 :[font = input; preserveAspect; startGroup] Pr[1,2] :[font = output; output; inactive; preserveAspect; endGroup] 0.2 ;[o] 0.2 :[font = input; preserveAspect; startGroup] Pr[1,!2] = 0.5 :[font = output; output; inactive; preserveAspect; endGroup] 0.5 ;[o] 0.5 :[font = input; preserveAspect; startGroup] Pr[2,3] = 1.0 :[font = output; output; inactive; preserveAspect; endGroup] 1. ;[o] 1. :[font = input; preserveAspect; startGroup] Pr[2,{1,3}] = 0.7 :[font = print; inactive; preserveAspect; endGroup] Warning! Discrepancy in parent specification. :[font = input; preserveAspect; startGroup] Pr[{1, True},{{2, True}},network1] :[font = output; output; inactive; preserveAspect; endGroup] 0.2 ;[o] 0.2 :[font = input; preserveAspect; startGroup] Pr[!2,3] :[font = output; output; inactive; preserveAspect; endGroup] 0. ;[o] 0. :[font = input; preserveAspect; startGroup] CheckDistribution[network1] :[font = print; inactive; preserveAspect; endGroup] Warning! Undefined probability. Pr[{2, True},{{3, False}}] Warning! Undefined probability. Pr[{2, False},{{3, False}}] Warning! Undefined probability. Pr[{3, True},{}] Warning! Undefined probability. Pr[{3, False},{}] :[font = input; preserveAspect; startGroup] Pr[3] = 0.5 :[font = output; output; inactive; preserveAspect; endGroup] 0.5 ;[o] 0.5 :[font = input; preserveAspect; startGroup] Pr[2,!3] = 0.7 :[font = output; output; inactive; preserveAspect; endGroup] 0.7 ;[o] 0.7 :[font = input; preserveAspect] CheckDistribution[network1] :[font = input; preserveAspect; startGroup] ShowGraph[DependencyGraph[network1],Directed] ; :[font = postscript; PostScript; formatAsPostScript; output; inactive; preserveAspect; pictureLeft = 34; pictureWidth = 282; pictureHeight = 282; endGroup] %! %%Creator: Mathematica %%AspectRatio: 1 MathPictureStart %% Graphics /Courier findfont 10 scalefont setfont % Scaling calculations -0.1617 1.10638 0.0486285 0.97257 [ [ 0 0 0 0 ] [ 1 1 0 0 ] ] MathScale % Start of Graphics 1 setlinecap 1 setlinejoin newpath [ ] 0 setdash 0 g p P 0 0 m 1 0 L 1 1 L 0 1 L closepath clip newpath p .025 w .05532 .95137 Mdot .05532 .04863 Mdot .94468 .5 Mdot .004 w .05532 .04863 m .05532 .95137 L s .94468 .5 m .05532 .04863 L s .05532 .95137 m .02766 .90274 L .08298 .90274 L F .05532 .04863 m .11706 .05189 L .0894 .094 L F P % End of Graphics MathPictureEnd :[font = input; preserveAspect; startGroup] Parents[1,network1] :[font = output; output; inactive; preserveAspect; endGroup] {2} ;[o] {2} :[font = input; preserveAspect] network2 = CreateBayesianNetwork[3] ; :[font = input; preserveAspect; startGroup] CurrentBayesianNetwork[] :[font = output; output; inactive; preserveAspect; endGroup] BayesianNetwork[2] ;[o] BayesianNetwork[2] :[font = input; preserveAspect] Pr[1,{2,3}] = 0.1 ; :[font = input; preserveAspect] Pr[1,{!2,3}] = 0.5 ; :[font = input; preserveAspect] Pr[1,{2,!3}] = 0.5 ; :[font = input; preserveAspect] Pr[1,{!2,!3}] = 0.5 ; :[font = input; preserveAspect] Pr[2] = 0.5 ; :[font = input; preserveAspect] Pr[3,1] = 0.5 ; :[font = input; preserveAspect] Pr[3,!1] = 0.5 ; :[font = input; preserveAspect; startGroup] CheckDistribution[network2] :[font = print; inactive; preserveAspect; endGroup] Warning! There is a cycle in the dependency graph. :[font = input; preserveAspect; startGroup] ResetDistribution[network2] :[font = print; inactive; preserveAspect; endGroup] Warning! Setting conditional probability to Null. Warning! Setting conditional probability to Null. Warning! Setting conditional probability to Null. Warning! Setting conditional probability to Null. Warning! Setting conditional probability to Null. Warning! Setting conditional probability to Null. Warning! Setting conditional probability to Null. Warning! Setting conditional probability to Null. Warning! Setting conditional probability to Null. Warning! Setting conditional probability to Null. Warning! Setting conditional probability to Null. Warning! Setting conditional probability to Null. Warning! Setting conditional probability to Null. Warning! Setting conditional probability to Null. :[font = input; preserveAspect] Pr[1,{2,3}] = .1 ; :[font = input; preserveAspect] Pr[1,{!2,3}] = .5 ; :[font = input; preserveAspect] Pr[1,{2,!3}] = .5 ; :[font = input; preserveAspect] Pr[1,{!2,!3}] = .5 ; :[font = input; preserveAspect] Pr[2] = .5 ; :[font = input; preserveAspect] Pr[3] = .5 ; :[font = input; preserveAspect] CheckDistribution[network2] ; :[font = input; preserveAspect; startGroup] ShowGraph[DependencyGraph[network2],Directed] ; :[font = postscript; PostScript; formatAsPostScript; output; inactive; preserveAspect; pictureLeft = 34; pictureWidth = 282; pictureHeight = 282; endGroup] %! %%Creator: Mathematica %%AspectRatio: 1 MathPictureStart %% Graphics /Courier findfont 10 scalefont setfont % Scaling calculations -0.1617 1.10638 0.0486285 0.97257 [ [ 0 0 0 0 ] [ 1 1 0 0 ] ] MathScale % Start of Graphics 1 setlinecap 1 setlinejoin newpath [ ] 0 setdash 0 g p P 0 0 m 1 0 L 1 1 L 0 1 L closepath clip newpath p .025 w .05532 .95137 Mdot .05532 .04863 Mdot .94468 .5 Mdot .004 w .05532 .04863 m .05532 .95137 L s .94468 .5 m .05532 .95137 L s .05532 .95137 m .02766 .90274 L .08298 .90274 L F .05532 .95137 m .0894 .906 L .11706 .94811 L F P % End of Graphics MathPictureEnd :[font = input; preserveAspect; startGroup] TableForm[Table[RandomSample[network2],{10}]] :[font = output; output; inactive; preserveAspect; endGroup] TableForm[{{False, True, False}, {False, True, False}, {False, True, True}, {False, False, True}, {False, False, True}, {True, False, True}, {False, True, False}, {True, False, True}, {True, False, True}, {False, False, True}}] ;[o] False True False False True False False True True False False True False False True True False True False True False True False True True False True False False True :[font = input; preserveAspect] Needs["Dynamics`Packages`MarkovProcesses`"] :[font = input; preserveAspect] ResetMarkovProcesses[] :[font = input; preserveAspect; startGroup] process1 = CreateMarkovProcess[3] :[font = output; output; inactive; preserveAspect; endGroup] MarkovProcess[1] ;[o] MarkovProcess[1] :[font = input; preserveAspect] SetTransitionProbability[1,1,0.3,process1] ; SetTransitionProbability[1,2,0.7,process1] ; SetTransitionProbability[2,3,1.0,process1] ; SetTransitionProbability[3,3,0.3,process1] ; SetTransitionProbability[3,1,0.7,process1] ; :[font = input; preserveAspect] CheckDistribution[process1] :[font = input; preserveAspect; startGroup] ShowGraph[TransitionGraph[process1],Directed] ; :[font = postscript; PostScript; formatAsPostScript; output; inactive; preserveAspect; pictureLeft = 34; pictureWidth = 282; pictureHeight = 282; endGroup] %! %%Creator: Mathematica %%AspectRatio: 1 MathPictureStart %% Graphics /Courier findfont 10 scalefont setfont % Scaling calculations -0.1617 1.10638 0.0486285 0.97257 [ [ 0 0 0 0 ] [ 1 1 0 0 ] ] MathScale % Start of Graphics 1 setlinecap 1 setlinejoin newpath [ ] 0 setdash 0 g p P 0 0 m 1 0 L 1 1 L 0 1 L closepath clip newpath p .025 w .05532 .95137 Mdot .05532 .04863 Mdot .94468 .5 Mdot .004 w .05532 .95137 m .05532 .95137 L s .05532 .95137 m .05532 .04863 L s .05532 .04863 m .94468 .5 L s .94468 .5 m .05532 .95137 L s .94468 .5 m .94468 .5 L s .05532 .95137 m .11064 .92706 L .11064 .97569 L F .05532 .04863 m .08298 .09726 L .02766 .09726 L F .94468 .5 m .88294 .49674 L .9106 .45463 L F .05532 .95137 m .0894 .906 L .11706 .94811 L F .94468 .5 m 1 .47569 L 1 .52431 L F P % End of Graphics MathPictureEnd :[font = input; preserveAspect; startGroup] TableForm[Edges[TransitionGraph[process1]]] :[font = output; output; inactive; preserveAspect; endGroup] TableForm[{{0.3, 0.7, 0}, {0, 0, 1.}, {0.7, 0, 0.3}}] ;[o] 0.3 0.7 0 0 0 1. 0.7 0 0.3 :[font = input; preserveAspect; startGroup] RandomTrajectory[1,10,process1] :[font = output; output; inactive; preserveAspect; endGroup] {1, 1, 2, 3, 1, 2, 3, 1, 1, 1, 2} ;[o] {1, 1, 2, 3, 1, 2, 3, 1, 1, 1, 2} :[font = input; preserveAspect; startGroup] EstimateSteadyState[1,10,process1] :[font = output; output; inactive; preserveAspect; endGroup] {0.3870633729, 0.2481955441, 0.364741083} ;[o] {0.387063, 0.248196, 0.364741} :[font = input; preserveAspect; startGroup] ShowGraph[MultiStagePhaseSpaceDiagram[1,6,10,process1],Directed] ; :[font = postscript; PostScript; formatAsPostScript; output; inactive; preserveAspect; pictureLeft = 34; pictureWidth = 282; pictureHeight = 282; endGroup] %! %%Creator: Mathematica %%AspectRatio: 1 MathPictureStart %% Graphics /Courier findfont 10 scalefont setfont % Scaling calculations -0.289474 1.22807 0.12963 2.59259 [ [ 0 0 0 0 ] [ 1 1 0 0 ] ] MathScale % Start of Graphics 1 setlinecap 1 setlinejoin newpath [ ] 0 setdash 0 g p P 0 0 m 1 0 L 1 1 L 0 1 L closepath clip newpath p .025 w .0614 .12963 Mdot .0614 .5 Mdot .0614 .87037 Mdot .23684 .12963 Mdot .23684 .5 Mdot .23684 .87037 Mdot .41228 .12963 Mdot .41228 .5 Mdot .41228 .87037 Mdot .58772 .12963 Mdot .58772 .5 Mdot .58772 .87037 Mdot .76316 .12963 Mdot .76316 .5 Mdot .76316 .87037 Mdot .9386 .12963 Mdot .9386 .5 Mdot .9386 .87037 Mdot .004 w .0614 .12963 m .23684 .12963 L s .0614 .12963 m .23684 .5 L s .23684 .12963 m .41228 .5 L s .23684 .5 m .41228 .87037 L s .41228 .5 m .58772 .87037 L s .41228 .87037 m .58772 .12963 L s .41228 .87037 m .58772 .87037 L s .58772 .12963 m .76316 .5 L s .58772 .87037 m .76316 .12963 L s .58772 .87037 m .76316 .87037 L s .76316 .12963 m .9386 .12963 L s .76316 .12963 m .9386 .5 L s .76316 .5 m .9386 .87037 L s .76316 .87037 m .9386 .12963 L s .76316 .87037 m .9386 .87037 L s .23684 .12963 m .17544 .19444 L .17544 .06481 L F .23684 .5 m .17171 .45417 L .21513 .36251 L F .41228 .5 m .34715 .45417 L .39057 .36251 L F .41228 .87037 m .34715 .82454 L .39057 .73288 L F .58772 .87037 m .52259 .82454 L .56601 .73288 L F .58772 .12963 m .58772 .27456 L .5328 .21659 L F .58772 .87037 m .52632 .93519 L .52632 .80556 L F .76316 .5 m .69803 .45417 L .74145 .36251 L F .76316 .12963 m .76316 .27456 L .70824 .21659 L F .76316 .87037 m .70175 .93519 L .70175 .80556 L F .9386 .12963 m .87719 .19444 L .87719 .06481 L F .9386 .5 m .87347 .45417 L .91689 .36251 L F .9386 .87037 m .87347 .82454 L .91689 .73288 L F .9386 .12963 m .9386 .27456 L .88368 .21659 L F .9386 .87037 m .87719 .93519 L .87719 .80556 L F P % End of Graphics MathPictureEnd :[font = input; preserveAspect; startGroup] process2 = CreateMarkovProcess[2] :[font = output; output; inactive; preserveAspect; endGroup] MarkovProcess[2] ;[o] MarkovProcess[2] :[font = input; preserveAspect] SetTransitionProbability[1,1,1.0,process2] ; SetTransitionProbability[1,2,0.3,process2] ; :[font = input; preserveAspect; startGroup] CheckDistribution[process2] :[font = print; inactive; preserveAspect; endGroup] Warning! Transition probabilities must sum to one.{1., 0.3} Warning! Transition probabilities must sum to one.{0, 0} :[font = input; preserveAspect] ResetDistribution[process2] :[font = input; preserveAspect] SetTransitionProbability[1,2,1.0,process2] ; SetTransitionProbability[2,2,1.0,process2] ; :[font = input; preserveAspect] CheckDistribution[process2] :[font = input; preserveAspect; startGroup] EstimateSteadyState[1,10,process2] :[font = output; output; inactive; preserveAspect; endGroup] {0., 1.} ;[o] {0., 1.} :[font = input; preserveAspect] Needs["Dynamics`Packages`TemporalBayesianNetworks`"] :[font = input; preserveAspect] network3 = CreateTemporalBayesianNetwork[2] ; :[font = input; preserveAspect] Pr[X[1,0]] = 0.5 ; Pr[X[2,0]] = 0.5 ; Pr[X[1,1], X[1,0]] = 0.3 ; Pr[X[1,1],!X[1,0]] = 0.8 ; Pr[X[2,1],{X[2,0],X[1,1]}] = 0.2 ; Pr[X[2,1],{X[2,0],!X[1,1]}] = 0.5 ; Pr[X[2,1],{!X[2,0],X[1,1]}] = 0.3 ; Pr[X[2,1],{!X[2,0],!X[1,1]}] = 0.9 ; :[font = input; preserveAspect; startGroup] ShowGraph[DependencyGraph[network3], Directed] ; :[font = postscript; PostScript; formatAsPostScript; output; inactive; preserveAspect; pictureLeft = 34; pictureWidth = 282; pictureHeight = 282; endGroup] %! %%Creator: Mathematica %%AspectRatio: 1 MathPictureStart %% Graphics /Courier findfont 10 scalefont setfont % Scaling calculations -1.1 2 0.1 2 [ [ 0 0 0 0 ] [ 1 1 0 0 ] ] MathScale % Start of Graphics 1 setlinecap 1 setlinejoin newpath [ ] 0 setdash 0 g p P 0 0 m 1 0 L 1 1 L 0 1 L closepath clip newpath p .025 w .1 .1 Mdot .1 .9 Mdot .9 .1 Mdot .9 .9 Mdot .004 w .1 .1 m .9 .1 L s .1 .9 m .9 .9 L s .9 .1 m .9 .9 L s .9 .1 m .8 .15 L .8 .05 L F .9 .9 m .8 .95 L .8 .85 L F .9 .9 m .85 .8 L .95 .8 L F P % End of Graphics MathPictureEnd :[font = input; preserveAspect; startGroup] ShowLabeledGraph[DependencyGraph[network3], VertexLabels[network3]] ; :[font = postscript; PostScript; formatAsPostScript; output; inactive; preserveAspect; pictureLeft = 34; pictureWidth = 282; pictureHeight = 282; endGroup] %! %%Creator: Mathematica %%AspectRatio: 1 MathPictureStart %% Graphics /Courier findfont 10 scalefont setfont % Scaling calculations -1.1 2 0.1 2 [ [ 0 0 0 0 ] [ 1 1 0 0 ] ] MathScale % Start of Graphics 1 setlinecap 1 setlinejoin newpath [ ] 0 setdash 0 g p P 0 0 m 1 0 L 1 1 L 0 1 L closepath clip newpath p .025 w .1 .1 Mdot .1 .9 Mdot .9 .1 Mdot .9 .9 Mdot .004 w .1 .1 m .9 .1 L s .1 .9 m .9 .9 L s .9 .1 m .9 .9 L s .1 .1 m .9 .1 L s .1 .9 m .9 .9 L s .9 .1 m .9 .9 L s [(X[1,0])] .04 .04 0 1 Mshowa [(X[2,0])] .04 .84 0 1 Mshowa [(X[1,1])] .84 .04 0 1 Mshowa [(X[2,1])] .84 .84 0 1 Mshowa P % End of Graphics MathPictureEnd :[font = input; preserveAspect] CheckDistribution[network3] :[font = input; preserveAspect; startGroup] process3 = TemporalBayesianNetworkToMarkovProcess[network3] :[font = output; output; inactive; preserveAspect; endGroup] MarkovProcess[3] ;[o] MarkovProcess[3] :[font = input; preserveAspect; startGroup] TableForm[Edges[TransitionGraph[process3]]] :[font = output; output; inactive; preserveAspect; endGroup] TableForm[{{0.02, 0.18, 0.56, 0.24}, {0.1, 0.1, 0.64, 0.16}, {0.07000000000000000002, 0.63, 0.21, 0.09}, {0.35, 0.35, 0.24, 0.06}}] ;[o] 0.02 0.18 0.56 0.24 0.1 0.1 0.64 0.16 0.07 0.63 0.21 0.09 0.35 0.35 0.24 0.06 :[font = input; preserveAspect] CheckDistribution[process3] :[font = input; preserveAspect; startGroup] ShowLabeledGraph[TransitionGraph[process3]] ; :[font = postscript; PostScript; formatAsPostScript; output; inactive; preserveAspect; pictureLeft = 34; pictureWidth = 282; pictureHeight = 282; endGroup] %! %%Creator: Mathematica %%AspectRatio: 1 MathPictureStart %% Graphics /Courier findfont 10 scalefont setfont % Scaling calculations 0.0454545 0.909091 0.0454545 0.909091 [ [ 0 0 0 0 ] [ 1 1 0 0 ] ] MathScale % Start of Graphics 1 setlinecap 1 setlinejoin newpath [ ] 0 setdash 0 g p P 0 0 m 1 0 L 1 1 L 0 1 L closepath clip newpath p .025 w .5 .95455 Mdot .04545 .5 Mdot .5 .04545 Mdot .95455 .5 Mdot .004 w .5 .95455 m .5 .95455 L s .5 .95455 m .04545 .5 L s .5 .95455 m .5 .04545 L s .5 .95455 m .95455 .5 L s .04545 .5 m .5 .95455 L s .04545 .5 m .04545 .5 L s .04545 .5 m .5 .04545 L s .04545 .5 m .95455 .5 L s .5 .04545 m .5 .95455 L s .5 .04545 m .04545 .5 L s .5 .04545 m .5 .04545 L s .5 .04545 m .95455 .5 L s .95455 .5 m .5 .95455 L s .95455 .5 m .04545 .5 L s .95455 .5 m .5 .04545 L s .95455 .5 m .95455 .5 L s .5 .95455 m .5 .95455 L s .5 .95455 m .04545 .5 L s .5 .95455 m .5 .04545 L s .5 .95455 m .95455 .5 L s .04545 .5 m .5 .95455 L s .04545 .5 m .04545 .5 L s .04545 .5 m .5 .04545 L s .04545 .5 m .95455 .5 L s .5 .04545 m .5 .95455 L s .5 .04545 m .04545 .5 L s .5 .04545 m .5 .04545 L s .5 .04545 m .95455 .5 L s .95455 .5 m .5 .95455 L s .95455 .5 m .04545 .5 L s .95455 .5 m .5 .04545 L s .95455 .5 m .95455 .5 L s [(1)] .47273 .92727 0 1 Mshowa [(2)] .01818 .47273 0 1 Mshowa [(3)] .47273 .01818 0 1 Mshowa [(4)] .92727 .47273 0 1 Mshowa P % End of Graphics MathPictureEnd :[font = input; preserveAspect; startGroup] trajectory = RandomTrajectory[1,16,process3] :[font = output; output; inactive; preserveAspect; endGroup] {1, 3, 2, 2, 4, 2, 3, 2, 1, 3, 4, 1, 3, 3, 3, 2, 2} ;[o] {1, 3, 2, 2, 4, 2, 3, 2, 1, 3, 4, 1, 3, 3, 3, 2, 2} :[font = input; preserveAspect; startGroup] EstimateSteadyState[1,16,process3] :[font = output; output; inactive; preserveAspect; endGroup] {0.110887105925399293, 0.3557876987621007071, 0.4056200288772809551, 0.127705166435219045} ;[o] {0.110887, 0.355788, 0.40562, 0.127705} :[font = input; preserveAspect; startGroup] Spectrum[TransitionGraph[process3]] :[font = output; output; inactive; preserveAspect; endGroup] {1., -0.5, -0.206739909054935182, 0.0967399090549351818} ;[o] {1., -0.5, -0.20674, 0.0967399} :[font = input; preserveAspect; startGroup] ShowGraph[MultiStagePhaseSpaceDiagram[1,4,10,process3], Directed] ; :[font = postscript; PostScript; formatAsPostScript; output; inactive; preserveAspect; pictureLeft = 34; pictureWidth = 282; pictureHeight = 282; endGroup] %! %%Creator: Mathematica %%AspectRatio: 1 MathPictureStart %% Graphics /Courier findfont 10 scalefont setfont % Scaling calculations -0.626761 1.5493 0.0774648 1.5493 [ [ 0 0 0 0 ] [ 1 1 0 0 ] ] MathScale % Start of Graphics 1 setlinecap 1 setlinejoin newpath [ ] 0 setdash 0 g p P 0 0 m 1 0 L 1 1 L 0 1 L closepath clip newpath p .025 w .07746 .07746 Mdot .07746 .35915 Mdot .07746 .64085 Mdot .07746 .92254 Mdot .35915 .07746 Mdot .35915 .35915 Mdot .35915 .64085 Mdot .35915 .92254 Mdot .64085 .07746 Mdot .64085 .35915 Mdot .64085 .64085 Mdot .64085 .92254 Mdot .92254 .07746 Mdot .92254 .35915 Mdot .92254 .64085 Mdot .92254 .92254 Mdot .004 w .07746 .07746 m .35915 .35915 L s .07746 .07746 m .35915 .64085 L s .07746 .07746 m .35915 .92254 L s .35915 .35915 m .64085 .64085 L s .35915 .64085 m .64085 .07746 L s .35915 .64085 m .64085 .35915 L s .35915 .64085 m .64085 .92254 L s .35915 .92254 m .64085 .64085 L s .64085 .07746 m .92254 .35915 L s .64085 .35915 m .92254 .64085 L s .64085 .35915 m .92254 .92254 L s .64085 .64085 m .92254 .07746 L s .64085 .64085 m .92254 .35915 L s .64085 .92254 m .92254 .35915 L s .64085 .92254 m .92254 .92254 L s .35915 .35915 m .27699 .33177 L .33177 .27699 L F .35915 .64085 m .28987 .58888 L .35915 .55424 L F .35915 .92254 m .29791 .86129 L .3714 .8368 L F .64085 .64085 m .55868 .61346 L .61346 .55868 L F .64085 .07746 m .64085 .16407 L .57156 .12943 L F .64085 .35915 m .61346 .44132 L .55868 .38654 L F .64085 .92254 m .55868 .89515 L .61346 .84037 L F .64085 .64085 m .61346 .72301 L .55868 .66823 L F .92254 .35915 m .84037 .33177 L .89515 .27699 L F .92254 .64085 m .84037 .61346 L .89515 .55868 L F .92254 .92254 m .85325 .87057 L .92254 .83593 L F .92254 .07746 m .92254 .16407 L .85325 .12943 L F .92254 .35915 m .89515 .44132 L .84037 .38654 L F .92254 .35915 m .92254 .44576 L .85325 .41112 L F .92254 .92254 m .84507 .96127 L .84507 .8838 L F P % End of Graphics MathPictureEnd :[font = input; preserveAspect] Needs["Dynamics`Packages`MarkovExamples`"] :[font = input; preserveAspect; startGroup] network4 = MarkovExample[1] :[font = output; output; inactive; preserveAspect; endGroup] BayesianNetwork[4] ;[o] BayesianNetwork[4] :[font = input; preserveAspect] CheckDistribution[network4] :[font = input; preserveAspect; startGroup] ShowGraph[DependencyGraph[network4], Directed] ; :[font = postscript; PostScript; formatAsPostScript; output; inactive; preserveAspect; pictureLeft = 34; pictureWidth = 282; pictureHeight = 282; endGroup] %! %%Creator: Mathematica %%AspectRatio: 1 MathPictureStart %% Graphics /Courier findfont 10 scalefont setfont % Scaling calculations -1.72222 2.59259 0.0522388 1.04478 [ [ 0 0 0 0 ] [ 1 1 0 0 ] ] MathScale % Start of Graphics 1 setlinecap 1 setlinejoin newpath [ ] 0 setdash 0 g p P 0 0 m 1 0 L 1 1 L 0 1 L closepath clip newpath p .025 w .12963 .05224 Mdot .12963 .35075 Mdot .12963 .64925 Mdot .12963 .94776 Mdot .87037 .05224 Mdot .87037 .35075 Mdot .87037 .64925 Mdot .87037 .94776 Mdot .004 w .12963 .05224 m .87037 .05224 L s .12963 .35075 m .87037 .35075 L s .12963 .35075 m .87037 .64925 L s .12963 .64925 m .87037 .64925 L s .12963 .94776 m .87037 .94776 L s .87037 .35075 m .87037 .05224 L s .87037 .05224 m .74074 .07836 L .74074 .02612 L F .87037 .35075 m .74074 .37687 L .74074 .32463 L F .87037 .64925 m .73288 .63078 L .82454 .59385 L F .87037 .64925 m .74074 .67537 L .74074 .62313 L F .87037 .94776 m .74074 .97388 L .74074 .92164 L F .87037 .05224 m .93519 .10448 L .80556 .10448 L F P % End of Graphics MathPictureEnd ^*)