R/RcppExports.R

Defines functions rep_vec round_if_almost_eq get_risk_obj_rcpp parallelglm logLike_cpp check_prior_bw_state_comb check_prior_bw_comb check_fw_bw_comb check_observational_cdist check_artificial_prior check_state_bw check_state_fw linear_mapper_test trunc_eta_exponential_test_log_eps trunc_eta_exponential_test lambert_W0_test selection_matrix_map_vec_test selection_matrix_map_mat_test qr_R_test qr_qty_vec_test qr_qty_mat_test solve_LU_vec solve_LU_mat solve_LU_inv solve_w_precomputed_chol_test sym_mat_rank_one_update_test tri_mat_times_vec_test symmetric_mat_chol_test square_tri_inv_test chol_rank_one_update_test test_get_resample_idx_n_log_weight test_get_ancestors PF_cloud_to_rcpp_and_back SMA_hepler_exp_compute_length SMA_hepler_logit_compute_length bigglm_updateQR_rcpp dmvtrm_log_test mvtrnorm_test dmvnrm_log_test mvrnorm_test sample_n_count_replicas_systematic_test sample_n_count_replicas_indices_test systematic_resampling_test sample_indices_test ddhazard_fit_cpp bigglm_regcf_rcpp pf_fixed_effect_get_QR PF_get_score_n_hess_cpp PF_est_params_dens compute_PF_summary_stats particle_filter PF_smooth

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

PF_smooth <- function(n_fixed_terms_in_state_vec, X, fixed_terms, tstart, tstop, a_0, R, Q_0, Q, Q_tilde, risk_obj, Fmat, n_max, n_threads, fixed_params, N_fw_n_bw, N_smooth, N_smooth_final, covar_fac, ftol_rel, forward_backward_ESS_threshold, debug, N_first, type, nu, method, smoother, model) {
    .Call(`_dynamichazard_PF_smooth`, n_fixed_terms_in_state_vec, X, fixed_terms, tstart, tstop, a_0, R, Q_0, Q, Q_tilde, risk_obj, Fmat, n_max, n_threads, fixed_params, N_fw_n_bw, N_smooth, N_smooth_final, covar_fac, ftol_rel, forward_backward_ESS_threshold, debug, N_first, type, nu, method, smoother, model)
}

particle_filter <- function(n_fixed_terms_in_state_vec, X, fixed_terms, tstart, tstop, a_0, R, Q_0, Q, Q_tilde, risk_obj, Fmat, n_threads, fixed_params, N_fw_n_bw, forward_backward_ESS_threshold, debug, N_first, nu, type, is_forward, method, model, covar_fac, ftol_rel) {
    .Call(`_dynamichazard_particle_filter`, n_fixed_terms_in_state_vec, X, fixed_terms, tstart, tstop, a_0, R, Q_0, Q, Q_tilde, risk_obj, Fmat, n_threads, fixed_params, N_fw_n_bw, forward_backward_ESS_threshold, debug, N_first, nu, type, is_forward, method, model, covar_fac, ftol_rel)
}

compute_PF_summary_stats <- function(rcpp_list, n_threads, a_0, Q, Q_0, R, debug, Fmat, do_use_F = FALSE, do_compute_E_x = TRUE) {
    .Call(`_dynamichazard_compute_PF_summary_stats`, rcpp_list, n_threads, a_0, Q, Q_0, R, debug, Fmat, do_use_F, do_compute_E_x)
}

PF_est_params_dens <- function(rcpp_list, n_threads, a_0, Q, Q_0, R, debug, do_est_a_0 = FALSE, only_QR = FALSE) {
    .Call(`_dynamichazard_PF_est_params_dens`, rcpp_list, n_threads, a_0, Q, Q_0, R, debug, do_est_a_0, only_QR)
}

