Skip to content

Commit

Permalink
editing documentation before pull reequest
Browse files Browse the repository at this point in the history
  • Loading branch information
jk-brown committed Feb 13, 2024
1 parent 6787eea commit 4238827
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 16 deletions.
5 changes: 3 additions & 2 deletions R/RMSE_calc.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@
#' @param sigma A single value or vector of error terms the same length as y.
#' A single value will apply a constant error term. User can provide a vector
#' of error terms to incorporate time-varying error into the RMSE calculation.
#'
#' `sigma` default assume homoscedasticity of residuals and applies a constant
#' error term equal to the standard deviation of observed data (scoring criterion).

#' @return Returns a vector of RMSE values
#' @export
#'
#' @examples
#' x <- c(1:5)
#' y <- c(5:9)
#'
#' # constant error
#' RMSE_calc(x, y)
RMSE_calc <- function(x, y, sigma = sd(y)) {
# Check if all values are NA
Expand Down
16 changes: 11 additions & 5 deletions R/score_bayesian.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,17 @@
#' @param m A Matrix of values. The first column of the matrix should be
#' a vector of observed data for a give variable. Subsequent vectors should be
#' representative of modeled values for a given variable.
#' @param sigma Numeric value (optional). The standard deviation parameter for
#' the normal distribution used in the Bayesian analysis. If not provided, the
#' function will automatically compute it as the standard deviation of the
#' Root Mean Square Error (RMSE). A smaller value of `sigma` will make the
#' Bayesian analysis give more weight to models with lower RMSE values.
#' @param sigma Numeric value (optional). A single value or vector of error terms
#' the same length as y. A single value will apply a constant error term. User
#' can provide a vector of error terms to incorporate time-varying error
#' to the RMSE calculation. `sigma` default assume homoscedasticity of residuals
#' and applies a constant error term equal to the standard deviation of observed
#' data (scoring criterion).
#' @param sensitivity A multiplier that adjusts the sensitivity of the likelihood
#' values to increasing RMSE. If not provided, the function will automatically
#' calculate the sensitivity as one unit of standard deviation of the RMSE results.
#' A smaller sensitivity value will make the Bayesian analysis give more weight
#' to models with lower RMSE values.
#'
#' @note Note: In Bayesian statistics, the choice of `sigma` can significantly
#' impact the results and conclusions of the analysis. Users are encouraged to
Expand Down
8 changes: 7 additions & 1 deletion man/RMSE_calc.Rd

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

23 changes: 15 additions & 8 deletions man/score_bayesian.Rd

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

0 comments on commit 4238827

Please sign in to comment.