Skip to content

Commit

Permalink
Added value for documentation of several functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Otso Ovaskainen authored and Otso Ovaskainen committed Oct 11, 2019
1 parent 206782f commit 65b5a95
Show file tree
Hide file tree
Showing 14 changed files with 35 additions and 5 deletions.
2 changes: 2 additions & 0 deletions R/alignPosterior.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#'
#' @param hM a fitted \code{Hmsc} model object
#'
#' @return an \code{Hmsc} model object that is identical to the input except the posterior being aligned
#'
#' @examples
#' # Align the posterior for a previously fitted HMSC model
#' m = alignPosterior(TD$m)
Expand Down
2 changes: 2 additions & 0 deletions R/computeDataParameters.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#'
#' @param hM a fitted \code{Hmsc} model object
#'
#' @return a list including pre-computed matrix inverses and determinants (for phylogenetic and spatial random effects) needed in MCMC sampling
#'
#' @importFrom stats dist
#' @importFrom FNN get.knn
#' @importFrom Matrix .sparseDiagonal t solve
Expand Down
2 changes: 2 additions & 0 deletions R/computeInitialParameters.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#' @param hM a fitted \code{Hmsc} model object
#' @param initPar initial parameter values
#'
#' @return a list of Hmsc model parameters
#'
#' @importFrom stats glm.fit lm.fit coef rgamma rnorm binomial poisson
#' cov runif
#' @importFrom abind abind
Expand Down
2 changes: 2 additions & 0 deletions R/computePredictedValues.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
#' @param updater a named list, specifying which conditional updaters should be ommitted
#' @param verbose the interval between MCMC steps printed to the console
#'
#' @return an array of model predictions, made for each posterior sample
#'
#' @details If the option \code{partition} is not used, the posterior predictive distribution is based on the model
#' fitted to the full data. If the option \code{partition} is used but \code{partition.sp} is not used, the posterior predictive distribution
#' is based on cross-validation over the sampling units. If \code{partition.sp} is additionally used, then, when predictions are made for
Expand Down
2 changes: 1 addition & 1 deletion R/constructGradient.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#' @param non.focalVariables list giving assumptions on how non-focal variables co-vary with the focal variable
#' @param ngrid number of points along the gradient (for continuous focal variables)
#'
#'#' @return a named list with slots \code{XDataNew}, \code{studyDesignNew} and \code{rLNew}
#' @return a named list with slots \code{XDataNew}, \code{studyDesignNew} and \code{rLNew}
#'
#' @details
#' \code{non.focalVariables} is a list, of which each element is on the form variable=list(type,value),
Expand Down
2 changes: 2 additions & 0 deletions R/createPartition.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#' @param nfolds number of cross-validation folds
#' @param column name or index of the column in the \code{studyDesign} matrix, corresponding to the level for which units are splitted into folds
#'
#' @return a vector describing the fold of each sampling unit
#'
#' @examples
#' # Create 3 folds for a HMSC object
#' partition = createPartition(TD$m, nfolds = 3)
Expand Down
3 changes: 2 additions & 1 deletion R/samplePrior.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
#' @param hM a fitted \code{Hmsc} model object
#' @param dataParList list of data parameters (see \code{\link{computeDataParameters}})
#'
#' @return A named list containing the Hmsc model parameters
#'
#' @importFrom stats rgamma rnorm
#' @importFrom mvtnorm rmvnorm
## is the next a typo of the previous?
#' @importFrom MASS mvrnorm
#' @importFrom MCMCpack riwish

Expand Down
3 changes: 3 additions & 0 deletions man/alignPosterior.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions man/computeDataParameters.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions man/computeInitialParameters.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions man/computePredictedValues.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions man/constructGradient.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions man/createPartition.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions man/samplePrior.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 65b5a95

Please sign in to comment.