PF_get_score_n_hess_cpp <- function(fw_cloud, Q, Fmat, risk_obj, ran_vars, fixed_terms, tstart, tstop, fixed_params, family, max_threads, debug, a_0, R, Q_0, Q_tilde, N_fw_n_bw, N_first, nu, covar_fac, ftol_rel, method, forward_backward_ESS_threshold, use_O_n_sq = FALSE, only_score = FALSE) {
    .Call(`_dynamichazard_PF_get_score_n_hess_cpp`, fw_cloud, Q, Fmat, risk_obj, ran_vars, fixed_terms, tstart, tstop, fixed_params, family, max_threads, debug, a_0, R, Q_0, Q_tilde, N_fw_n_bw, N_first, nu, covar_fac, ftol_rel, method, forward_backward_ESS_threshold, use_O_n_sq, only_score)
}

pf_fixed_effect_get_QR <- function(clouds, risk_obj, ran_vars, fixed_terms, R_top, tstart, tstop, fixed_params, family, max_threads, debug) {
    .Call(`_dynamichazard_pf_fixed_effect_get_QR`, clouds, risk_obj, ran_vars, fixed_terms, R_top, tstart, tstop, fixed_params, family, max_threads, debug)
}

bigglm_regcf_rcpp <- function(D, rbar, thetab, ss, checked, tol) {
    .Call(`_dynamichazard_bigglm_regcf_rcpp`, D, rbar, thetab, ss, checked, tol)
}

ddhazard_fit_cpp <- function(X, fixed_terms, weights, tstart, tstop, a_0, fixed_parems_start, R, L, Q_0, Q, risk_obj, F_, eps_fixed_parems, max_it_fixed_params, n_max = 100L, eps = 0.001, verbose = 0L, est_Q_0 = TRUE, method = "EKF", kappa = NULL, alpha = NULL, beta = NULL, NR_eps = NULL, LR = NULL, model = "logit", M_step_formulation = "Fahrmier94", fixed_effect_chunk_size = 2e4L, debug = FALSE, NR_it_max = 100L, n_threads = -1L, denom_term = .0001, n_fixed_terms_in_state_vec = 0L, use_pinv = FALSE, criteria = "delta_coef", posterior_version = "cholesky", GMA_max_rep = 10L, GMA_NR_eps = 0.1, EKF_batch_size = 5000L, est_a_0 = TRUE) {
    .Call(`_dynamichazard_ddhazard_fit_cpp`, X, fixed_terms, weights, tstart, tstop, a_0, fixed_parems_start, R, L, Q_0, Q, risk_obj, F_, eps_fixed_parems, max_it_fixed_params, n_max, eps, verbose, est_Q_0, method, kappa, alpha, beta, NR_eps, LR, model, M_step_formulation, fixed_effect_chunk_size, debug, NR_it_max, n_threads, denom_term, n_fixed_terms_in_state_vec, use_pinv, criteria, posterior_version, GMA_max_rep, GMA_NR_eps, EKF_batch_size, est_a_0)
}

sample_indices_test <- function(size, probs) {
    .Call(`_dynamichazard_sample_indices_test`, size, probs)
}

systematic_resampling_test <- function(size, probs) {
    .Call(`_dynamichazard_systematic_resampling_test`, size, probs)
}

sample_n_count_replicas_indices_test <- function(size, probs) {
    .Call(`_dynamichazard_sample_n_count_replicas_indices_test`, size, probs)
}

sample_n_count_replicas_systematic_test <- function(size, probs) {
    .Call(`_dynamichazard_sample_n_count_replicas_systematic_test`, size, probs)
}

mvrnorm_test <- function(mu, sigma_chol) {
    .Call(`_dynamichazard_mvrnorm_test`, mu, sigma_chol)
}

dmvnrm_log_test <- function(x, mean, sigma_chol_inv) {
    .Call(`_dynamichazard_dmvnrm_log_test`, x, mean, sigma_chol_inv)
}

mvtrnorm_test <- function(mu, sigma_chol, nu) {
    .Call(`_dynamichazard_mvtrnorm_test`, mu, sigma_chol, nu)
}

