![tutorials on netsimk tutorials on netsimk](https://d3i71xaburhd42.cloudfront.net/9f4b6ff775c749766583130301a3c49f9f05ec3e/5-Figure3-1.png)
For we need two columns as the parameter contains two values. The first column of the ame is named dummy.param, similar to the name of the parameter. This way we keep the relationship between each value. Each row contains a set of parameters values that will be used together in a model. We now have a ame with 5 rows and 3 columns. We can inspect the values with the get_param_set function: have as value because each simulation has a vector of size 2. act.rate and dummy.param now have 3 values associated with them, one per simulation. The other ones are displayed under the “Random Parameters”. sim3 #> #> Formation Diagnostics #> - #> Target Sim Mean Pct Diff Sim SD #> edges 25 25.733 2.933 3.845 #> #> #> Dissolution Diagnostics #> - #> Target Sim Mean Pct Diff Sim SD #> Edge Duration 10.0 9.318 -6.819 0.085 #> Pct Edges Diss 0.1 0.075 -24.740 0.023Īfter running 3 simulations we can see that 2 parameters are still displayed under the “Fixed Parameters” section: inf.prob and groups. The rest of the model is run as before, although we increase the simulation count to three to demonstrate the parameter stochasticity.Ĭontrol EpiModel Simulation #> = #> Model class: netsim #> #> Simulation Summary #> - #> Model type: SI #> No. is a function with no argument that returns 2 values sampled from normal distributions, each with different means and standard deviations.Įach element is named after the parameter it will fill and MUST BE a function taking no argument and outputting a vector of the right size for the parameter: size 1 for act.rate and dummy.param size 2 for.dummy.param is a function with no argument that returns a random value from a beta distribution.act.rate uses the param_random function factory defined by EpiModel (see ?EpiModel::param_random).Here we kept the inf.prob parameter fixed at 0.3 and defined a list object called my.randoms containing 3 elements: My.randoms Fixed Parameters #> - #> inf.prob = 0.3 #> #> Random Parameters #> (Not drawn yet) #> - #> act.rate = #> dummy.param = #> = Note the additional groups parameter defined automatically by EpiModel as part of the “SI” model definition. In it we can see the value of the parameters under the “Fixed Parameters” section. The last line prints a summary of the model. has two elements this may be used, for example, to stratify a parameter by subpopulation. These latter two parameters will serve to illustrate random parameters.
![tutorials on netsimk tutorials on netsimk](https://i.ytimg.com/vi/UKvRrWWYoJ4/maxresdefault.jpg)
In the parameters, we set the value for inf.prob and act.rate as fixed, but we also define dummy.param and. NW groups: 1 #> #> Fixed Parameters #> - #> inf.prob = 0.3 #> act.rate = 0.5 #> dummy.param = 4 #> = 0 1 #> groups = 1 #> #> Model Output #> - #> Variables: s.num i.num num si.flow #> Networks: sim1 #> Transmissions: sim1 #> #> Formation Diagnostics #> - #> Target Sim Mean Pct Diff Sim SD #> edges 25 28.8 15.2 2.387 #> #> #> Dissolution Diagnostics #> - #> Target Sim Mean Pct Diff Sim SD #> Edge Duration 10.0 9.242 -7.578 NA #> Pct Edges Diss 0.1 0.072 -28.276 NA param EpiModel Simulation #> = #> Model class: netsim #> #> Simulation Summary #> - #> Model type: SI #> No. Nw Starting maximum pseudolikelihood estimation (MPLE): #> Evaluating the predictor and response matrix.