File tree Expand file tree Collapse file tree 3 files changed +22
-13
lines changed Expand file tree Collapse file tree 3 files changed +22
-13
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ loadSavedWorkspace <- FALSE
2020
2121# Save plot to file
2222savePlotToFile <- FALSE
23+ nPlot <- 2500
2324
2425# #############################################################################
2526# Load data
@@ -65,6 +66,10 @@ if (savePlotToFile) {
6566}
6667
6768# Print the estimate of the posterior mean and standard deviation
69+ resTh <- res $ theta [noBurnInIterations : noIterations , ]
70+ thhat <- colMeans(resTh )
71+ thhatSD <- apply(resTh , 2 , sd )
72+
6873print(thhat )
6974print(thhatSD )
7075
Original file line number Diff line number Diff line change @@ -20,7 +20,8 @@ set.seed(10)
2020loadSavedWorkspace <- FALSE
2121
2222# Save plot to file
23- savePlotToFile <- FALSE
23+ savePlotToFile <- TRUE
24+ nPlot <- 2500
2425
2526# #############################################################################
2627# Load data
@@ -83,20 +84,21 @@ if (savePlotToFile) {
8384# #############################################################################
8485
8586# Print the estimate of the posterior mean and standard deviation
87+ resTh <- res $ theta [noBurnInIterations : noIterations , ]
88+ thhat <- colMeans(resTh )
89+ thhatSD <- apply(resTh , 2 , sd )
90+
8691print(thhat )
8792print(thhatSD )
8893
89- # [1] -0.1087619 0.9668493 0.1593125
90- # [1] 0.24976843 0.02232583 0.05356500
94+ # [1] -0.0997589 0.9723418 0.1492119
95+ # [1] 0.27266581 0.01792217 0.04535608
9196
9297# Compute an estimate of the IACT using the first 100 ACF coefficients
9398print(iact )
94- # [1] 13.28575 26.50253 23.31947
95-
96- # Estimate the covariance of the posterior to tune the proposal
97- estCov <- var(resTh )
99+ # [1] 31.94972 32.07775 28.36988
98100
99101# Save the workspace to file
100102if (! loadSavedWorkspace ) {
101103 save.image(" savedWorkspaces/example4-sv.RData" )
102- }
104+ }
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ loadSavedWorkspace <- FALSE
2121
2222# Save plot to file
2323savePlotToFile <- FALSE
24+ nPlot <- 2500
2425
2526# #############################################################################
2627# Load data
@@ -78,15 +79,16 @@ if (savePlotToFile) {
7879# #############################################################################
7980
8081# Print the estimate of the posterior mean and standard deviation
81- print(thhat )
82- print(thhatSD )
82+ resTh <- res $ theta [noBurnInIterations : noIterations , ]
83+ thhat <- colMeans(resTh )
84+ thhatSD <- apply(resTh , 2 , sd )
8385
84- # [1] -0.1466918 0.9577250 0.1813333
85- # [1] 0.21236553 0.02287443 0.05967315
86+ # [1] -0.1550373 0.9601144 0.1742736
87+ # [1] 0.23637116 0.02239614 0.05701460
8688
8789# Compute an estimate of the IACT using the first 100 ACF coefficients
8890print(iact )
89- # [1] 12.55590 20.63091 16.94274
91+ # [1] 21.93670 28.96783 16.65938
9092
9193# Estimate the covariance of the posterior to tune the proposal
9294resThTransformed <- res $ thetaTransformed [noBurnInIterations : noIterations ,]
You can’t perform that action at this time.
0 commit comments