R/RcppExports.R

Defines functions shortfall_cpp ebm_cpp minkowski

Documented in shortfall_cpp

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

#' Weighted Minkowski Distance
#' 
#' @param x A numeric vector, feature values of first object
#' @param y  Like x, feature values of second object
#' @param w numeric vector of weights (model parameter)
#' @param r square root in distance metic (model parameter)
#' @param q exponent in distance metric (model parameter)
#' @examples
#' # none
minkowski <- function(x, y, w, r, q) {
    .Call(`_cognitivemodels_minkowski`, x, y, w, r, q)
}

#' Computes Predictions for the Exemplar-based Models (GCM, EBM)
#' 
#' @param criterion numeric vector with experienced criterion
#' @param features numeric matrix with feature criterion
#' @param w numeric vector of weights (model parameter)
#' @param r square root in distance metic (model parameter)
#' @param q exponent in distance metric (model parameter)
#' @param lambda sensitivity (model parameter)
#' @param b bias parameter vector for classification (model parameter), must be NA for judgments
#' @param wf weight vector with a weight for each feature combination
#' @param init value for the initial trials
#' @param has_criterion vector where a criterion is present
#' @param ismultiplicative A number (0 or 1), 1 means the combination of exemplars is multiplicative, i.e. multiplicative exemplar model
#' @param lastLearnTrial integer last trial of learning phase
#' @param firstOutTrial integer first trial of output, starting the predictions later
#' @param similarity A string, the similarity function
#' @examples
#' # none
ebm_cpp <- function(criterion, features, w, r, q, lambda, b, wf, lastLearnTrial, firstOutTrial, init, has_criterion, similarity, ismultiplicative) {
    .Call(`_cognitivemodels_ebm_cpp`, criterion, features, w, r, q, lambda, b, wf, lastLearnTrial, firstOutTrial, init, has_criterion, similarity, ismultiplicative)
}

#' Computes Predictions in the Shortfall Model
#' 
#' @param x Numeric matrix, the outcomes
#' @param p Numeric matrix, the probabilities
#' @param a Numeric vector, the aspiration levels
#' @param beta Model parameter
#' @param delta Model parameter
#'
#' @export
shortfall_cpp <- function(x, p, a, beta, delta) {
    .Call(`_cognitivemodels_shortfall_cpp`, x, p, a, beta, delta)
}
JanaJarecki/cogscimodels documentation built on Nov. 4, 2022, 5:33 p.m.