Skip to content

Commit

Permalink
Initial roxygen pass
Browse files Browse the repository at this point in the history
  • Loading branch information
andrjohns committed May 20, 2024
1 parent 2a9c7bf commit e979876
Show file tree
Hide file tree
Showing 15 changed files with 480 additions and 172 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,8 @@ vignettes/*.html
vignettes/*_files
.DS_Store
revdep/*
*.o
*.cc
*.h
src/Makevars
R/stanmodels.R
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,4 @@ UseLTO: true
NeedsCompilation: yes
URL: https://mc-stan.org/rstanarm/, https://discourse.mc-stan.org
BugReports: https://github.com/stan-dev/rstanarm/issues
RoxygenNote: 7.2.3
RoxygenNote: 7.3.1
38 changes: 38 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@ S3method(as_draws_rvars,stanreg)
S3method(bayes_R2,stanreg)
S3method(coef,stanmvreg)
S3method(coef,stanreg)
S3method(collapse_within_groups,default)
S3method(collapse_within_groups,matrix)
S3method(confint,stanreg)
S3method(evaluate_log_survival,default)
S3method(evaluate_log_survival,matrix)
S3method(extract_pars,stanmvreg)
S3method(extract_pars,stansurv)
S3method(family,stanmvreg)
S3method(family,stanreg)
S3method(fitted,stanmvreg)
Expand All @@ -23,6 +29,8 @@ S3method(fixef,stanmvreg)
S3method(fixef,stanreg)
S3method(formula,stanmvreg)
S3method(formula,stanreg)
S3method(get_model_data,stanmvreg)
S3method(get_model_data,stansurv)
S3method(get_surv,stanjm)
S3method(get_surv,stansurv)
S3method(get_x,default)
Expand All @@ -35,6 +43,15 @@ S3method(get_z,lmerMod)
S3method(get_z,stanmvreg)
S3method(kfold,stanreg)
S3method(launch_shinystan,stanreg)
S3method(linear_predictor,default)
S3method(linear_predictor,matrix)
S3method(linkinv,character)
S3method(linkinv,family)
S3method(linkinv,stanmvreg)
S3method(linkinv,stanreg)
S3method(ll_args,stanjm)
S3method(ll_args,stanreg)
S3method(ll_args,stansurv)
S3method(log_lik,stanjm)
S3method(log_lik,stanmvreg)
S3method(log_lik,stanreg)
Expand Down Expand Up @@ -73,6 +90,7 @@ S3method(pp_check,stanreg)
S3method(predict,stanreg)
S3method(predictive_error,matrix)
S3method(predictive_error,ppd)
S3method(predictive_error,stanmvreg)
S3method(predictive_error,stanreg)
S3method(predictive_interval,matrix)
S3method(predictive_interval,ppd)
Expand All @@ -87,18 +105,28 @@ S3method(print,summary.stanreg)
S3method(print,survfit.stanjm)
S3method(print,survfit.stansurv)
S3method(prior_summary,stanreg)
S3method(psis,stanreg)
S3method(quadrature_sum,default)
S3method(quadrature_sum,matrix)
S3method(ranef,stanmvreg)
S3method(ranef,stanreg)
S3method(rename_loos,stanreg)
S3method(rename_loos,stanreg_list)
S3method(residuals,stanmvreg)
S3method(residuals,stanreg)
S3method(se,stanmvreg)
S3method(se,stanreg)
S3method(sigma,stanmvreg)
S3method(sigma,stanreg)
S3method(split2,matrix)
S3method(split2,vector)
S3method(summary,stanmvreg)
S3method(summary,stanreg)
S3method(terms,stanmvreg)
S3method(terms,stanreg)
S3method(truncate,numeric)
S3method(unpad_reTrms,array)
S3method(unpad_reTrms,default)
S3method(update,stanjm)
S3method(update,stanmvreg)
S3method(update,stanreg)
Expand All @@ -115,13 +143,17 @@ export(as_draws_matrix)
export(as_draws_rvars)
export(bayes_R2)
export(cauchy)
export(collapse_within_groups)
export(compare_models)
export(decov)
export(default_prior_coef)
export(default_prior_intercept)
export(dirichlet)
export(evaluate_log_survival)
export(exponential)
export(extract_pars)
export(fixef)
export(get_model_data)
export(get_surv)
export(get_x)
export(get_y)
Expand All @@ -133,7 +165,10 @@ export(kfold)
export(laplace)
export(lasso)
export(launch_shinystan)
export(linear_predictor)
export(linkinv)
export(lkj)
export(ll_args)
export(log_lik)
export(logit)
export(loo)
Expand Down Expand Up @@ -166,7 +201,9 @@ export(prior_options)
export(prior_summary)
export(product_normal)
export(ps_check)
export(quadrature_sum)
export(ranef)
export(rename_loos)
export(se)
export(sigma)
export(stan_aov)
Expand Down Expand Up @@ -196,6 +233,7 @@ export(stanmvreg_list)
export(stanreg_list)
export(student_t)
export(tve)
export(unpad_reTrms)
export(waic)
if(getRversion()>='3.3.0') importFrom(stats, sigma) else
importFrom(lme4,sigma)
Expand Down
2 changes: 1 addition & 1 deletion R/doc-rstanarm-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,4 @@
#' @template reference-bayesvis
#' @template reference-muth
#'
NULL
"_PACKAGE"
52 changes: 40 additions & 12 deletions R/jm_make_assoc_terms.R
Original file line number Diff line number Diff line change
Expand Up @@ -376,21 +376,36 @@ get_element <- function(parts, m = 1, which = "eta", ...) {
}
}

# Collapse the linear predictor across the lower level units
# clustered an individual, using the function specified in the
# 'grp_assoc' argument
#
# @param eta The linear predictor evaluated for all lower level groups
# at the quadrature points.
# @param grp_idx An N*2 array providing the indices of the first (col 1)
# and last (col 2) observations in eta that correspond to individuals
# i = 1,...,N.
# @param grp_assoc Character string, the function to use to collapse
# across the lower level units clustered within individuals.
# @return A vector or matrix, depending on the method called.
#' Collapse the linear predictor across the lower level units
#' clustered an individual, using the function specified in the
#' 'grp_assoc' argument
#'
#' @param eta The linear predictor evaluated for all lower level groups
#' at the quadrature points.
#' @param grp_idx An N*2 array providing the indices of the first (col 1)
#' and last (col 2) observations in eta that correspond to individuals
#' i = 1,...,N.
#' @param grp_assoc Character string, the function to use to collapse
#' across the lower level units clustered within individuals.
#' @return A vector or matrix, depending on the method called.
#' @export
collapse_within_groups <- function(eta, grp_idx, grp_assoc = "sum") {
UseMethod("collapse_within_groups")
}

#' Collapse the linear predictor across the lower level units
#' clustered an individual, using the function specified in the
#' 'grp_assoc' argument
#'
#' @param eta The linear predictor evaluated for all lower level groups
#' at the quadrature points.
#' @param grp_idx An N*2 array providing the indices of the first (col 1)
#' and last (col 2) observations in eta that correspond to individuals
#' i = 1,...,N.
#' @param grp_assoc Character string, the function to use to collapse
#' across the lower level units clustered within individuals.
#' @return A vector or matrix, depending on the method called.
#' @export
collapse_within_groups.default <- function(eta, grp_idx, grp_assoc) {
N <- nrow(grp_idx)
val <- rep(NA, N)
Expand All @@ -400,6 +415,19 @@ collapse_within_groups.default <- function(eta, grp_idx, grp_assoc) {
}
val
}
#' Collapse the linear predictor across the lower level units
#' clustered an individual, using the function specified in the
#' 'grp_assoc' argument
#'
#' @param eta The linear predictor evaluated for all lower level groups
#' at the quadrature points.
#' @param grp_idx An N*2 array providing the indices of the first (col 1)
#' and last (col 2) observations in eta that correspond to individuals
#' i = 1,...,N.
#' @param grp_assoc Character string, the function to use to collapse
#' across the lower level units clustered within individuals.
#' @return A vector or matrix, depending on the method called.
#' @export
collapse_within_groups.matrix <- function(eta, grp_idx, grp_assoc) {
N <- nrow(grp_idx)
val <- matrix(NA, nrow = nrow(eta), ncol = N)
Expand Down
Loading

0 comments on commit e979876

Please sign in to comment.