long double (CRAN's "noLD" check), where R sums in double
precision; elsewhere they still require identical values.scoreTest now performs a score test that is conditional on the statistics
of the effects in the model: the deviation of a tested effect's statistic is
adjusted for the remaining deviations of the model's statistics and divided
by its standard deviation given the model's statistics. The previous
parametric p-values ignored this correlation and were far too conservative;
the new p-values seem better calibrated in simple simulations.
The result reports tStatistics, pValues and R2 (the
share of the tested statistic's variance explained by the model's
statistics); the previous non-parametric value is available with
nonParametric = TRUE.estimateMobilityNetwork(..., returnDeps = TRUE) stores the statistics of
the model's effects in the observed and simulated networks
(observedStatistics, simulatedStatistics), which scoreTest uses. For
results estimated with earlier versions, specify the effects of the
estimated model with scoreTest(..., modelEffects = ).myResDN were re-estimated with these statistics.Parallel estimation (parallel = TRUE) uses the package 'parallel' (part of
R) instead of 'snowfall', which is no longer a dependency. One cluster is
started per estimation instead of one per phase. Each chain gets its own
random number stream derived from the random numbers of the
R session, so parallel estimations are now reproducible with set.seed()
and the chains are independent.
The concentration effects concentration_basic_squared,
concentration_norm, concentration_norm_squared,
concentration_prop_orig_cov and concentration_rankGW, removed in 2.0.0,
are available again, unchanged from version 1.1.0, now also in C++.
concentration_norm and concentration_norm_squared divide by the number
of resources of the origin minus one, which is zero for origins with only one
resource.
getIndegree and getTieWeights failed or put counts in the wrong places
when the levels in gofMobilityNetwork(..., lvls = ) did not start at 1.
Without lvls, getIndegree failed and getTieWeights returned
distributions of different lengths for different networks, which plot
misaligned; now all networks get the same levels, up to the largest value.
plot of goodness of fit results now also works without lvls. Results for
levels starting at 1 (e.g. lvls = 1:100) are unchanged.getIndegree and getTieWeights now name their results by these values.
plot passes further arguments (e.g. main, xlab) to boxplot.extractTraces uses the statistics stored by estimations with
returnDeps = TRUE instead of recalculating them from the simulations.
The maximum pseudo-likelihood estimates used as starting values are calculated in C++ if all effects have a C++ version (about 4-5 times faster for larger data), without storing the change statistics of all resources and destinations, so memory use does not grow with the data. The estimates are the same as with the R version, which is used otherwise.
Version 2 runs the simulations in C++, which makes estimation typically 20-50 times faster, adds Geyer-Thompson MCMC maximum likelihood estimation, and corrects several effects. Some changes are not backward compatible (see "Breaking changes"), and results of models with corrected effects differ from version 1.
in_weights_exponent: its change and target statistics did not match
(the target statistic excludes loops and divides by the number of nodes,
the change statistic does neither).concentration_basic_squared, concentration_norm,
concentration_norm_squared, concentration_prop_orig_cov and
concentration_rankGW: older concentration effects that were only used
for testing.concentration_prop has a new definition: each resource contributes the
proportion of the resources from its origin that go to the same destination.
The statistic of version 1 is no longer available.reciprocity_min_resource_covar: the change statistic was +/-1 even when
the moving resource did not have the attribute. It now uses the resource's
value on the attribute, which also makes it correct for non-binary
attributes.multinomialProposal = TRUE: the statistics for the candidate destinations
were calculated with the cache from before the resource was removed, which
gave wrong proposal probabilities for all non-linear effects.simulateMobilityNetworks: allowLoops was ignored after the burn-in
(loops were never allowed).parallel = TRUE): allowLoops was ignored in
Phase 1. This only affected starting values and step sizes, not the final
estimates.initialParameters nor prevAns are given,
estimateMobilityNetwork starts from maximum pseudo-likelihood estimates
instead of zero (see below), so results for the same seed differ from
version 1 (within Monte Carlo error).simulateMobilityNetworks stops if the number of parameters differs from
the number of effects; before, parameters were silently recycled.createAlgorithm(..., phase2Method = "GT"),
with the new arguments iterationsGT, maxIterationsGT and
finalIterationsGT. Robbins-Monro remains the default, and algorithm
objects created with earlier versions use it.
Note that Geyer-Thompson still uses a "normal" Phase 3 that calculates standard
errors and checks convergence.getMultinomialStatistics provides the data) are used as starting values if
neither initialParameters nor prevAns are given, for both Robbins-Monro
and Geyer-Thompson estimation. With Robbins-Monro, Phase 1 then only
determines the step sizes; with Geyer-Thompson, Phase 1 is not needed. If
the estimates do not exist, estimation starts from zero as before.monanDataCreate(..., fixedEffectDummies = TRUE)
adds a dummy variable for each location (except the first) to the process
state, and addDummyEffects() / addFixedEffects() add them to the model.concentration_max, concentration_basic_cube and
concentration_prop_AC.options(MoNAn.useCpp = FALSE) switches to the sampler written in R, which
gives identical results for the same seed and is also used for models with
effects written only in R.multinomialProposal = TRUE stopped with an error ("'x' must be an array of
at least two dimensions") in models with only one effect.avoiding_dissimilar_covar_cont and
joining_similar_avoiding_dissimilar_covar_cont only worked if the
dependent variable was called "transfers".loops_x_loops_additional_origin stopped estimation and simulation with
"missing value where TRUE/FALSE needed" when a resource whose additional
origin is its origin was proposed to move into a loop.simulateMobilityNetworks used 6 parameters for 7 effects.monanDataCreate: the fixedEffectDummies argument is documented (the
documentation used the misspelled name fixedEffectsDummies).ADDING_EFFECTS.md in the GitHub repository explains how to
add an effect in R and C++.Added effects that improve on the old GW effects (where AC stands for alternating cliques):
!! Backward breaking change !!
The "cache" is not visible to the user anymore, it is created automatically and there is no more use for the function createWeightedCache.
The following functions are used differently:
New functions (aliases) for easier use
Further changes:
createEffect and addEffects; specification of node.attribute and edge.attribute instead of attribute.index and resource.attribute.index
The results objects are much smaller and contain less redundant information.
The State and Effects objects have print functions for easier inspection.
The algorithm is now stored in the outcome object for later reference.
New functions to specify the model: createEffects and addEffect New function to generate the process state: monanDataCreate
Creation of alias: monanAlgorithmCreate for createAlgorithm Creation of alias: monan07 for estimateMobilityNetwork
Implementation of new effects
Implementation of parallelization in Phase 1 of the estimation.
Various bugfixes and improvements.
Implementation of new effects.
User-friendly checks in creation of MoNAn objects.
Original Submission