R/RcppExports.R

Defines functions theta_pv estip estdist Estep_irt Estep_girt_mg

Documented in estdist Estep_girt_mg Estep_irt estip theta_pv

# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

#'Estep in girt.
#'
#'@param x DataFrame.
#'@param a0 discrinimation parameter vector.
#'@param b0 difficulty parameter vector.
#'@param Xq node of theta dist.
#'@param AX weight of theta dist.
#'@param Yr node of phi dist.
#'@param BY weighit of phi dist.
#'@param D factor constant.
#'@param group a vector.
#'@param ind a design matrix for group.
#'@param resp a design matrix for person.
#'@param MLL a vector
#'@export
Estep_girt_mg <- function(x, a0, b0, Xq, AX, Yr, BY, D, group, ind, resp, MLL) {
    .Call(`_irtfun2_Estep_girt_mg`, x, a0, b0, Xq, AX, Yr, BY, D, group, ind, resp, MLL)
}

#'Estep in girt.
#'
#'@param xall Item response matrix.
#'@param t0 item parameter vector
#'@param Xm node of theta dist.
#'@param Wm weight of theta dist.
#'@param group a vector.
#'@param ind a design matrix for group.
#'@param resp a design matrix for person.
#'@param D factor constant.
#'@param MLL a vector
#'@export
Estep_irt <- function(xall, t0, Xm, Wm, group, ind, resp, D, MLL) {
    .Call(`_irtfun2_Estep_irt`, xall, t0, Xm, Wm, group, ind, resp, D, MLL)
}

#'Estimation of population distribution via EM algorithm.
#'
#'This function is new version of \code{MML_EM_dist}
#'@param x Item response matrix.
#'@param para item parameter data.frame estimated by \code{\link{estip}}
#'@param N the number of nodes in integration.
#'@param fc0 a column of first item response.
#'@param ng the number of groups
#'@param gc0 a column of group. the element must be integer and the minimum number must be 1.
#'@param eMLL a convergence criteria(CC) for marginal log likelihood.
#'@param eDIST a CC for population distribution.
#'@param D factor constant.
#'@param fix Don't use. If 1, fix population distribution mean and sigma each EM cycle.
#'@param print How much information you want to display? from 1 to 3. The larger, more information is displayed.
#'@param max maximum value of theta in integration.
#'@param min minimum value of theta in integration.
#'@param maxiter_em maximum iteration time for EM cycle.
#'@param rm_list a vector of item U want to remove for estimation. NOT list.
#'@export
estdist <- function(x, para, N = 31L, eMLL = 1e-6, eDIST = 1e-4, fc0 = 2L, ng = 1L, gc0 = 2L, D = 1.702, fix = 1L, print = 0L, max = 4.0, min = -4.0, maxiter_em = 200L, rm_list = as.character( c("NONE"))) {
    .Call(`_irtfun2_estdist`, x, para, N, eMLL, eDIST, fc0, ng, gc0, D, fix, print, max, min, maxiter_em, rm_list)
}

