File: RcppExports.R

package info (click to toggle)
r-cran-regsem 1.6.2+dfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 496 kB
  • sloc: cpp: 263; ansic: 15; makefile: 2
file content (69 lines) | stat: -rw-r--r-- 2,904 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

#' Take RAM matrices, multiplies, and returns Implied Covariance matrix.
#'
#' @param par parameter estimates.
#' @param A A matrix with parameter labels.
#' @param S S matrix with parameter labels.
#' @param S_fixed S matrix with fixed indicators.
#' @param A_fixed A matrix with fixed indicators.
#' @param A_est A matrix with parameter estimates.
#' @param S_est S matrix with parameter estimates.
#' @param F F matrix.
#' @param I Diagonal matrix of ones.
#'
#'
rcpp_RAMmult <- function(par, A, S, S_fixed, A_fixed, A_est, S_est, F, I) {
    .Call(`_regsem_rcpp_RAMmult`, par, A, S, S_fixed, A_fixed, A_est, S_est, F, I)
}

#' Calculates the objective function values.
#'
#' @param ImpCov expected covariance matrix.
#' @param SampCov Sample covariance matrix.
#' @param type2 penalty type.
#' @param lambda penalty value.
#' @param gamma additional penalty for mcp and scad
#' @param pen_vec vector of penalized parameters.
#' @param pen_diff Vector of values to take deviation from.
#' @param e_alpha Alpha for elastic net
#' @param rlasso_pen Alpha for rlasso2
#' @param pen_vec1 vector of penalized parameters for lasso penalty.
#' @param pen_vec2 vector of penalized parameters for ridge penalty.
#' @param dual_pen1 vector of penalized parameters for lasso penalty.
#' @param dual_pen2 vector of penalized parameters for ridge penalty.
#'
rcpp_fit_fun <- function(ImpCov, SampCov, type2, lambda, gamma, pen_vec, pen_diff, e_alpha, rlasso_pen, pen_vec1, pen_vec2, dual_pen1, dual_pen2) {
    .Call(`_regsem_rcpp_fit_fun`, ImpCov, SampCov, type2, lambda, gamma, pen_vec, pen_diff, e_alpha, rlasso_pen, pen_vec1, pen_vec2, dual_pen1, dual_pen2)
}

#' Calculates the gradient vector based on Von Oertzen \& Brick, 2014
#'
#' @param par vector with parameters.
#' @param ImpCov expected covariance matrix.
#' @param SampCov Sample covariance matrix.
#' @param Areg A matrix with current parameter estimates.
#' @param Sreg S matrix with current parameter estimates.
#' @param A A matrix with parameter labels.
#' @param S S matrix with parameter labels.
#' @param F F matrix.
#' @param lambda penalty value.
#' @param type2 penalty type.
#' @param pen_vec parameter indicators to be penalized.
#' @param diff_par parameter values to take deviations from.
#'
rcpp_grad_ram <- function(par, ImpCov, SampCov, Areg, Sreg, A, S, F, lambda, type2, pen_vec, diff_par) {
    .Call(`_regsem_rcpp_grad_ram`, par, ImpCov, SampCov, Areg, Sreg, A, S, F, lambda, type2, pen_vec, diff_par)
}

#' Compute quasi Hessian
#'
#' @param I identity matrix.
#' @param s s vector.
#' @param y y vector.
#' @param H previous Hessian.
rcpp_quasi_calc <- function(I, s, y, H) {
    .Call(`_regsem_rcpp_quasi_calc`, I, s, y, H)
}