dmvtrm_log_test <- function(x, mean, sigma_chol_inv, nu) {
    .Call(`_dynamichazard_dmvtrm_log_test`, x, mean, sigma_chol_inv, nu)
}

bigglm_updateQR_rcpp <- function(D, rbar, thetab, ss, checked, tol, model, X, eta, offset, at_risk_length, y, w) {
    invisible(.Call(`_dynamichazard_bigglm_updateQR_rcpp`, D, rbar, thetab, ss, checked, tol, model, X, eta, offset, at_risk_length, y, w))
}

SMA_hepler_logit_compute_length <- function(offset, coef1, coef2, w, y) {
    .Call(`_dynamichazard_SMA_hepler_logit_compute_length`, offset, coef1, coef2, w, y)
}

SMA_hepler_exp_compute_length <- function(offset, coef1, coef2, w, y, length) {
    .Call(`_dynamichazard_SMA_hepler_exp_compute_length`, offset, coef1, coef2, w, y, length)
}

PF_cloud_to_rcpp_and_back <- function(rcpp_list) {
    .Call(`_dynamichazard_PF_cloud_to_rcpp_and_back`, rcpp_list)
}

test_get_ancestors <- function(rcpp_list) {
    .Call(`_dynamichazard_test_get_ancestors`, rcpp_list)
}

test_get_resample_idx_n_log_weight <- function(log_weights, log_resample_weights, resample_idx) {
    .Call(`_dynamichazard_test_get_resample_idx_n_log_weight`, log_weights, log_resample_weights, resample_idx)
}

chol_rank_one_update_test <- function(R, x) {
    invisible(.Call(`_dynamichazard_chol_rank_one_update_test`, R, x))
}

square_tri_inv_test <- function(R) {
    .Call(`_dynamichazard_square_tri_inv_test`, R)
}

symmetric_mat_chol_test <- function(A, out) {
    invisible(.Call(`_dynamichazard_symmetric_mat_chol_test`, A, out))
}

tri_mat_times_vec_test <- function(A, x, out, is_transpose) {
    invisible(.Call(`_dynamichazard_tri_mat_times_vec_test`, A, x, out, is_transpose))
}

sym_mat_rank_one_update_test <- function(alpha, x, A) {
    invisible(.Call(`_dynamichazard_sym_mat_rank_one_update_test`, alpha, x, A))
}

solve_w_precomputed_chol_test <- function(chol_decomp, B, D) {
    .Call(`_dynamichazard_solve_w_precomputed_chol_test`, chol_decomp, B, D)
}

solve_LU_inv <- function(A) {
    .Call(`_dynamichazard_solve_LU_inv`, A)
}

solve_LU_mat <- function(A, B) {
    .Call(`_dynamichazard_solve_LU_mat`, A, B)
}

solve_LU_vec <- function(A, B) {
    .Call(`_dynamichazard_solve_LU_vec`, A, B)
}

qr_qty_mat_test <- function(A, B) {
    .Call(`_dynamichazard_qr_qty_mat_test`, A, B)
}

qr_qty_vec_test <- function(A, B) {
    .Call(`_dynamichazard_qr_qty_vec_test`, A, B)
}

qr_R_test <- function(A) {
    .Call(`_dynamichazard_qr_R_test`, A)
}

selection_matrix_map_mat_test <- function(L, X, is_right, is_inv) {
    .Call(`_dynamichazard_selection_matrix_map_mat_test`, L, X, is_right, is_inv)
}

selection_matrix_map_vec_test <- function(L, X, is_inv) {
    .Call(`_dynamichazard_selection_matrix_map_vec_test`, L, X, is_inv)
}

lambert_W0_test <- function(x) {
    .Call(`_dynamichazard_lambert_W0_test`, x)
}

trunc_eta_exponential_test <- function(eta, at_risk_length, is_event) {
    .Call(`_dynamichazard_trunc_eta_exponential_test`, eta, at_risk_length, is_event)
}