#'Estimate item parameter for binary{0,1} response data.
#'
#'1PL,2PL,3PL,Bayes1PL,Bayes2PL and multigroup estimation is avairable now. U must install C++ compiler(Rtools for windows or Xcode for Mac)in your PC or Mac.
#'@param x an item response data which class is data.frame object.
#'@param model0 Character.U can select which one, "1PL","2PL","3PL".
#'@param N the number of nodes in integration.
#'@param bg0 the number of base grade.
#'@param eMLL a convergence criteria(CC) for marginal log likelihood.
#'@param eEM a CC in EM cycle.
#'@param eM a CC in M step.
#'@param emu a CC for population distribution mean.
#'@param esd a CC for population distribution standard deviation.
#'@param fc0 a column of first item response.
#'@param ng the number of groups
#'@param gc0 a column of group. the element must be integer and the minimum number must be 1.
#'@param D a scaling constant.
#'@param fix Don't use. If 1, fix population distribution mean and sigma each EM cycle.
#'@param print How much information you want to display? from 1 to 3. The larger, more information is displayed.
#'@param ic initial value for guessing parameter.
#'@param max maximum value of theta in integration.
#'@param min minimum value of theta in integration.
#'@param mu hyperparameter for theta dist.
#'@param sigma same as above.
#'@param Bayes If 1, marginal Bayesian estimation runs.
#'@param method Optimising method in M step. "Fisher_Scoring" or "Newton_Raphson" can be selected.
#'@param mu_a hyperparameter of log normal dist for slope parameter.
#'@param sigma_a same as above.
#'@param mu_b hyperparameter of normal dist for location parameter.
#'@param sigma_b same as above.
#'@param mu_c hyperparameter for lower asymptote parameter.
#'@param w_c weight of a Beta dist.
#'@param min_a minimum value of slope parameter.
#'@param maxabs_b maximum absolute value of location parameter.
#'@param maxiter_em maximum iteration time for EM cycle.
#'@param maxiter_j maximum iteration time for Newton Raphton in M step.
#'@param maxskip_j Dont use.
#'@param rm_list a vector of item U want to remove for estimation. NOT list.
#'@param thdist Which distribution do you want `normal` or `empirical` for E step.
#'@param estdist If 1, calculate esimated population distribution via EM argorithm.
#'@examples
#'res <- estip(x=sim_data_1, fc=2)
#'# check the parameters
#'res$para
#'res$SE
#'@export
estip <- function(x, model0 = as.character( c("2PL")), N = 31L, bg0 = 1L, fc0 = 2L, ng = 1L, gc0 = 2L, eMLL = 1e-6, eEM = 1e-4, eM = 1e-3, emu = 1e-3, esd = 1e-3, D = 1.702, ic = 1/5, max = 6.0, min = -6.0, mu = 0, sigma = 1, Bayes = 0L, method = "Fisher_Scoring", mu_a = 0, sigma_a = 1, mu_b = 0, sigma_b = 2, mu_c = 1/5, w_c = 5, fix = 1L, print = 0L, min_a = 0.1, maxabs_b = 20, maxiter_em = 200L, maxiter_j = 20L, maxskip_j = 0L, rm_list = as.character( c("NONE")), thdist = "normal", estdist = 1L) {
    .Call(`_irtfun2_estip`, x, model0, N, bg0, fc0, ng, gc0, eMLL, eEM, eM, emu, esd, D, ic, max, min, mu, sigma, Bayes, method, mu_a, sigma_a, mu_b, sigma_b, mu_c, w_c, fix, print, min_a, maxabs_b, maxiter_em, maxiter_j, maxskip_j, rm_list, thdist, estdist)
}

#'Sampling plausible values(PVs) based on rejection sampling.
#'
#'@param x response data
#'@param nofrands the number of PVs
#'@param eap_apply a numeric vector of estimated EAP.
#'@param const_apply a numeric vector of const of a posterior distribution.
#'@param map_apply a numeric vector of estimated MAP.
#'@param n the number of subjects.
#'@param maxtheta a max value of theta.
#'@param mintheta a mininum value of theta.
#'@param a an item slope parameter vector.
#'@param b an item location parameter vector.
#'@param c an item asymptote parameter vector.
#'@param D a factor constant.
#'@param mu p hyper parameter of a posterior distribution.
#'@param sigma same as above.
#'@export
theta_pv <- function(x, nofrands, eap_apply, const_apply, map_apply, n, maxtheta, mintheta, a, b, c, D, mu, sigma) {
    .Call(`_irtfun2_theta_pv`, x, nofrands, eap_apply, const_apply, map_apply, n, maxtheta, mintheta, a, b, c, D, mu, sigma)
}
takuizum/irtfun2 documentation built on May 10, 2020, 8:30 a.m.