Learn R Programming

psychtm (version 2021.1.0)

Model-class: An S4 super class to represent a regression-like model

Description

An S4 super class to represent a regression-like model

Helper function (constructor) for Model class

Usage

# 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 )

Arguments

x

An Model object.

value

A value to assign to a slot for x

ndocs

The number of documents/observations.

nchain

The number of iterations of the Gibbs sampler.

mu0

A (p + 1) x 1 matrix of prior means for eta.

sigma0

A (p + 1) x (p + 1) prior covariance matrix for eta.

eta_start

A (p + 1) x 1 matrix of starting values for eta.

eta

A nchain x (p + 1) matrix of draws of regression coefficients.

loglike

A nchain x 1 vector of the log-likelihood (up to an additive constant).

logpost

A nchain x 1 vector of the log-posterior (up to an additive constant).

waic

WAIC (up to an additive constant) on the deviance scale.

se_waic

Standard error of the WAIC.

p_eff

The effective number of parameters.

lpd

A nchain x ndocs matrix of predictive posterior likelihoods.

Value

A '>Model object.

Slots

ndocs

The number of documents/observations.

nchain

The number of iterations of the Gibbs sampler.

mu0

A (p + 1) x 1 matrix of prior means for eta.

sigma0

A (p + 1) x (p + 1) prior covariance matrix for eta.

eta_start

A (p + 1) x 1 matrix of starting values for eta.

eta

A nchain x (p + 1) matrix of draws of regression coefficients.

loglike

A nchain x 1 vector of the log-likelihood (up to an additive constant).

logpost

A nchain x 1 vector of the log-posterior (up to an additive constant).

waic

WAIC (up to an additive constant) on the deviance scale.

se_waic

Standard error of the WAIC.

p_eff

The effective number of parameters.

lpd

A nchain x ndocs matrix of predictive posterior likelihoods.

extra

A list of additional model fitting information. Contains time_elapsed, start_time, end_time, corrected_label_switching, and call.

Examples

Run this code
# NOT RUN {
m1 <- Model(ndocs = 1)
print(m1)

# }

Run the code above in your browser using DataLab