Difference between revisions of "Two-dimensional Monte Carlo"

From Testiwiki
Jump to: navigation, search
(first draft)
 
(technical edits)
Line 10: Line 10:
  
 
<rcode name="mc2d">
 
<rcode name="mc2d">
#This is code Op_en####/mc2d on page [[Two-dimensional Monte Carlo]]
+
#This is code Op_en7805/mc2d on page [[Two-dimensional Monte Carlo]]
 
library(OpasnetUtils)
 
library(OpasnetUtils)
  
Line 24: Line 24:
  
 
# Boostrap-versio:
 
# Boostrap-versio:
 +
 +
# Paramter list. Note: this is not stored, you have to define it in the model code.
  
 
mc2dparam<- list(
 
mc2dparam<- list(
   N2 = 1000,
+
   N2 = 1000, # Number of iterations in the new Iter
   run2d = TRUE,
+
   run2d = TRUE, # Should the mc2d function be used or not?
   newmarginals = c("Gender", "Ages", "Country"),
+
   newmarginals = c("Gender", "Ages", "Country"), # Names of columns that are non-marginals but should be sampled enough to become marginals
   method = "bootstrap",
+
   method = "bootstrap", # which method to use for 2D Monte Carlo? Currently bootsrap is the only option.
   fun = mean
+
   fun = mean # Function for aggregating the first Iter dimension.
 
)
 
)
  
Line 63: Line 65:
 
}
 
}
  
objects.latest(mc2d)
+
objects.store(mc2d)
 
cat("Function mc2d stored.\n")
 
cat("Function mc2d stored.\n")
 
</rcode>
 
</rcode>

Revision as of 14:24, 11 June 2017


Question

How to perform two-dimensional Monte Carlo in Opasnet?

Answer

Rationale

+ Show code

See also