remstimate {remstimate} | R Documentation |
remstimate - optimization of tie-oriented and actor-oriented likelihood
Description
A function for the optimization of tie-oriented and actor-oriented likelihood. There are four optimization algorithms: two Frequentists, Maximum Likelihood Estimation (MLE
) and Adaptive Gradient Descent (GDADAMAX
), and two Bayesian, Bayesian Sampling Importance Resampling (BSIR
) and Hamiltonian Monte Carlo (HMC
).
Usage
remstimate(
reh,
stats,
method = c("MLE", "GDADAMAX", "BSIR", "HMC"),
ncores = attr(reh, "ncores"),
prior = NULL,
nsim = 1000L,
nchains = 1L,
burnin = 500L,
thin = 10L,
init = NULL,
epochs = 1000L,
L = 50L,
epsilon = ifelse(method == "GDADAMAX", 0.001, 0.002),
seed = NULL,
WAIC = FALSE,
silent = TRUE,
...
)
Arguments
reh |
a |
stats |
a |
method |
the optimization method to estimate model parameters. Methods available are: Maximum Likelihood Estimation ( |
ncores |
[optional] number of threads for the parallelization. (default value is |
prior |
[optional] prior distribution when |
nsim |
[optional] when |
nchains |
[optional] number of chains to generate in the case of |
burnin |
[optional] number of initial iterations to be added as burnin for |
thin |
[optional] number of steps to skip in the posterior draws for |
init |
[optional] vector of initial values if tie-oriented model, or a named list of two vectors ('sender_model' and 'receiver_model') if both models of the actor-oriented framework are specified. |
epochs |
[optional] It is the number of iteration used in the method |
L |
[optional] number of leap-frog steps to use in the method |
epsilon |
[optional] It is a parameter used in two methods: if |
seed |
[optional] seed value for reproducibility. If |
WAIC |
[optional] logical value. The Watanabe Akaike's Information Criterion (WAIC) will be calculated is |
silent |
[optional-not-yet-implemented] a |
... |
additional parameters. They can be parameters of other functions defined as input in some of the arguments above. (e.g., arguments of the |
Value
'remstimate' S3 object.
Examples
# ------------------------------------ #
# tie-oriented model: "MLE" #
# ------------------------------------ #
# loading data
data(tie_data)
# processing event sequence with remify
tie_reh <- remify::remify(edgelist = tie_data$edgelist, model = "tie")
# specifying linear predictor
tie_model <- ~ 1 +
remstats::indegreeSender()+
remstats::inertia()+
remstats::reciprocity()
# calculating statistics
tie_reh_stats <- remstats::remstats(reh = tie_reh,
tie_effects = tie_model)
# running estimation
tie_mle <- remstimate::remstimate(reh = tie_reh,
stats = tie_reh_stats,
method = "MLE",
ncores = 1)
# summary
summary(tie_mle)
# ------------------------------------ #
# actor-oriented model: "MLE" #
# ------------------------------------ #
# loading data
data(ao_data)
# processing event sequence with remify
ao_reh <- remify::remify(edgelist = ao_data$edgelist, model = "actor")
# specifying linear predictor (for sender rate and receiver choice model)
rate_model <- ~ 1 + remstats::indegreeSender()
choice_model <- ~ remstats::inertia() + remstats::reciprocity()
# calculating statistics
ao_reh_stats <- remstats::remstats(reh = ao_reh,
sender_effects = rate_model,
receiver_effects = choice_model)
# running estimation
ao_mle <- remstimate::remstimate(reh = ao_reh,
stats = ao_reh_stats,
method = "MLE",
ncores = 1)
# summary
summary(ao_mle)
# ------------------------------------ #
# for more examples check vignettes #
# ------------------------------------ #