R/sigma.R

Defines functions sigma.breathteststanfit

Documented in sigma.breathteststanfit

#' @title S3 method to exctract the residual standard deviation
#' @description Functions for S3 method defined in breathtestcore for
#' \code{stan_fit} and \code{stan_group fit}.
#' @param object A Stan-based fit
#' @param ... Not used
#' @return A numeric value giving the sigma (= average residual standard deviation) term
#' from the Stan fit.
#' @importFrom stats sigma
#' @export
sigma.breathteststanfit = function(object, ...){
  mean(rstan::extract(object$stan_fit, permuted = TRUE, pars = c( "sigma"))$sigma)
}

Try the breathteststan package in your browser

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

breathteststan documentation built on April 7, 2022, 5:09 p.m.