An S4 super class to represent a regression-like model
Helper function (constructor) for Model class
# S4 method for Model
ndocs(x)# S4 method for Model
ndocs(x) <- value
# S4 method for Model
nchain(x)
# S4 method for Model
nchain(x) <- value
# S4 method for Model
mu0(x)
# S4 method for Model
mu0(x) <- value
# S4 method for Model
sigma0(x)
# S4 method for Model
sigma0(x) <- value
# S4 method for Model
eta_start(x)
# S4 method for Model
eta_start(x) <- value
# S4 method for Model
eta(x)
# S4 method for Model
eta(x) <- value
# S4 method for Model
loglike(x)
# S4 method for Model
loglike(x) <- value
# S4 method for Model
logpost(x)
# S4 method for Model
logpost(x) <- value
# S4 method for Model
waic(x)
# S4 method for Model
waic(x) <- value
# S4 method for Model
se_waic(x)
# S4 method for Model
se_waic(x) <- value
# S4 method for Model
p_eff(x)
# S4 method for Model
p_eff(x) <- value
# S4 method for Model
lpd(x)
# S4 method for Model
lpd(x) <- value
# S4 method for Model
extra(x)
# S4 method for Model
extra(x) <- value
Model(
  ndocs,
  nchain = 1,
  mu0 = NaN,
  sigma0 = NaN,
  eta_start = NaN,
  eta = NaN,
  loglike = NaN,
  logpost = NaN,
  waic = NaN,
  se_waic = NaN,
  p_eff = NaN,
  lpd = NaN
)
An Model object.
A value to assign to a slot for x
The number of documents/observations.
The number of iterations of the Gibbs sampler.
A (p + 1) x 1 matrix of prior means for eta.
A (p + 1) x (p + 1) prior covariance matrix for eta.
A (p + 1) x 1 matrix of starting values for eta.
A nchain x (p + 1) matrix of draws of regression coefficients.
A nchain x 1 vector of the log-likelihood (up to an additive constant).
A nchain x 1 vector of the log-posterior (up to an additive constant).
WAIC (up to an additive constant) on the deviance scale.
Standard error of the WAIC.
The effective number of parameters.
A nchain x ndocs matrix of predictive posterior likelihoods.
ndocsThe number of documents/observations.
nchainThe number of iterations of the Gibbs sampler.
mu0A (p + 1) x 1 matrix of prior means for eta.
sigma0A (p + 1) x (p + 1) prior covariance matrix for eta.
eta_startA (p + 1) x 1 matrix of starting values for eta.
etaA nchain x (p + 1) matrix of draws of regression coefficients.
loglikeA nchain x 1 vector of the log-likelihood (up to an additive constant).
logpostA nchain x 1 vector of the log-posterior (up to an additive constant).
waicWAIC (up to an additive constant) on the deviance scale.
se_waicStandard error of the WAIC.
p_effThe effective number of parameters.
lpdA nchain x ndocs matrix of predictive posterior likelihoods.
extraA list of additional model fitting information. Contains time_elapsed, start_time, end_time, corrected_label_switching, and call.
# NOT RUN {
m1 <- Model(ndocs = 1)
print(m1)
# }
Run the code above in your browser using DataLab