R/RcppExports.R

Defines functions TimeDist XeeXhC_Lg Bal_XeeXhC XeeXhC DistMat

Documented in Bal_XeeXhC DistMat TimeDist XeeXhC XeeXhC_Lg

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

#' Create Distance Matrix
#'
#' @export
#'
#' @param M a matrix of locations
#' @param cutoff the distance for cutoff
#' @param kernel (string) kernel function (default is bartlett-triangular)
#' @param dist_fn (string) distance function (Haversine)
#'
DistMat <- function(M, cutoff, kernel = "bartlett", dist_fn = "Haversine") {
    .Call(`_SpatialInference_DistMat`, M, cutoff, kernel, dist_fn)
}

#' Calculate Correlation Matrix
#'
#' @export
#'
#' @param M matrix of locations
#' @param cutoff the distance for cutoff
#' @param X model matrix
#' @param e vector of residuals
#' @param n1 number of observations
#' @param k number of regressors
#' @param kernel (string) kernel function (default is bartlett-triangular)
#' @param dist_fn (string) distance function (Haversine)
#'
XeeXhC <- function(M, cutoff, X, e, n1, k, kernel = "bartlett", dist_fn = "Haversine") {
    .Call(`_SpatialInference_XeeXhC`, M, cutoff, X, e, n1, k, kernel, dist_fn)
}

#' Calculate Correlation Matrix for Balanced Panel
#'
#' @export
#'
#' @param dmat distance matrix
#' @param X model matrix
#' @param e vector of residuals
#' @param n1 number of observations
#' @param k number of regressors
#'
Bal_XeeXhC <- function(dmat, X, e, n1, k) {
    .Call(`_SpatialInference_Bal_XeeXhC`, dmat, X, e, n1, k)
}

#' Calculate Correlation Matrix for Large Model (slower, but avoids dist-matrix in memory)
#'
#' @export
#'
#' @param M matrix of locations
#' @param cutoff the distance for cutoff
#' @param X model matrix
#' @param e vector of residuals
#' @param n1 number of observations
#' @param k number of regressors
#' @param kernel (string) kernel function (default is bartlett-triangular)
#' @param dist_fn (string) distance function (Haversine)
#'
XeeXhC_Lg <- function(M, cutoff, X, e, n1, k, kernel = "bartlett", dist_fn = "Haversine") {
    .Call(`_SpatialInference_XeeXhC_Lg`, M, cutoff, X, e, n1, k, kernel, dist_fn)
}

#' Calculate Correlation Matrix (time-dim)
#'
#' @export
#'
#' @param times vector containing the different times
#' @param cutoff the distance for cutoff
#' @param X model matrix
#' @param e vector of residuals
#' @param n1 number of observations
#' @param k number of regressors
#'
TimeDist <- function(times, cutoff, X, e, n1, k) {
    .Call(`_SpatialInference_TimeDist`, times, cutoff, X, e, n1, k)
}
axlehner/SpatialInference documentation built on Jan. 28, 2025, 3:19 p.m.