| DEFM | R Documentation |
Discrete Exponential Family Models (DEFMs) are models from the exponential family that deal with discrete data. Here, we deal with binary arrays which can be used to represent, among other things, networks and multinomial binary Markov processes.
Discrete Exponential Family Models (DEFMs) are models from the exponential family that deal with discrete data. Here, we deal with binary arrays which can be used to represent, among other things, networks and multinomial binary Markov processes.
init_defm(m)
print_stats(m, i = 0L)
nterms_defm(m)
nrow_defm(m)
ncol_defm_y(m)
ncol_defm_x(m)
nobs_defm(m)
morder_defm(m)
new_defm(id, Y, X, order = 1)
m |
An object of class |
i |
An integer scalar indicating which set of statistics to print (see details.) |
id |
Integer vector of length |
Y |
0/1 matrix of responses of |
X |
Numeric matrix of covariates of size |
order |
Integer. Order of the markov process, by default, 1. |
The print_stats function prints the supportset of the ith type
of array in the model.
An external pointer of class DEFM.
nterms_defm returns the number of terms in the model.
nrow_defm returns the number of rows in the model.
ncol_defm_y returns the number of output variables in
the model.
ncol_defm_x returns the number of covariates in the model.
nobs_defm returns the number of observations (events) in the
model.
morder_defm returns the order of the Markov process.
An external pointer of class DEFM.
Vega Yon, G. G., Pugh, M. J., & Valente, T. W. (2022). Discrete Exponential-Family Models for Multivariate Binary Outcomes (arXiv:2211.00627). arXiv. https://arxiv.org/abs/2211.00627
defm_mle() for maximum likelihood estimation and loglike_defm()
for the log-likelihood function.
# Loading Valente's SNS data
data(valentesnsList)
mymodel <- new_defm(
id = valentesnsList$id,
Y = valentesnsList$Y,
X = valentesnsList$X,
order = 1
)
# Adding the intercept terms and a motif from tobacco to mj
term_defm_logit_intercept(mymodel)
term_defm_transition_formula(mymodel, "{y1, 0y2} > {y1, y2}")
# Initialize the model
init_defm(mymodel)
# Fitting the MLE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.