estimate_ERPM_p3: estimate_ERPM_p3

Usage Arguments

View source: R/functions_estimate.R

Usage

1
estimate_ERPM_p3(partition, nodes, objects, effects, startingestimates, burnin = 30, thining = 10, length.p3 = 1000, neighborhood = c(0.7, 0.3, 0), fixed.estimates = NULL, sizes.allowed = NULL, sizes.simulated = NULL)

Arguments

partition

The observed partition.

nodes

Data frame containing the nodes.

objects

Objects used for statistics calculation. A list with a vector "name" and a vector "object".

effects

Effects or sufficient statistics. A list with a vector "names" and a vector "objects".

startingestimates

First guess for the model parameters.

burnin

Integer for the number of burn-in steps before sampling. Default = 30

thining

Integer for the number of thining steps between sampling.Default = 10

length.p3

Number of samples in phase 3. Default = 100.

neighborhood

Way of choosing partitions: probability vector (actors swap, merge/division, single actor move). Default = (0.7,0.3,à)

fixed.estimates

If some parameters are fixed, list with as many elements as effects, these elements equal a fixed value if needed, or NULL if they should be estimated. Default = NULL

sizes.allowed

Vector of group sizes allowed in sampling. Default = NULL \itemsizes.simulatedVector of group sizes allowed in the Markov chain but not necessraily sampled (now, it only works for vectors like size_min:size_max). Default = NULL

##—- Should be DIRECTLY executable !! —- ##– ==> Define data, use random, ##– or do help(data=index) for the standard data sets.

## The function is currently defined as function (partition, nodes, objects, effects, startingestimates, burnin = 30, thining = 10, length.p3 = 1000, neighborhood = c(0.7, 0.3, 0), fixed.estimates = NULL, sizes.allowed = NULL, sizes.simulated = NULL) z.obs <- computeStatistics(partition, nodes, effects, objects) num.effects <- length(effects$names) if (!is.null(fixed.estimates)) for (e in 1:num.effects) if (!is.null(fixed.estimates[[e]])) startingestimates[e] <- fixed.estimates[[e]] results.phase3 <- run_phase3(partition, startingestimates, z.obs, nodes, effects, objects, burnin, thining, length.p3, neighborhood, sizes.allowed, sizes.simulated) means <- results.phase3$means standard.deviations <- results.phase3$standard.deviations standard.errors <- results.phase3$standard.errors convergence.ratios <- results.phase3$convergence.ratios results <- data.frame(effect = effects$names, object = effects$objects, est = as.vector(startingestimates), std.err = standard.errors, conv = convergence.ratios) print_results(results) return(results)


isci1102/ERPM documentation built on Jan. 18, 2022, 12:25 a.m.