# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
#' get ideal response for DINA
#'
#' replace Z by 1-Z and 1- the resultant matrix gives the
#' ideal response matrix for DINO
#'
#' @param Q Q matrix of size J by K
#' @param Z latent attribute profiles of individuals; N by K
#'
#' @return binary ideal response matrix of size N by J
#'
#'
#' @examples
#' Z <- rbind(c(1,1,1),c(0,0,1))
#' Q <- matrix(c(0,0,0, 0,0,1, 0,1,0,
#' 0,1,1, 1,0,0, 1,0,1,
#' 1,1,0, 1,1,1),ncol=3,byrow=TRUE)
#' get_ideal_resp(Q,Z)
#'
#' get_ideal_resp(Q=matrix(c(1,1,0,
#' 0,0,1,
#' 0,1,0,
#' 1,0,1),nrow=4,byrow=TRUE),
#' Z = rbind(c(1,1,1),c(0,0,0)))
#' @useDynLib slamR
#' @importFrom Rcpp sourceCpp
#' @export
get_ideal_resp <- function(Q, Z) {
.Call('_slamR_get_ideal_resp', PACKAGE = 'slamR', Q, Z)
}
#' 7 shaped binary array operation by bsxfun from matlab
#'
#' this function also multiple along the rows of A and columns of B
#'
#' @param A matrix of size d1 by d2
#' @param B matrix of size d3 by d1
#'
#' @return an array of dimension d3 by d1 by d2
#'
#' @examples
#' bsxfun_7_pow(matrix(c(1,2,3,4,5,6),nrow=3,byrow=TRUE),
#' matrix(c(1:18),nrow=6,byrow=TRUE))
#' @useDynLib slamR
#' @importFrom Rcpp sourceCpp
#' @export
bsxfun_7_pow <- function(A, B) {
.Call('_slamR_bsxfun_7_pow', PACKAGE = 'slamR', A, B)
}
#' 7 shaped binary array operation by bsxfun from matlab but
#' with "hinge" shape
#'
#'
#' @param A matrix of size d1 by d2
#' @param B matrix of size d3 by d2
#'
#' @return a matrix of dimension d3 by d1 by d2
#'
#' @examples
#' bsxfun_7_hinge_pow(matrix(c(1,2,3,4,5,6),nrow=3,byrow=TRUE),
#' matrix(c(1:18),nrow=9,byrow=TRUE))
#' @useDynLib slamR
#' @importFrom Rcpp sourceCpp
#' @export
bsxfun_7_hinge_pow <- function(A, B) {
.Call('_slamR_bsxfun_7_hinge_pow', PACKAGE = 'slamR', A, B)
}
#' 7 shaped binary array operation by bsxfun from matlab but
#' with "hinge" shape; multiple along dimension d2
#'
#'
#' @param A matrix of size d1 by d2
#' @param B matrix of size d3 by d2
#'
#' @return a matrix of dimension d3 by d1 by d2
#'
#' @examples
#' bsxfun_7_hinge_pow_prod(matrix(c(1,2,3,4,5,6),nrow=3,byrow=TRUE),
#' matrix(c(1:18),nrow=9,byrow=TRUE))
#' @useDynLib slamR
#' @importFrom Rcpp sourceCpp
#' @export
bsxfun_7_hinge_pow_prod <- function(A, B) {
.Call('_slamR_bsxfun_7_hinge_pow_prod', PACKAGE = 'slamR', A, B)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.