trunc_eta_exponential_test_log_eps <- function() {
    .Call(`_dynamichazard_trunc_eta_exponential_test_log_eps`)
}

linear_mapper_test <- function(A, x, X, z, Z, type, R) {
    .Call(`_dynamichazard_linear_mapper_test`, A, x, X, z, Z, type, R)
}

check_state_fw <- function(parent, parent1, child, child1, Fmat, Q) {
    .Call(`_dynamichazard_check_state_fw`, parent, parent1, child, child1, Fmat, Q)
}

check_state_bw <- function(parent, parent1, child, child1, Fmat, Q) {
    .Call(`_dynamichazard_check_state_bw`, parent, parent1, child, child1, Fmat, Q)
}

check_artificial_prior <- function(state, Fmat, Q, m_0, Q_0, t1, t2, t3) {
    .Call(`_dynamichazard_check_artificial_prior`, state, Fmat, Q, m_0, Q_0, t1, t2, t3)
}

check_observational_cdist <- function(X, is_event, offsets, tstart, tstop, bin_start, bin_stop, multithreaded, fam, state, state1) {
    .Call(`_dynamichazard_check_observational_cdist`, X, is_event, offsets, tstart, tstop, bin_start, bin_stop, multithreaded, fam, state, state1)
}

check_fw_bw_comb <- function(Fmat, Q, parent, parent1, grand_child, grand_child1, x, nu) {
    .Call(`_dynamichazard_check_fw_bw_comb`, Fmat, Q, parent, parent1, grand_child, grand_child1, x, nu)
}

check_prior_bw_comb <- function(Fmat, Q, m_0, Q_0, child, child1, parent, t1, t2) {
    .Call(`_dynamichazard_check_prior_bw_comb`, Fmat, Q, m_0, Q_0, child, child1, parent, t1, t2)
}

check_prior_bw_state_comb <- function(X, is_event, offsets, tstart, tstop, bin_start, bin_stop, fam, Fmat, Q, m_0, Q_0, child, child1, parent, t1, Q_xtra, nu = -1L, covar_fac = -1, ftol_rel = 1e-8) {
    .Call(`_dynamichazard_check_prior_bw_state_comb`, X, is_event, offsets, tstart, tstop, bin_start, bin_stop, fam, Fmat, Q, m_0, Q_0, child, child1, parent, t1, Q_xtra, nu, covar_fac, ftol_rel)
}

logLike_cpp <- function(X, risk_obj, Fmat, Q_0, Q, a_t_d_s, tstart, tstop, fixed_effects_offsets, order_, model) {
    .Call(`_dynamichazard_logLike_cpp`, X, risk_obj, Fmat, Q_0, Q, a_t_d_s, tstart, tstop, fixed_effects_offsets, order_, model)
}

parallelglm <- function(X, Ys, family, beta0, weights, offsets, tol = 1e-8, nthreads = 1L, it_max = 25L, trace = FALSE, method = "Quick") {
    .Call(`_dynamichazard_parallelglm`, X, Ys, family, beta0, weights, offsets, tol, nthreads, it_max, trace, method)
}

get_risk_obj_rcpp <- function(start, stop, event, by, start_order, max_T, order_by_id_and_rev_start, id, min_start, event_times_in, is_for_discrete_model = TRUE) {
    .Call(`_dynamichazard_get_risk_obj_rcpp`, start, stop, event, by, start_order, max_T, order_by_id_and_rev_start, id, min_start, event_times_in, is_for_discrete_model)
}

round_if_almost_eq <- function(x, x_ord, boundaries) {
    .Call(`_dynamichazard_round_if_almost_eq`, x, x_ord, boundaries)
}

rep_vec <- function(col_vals, n_rows) {
    .Call(`_dynamichazard_rep_vec`, col_vals, n_rows)
}

Try the dynamichazard package in your browser

Any scripts or data that you put into this service are public.

dynamichazard documentation built on Oct. 6, 2022, 1:08 a.m.