3737# #'
3838# #' @param ... Further arguments to be passed to the
3939# #' \code{\link[rstan]{sampling}} of the \bold{rstan} package.
40- # #'
40+ # #'
4141# #' @return An object with (S3) class \code{"TVGEVBayes"}. This is
4242# #' mainly a list with the following items
43- # #' \itemize{
44- # #' \item{stanFit }{The object with class \code{"stanfit"} returned
45- # #' by \code{\link[rstan]{sampling}}. \bold{Caution}: for now
46- # #' the parameter names do not match the parameter names
47- # #' of the \code{TVGEVBayes} object.
48- # #' }
49- # #' \item{MCMC }{The array of MCMC iterates with the warm-up
50- # #' iterations discarded. The dimensions are: \emph{MCMC iterate},
51- # #' \emph{chain} and \emph{parameter}. The parameters have names
52- # #' using prefixes \code{"mu"}, \code{"sigma"} and \code{"xi"}.
53- # #' The remaining part of the names is given by the
54- # #' \code{\link[stats]{terms}} hence conforms to what would be obtained
55- # #' using \code{lm} with the same formula. However an exception is for
56- # #' the intercepts. For instance the name \code{"mu_(Intercept)"} will be
57- # #' replaced by \code{"mu_0"}.
58- # #' }
43+ # #'
44+ # #' \item{stanFit }{The object with class \code{"stanfit"} returned
45+ # #' by \code{\link[rstan]{sampling}}. \bold{Caution}: for now
46+ # #' the parameter names do not match the parameter names
47+ # #' of the \code{TVGEVBayes} object.
48+ # #' }
49+ # #' \item{MCMC }{The array of MCMC iterates with the warm-up
50+ # #' iterations discarded. The dimensions are: \emph{MCMC iterate},
51+ # #' \emph{chain} and \emph{parameter}. The parameters have names
52+ # #' using prefixes \code{"mu"}, \code{"sigma"} and \code{"xi"}.
53+ # #' The remaining part of the names is given by the
54+ # #' \code{\link[stats]{terms}} hence conforms to what would be obtained
55+ # #' using \code{lm} with the same formula. However an exception is for
56+ # #' the intercepts. For instance the name \code{"mu_(Intercept)"} will be
57+ # #' replaced by \code{"mu_0"}.
5958# #' }
6059# #'
6160# #' @importFrom rstan stan
@@ -202,7 +201,7 @@ TVGEVBayes <- function(data,
202201 width.cutoff = 500L )),
203202 loc = loc , scale = scale , shape = shape ))
204203 fit $ call <- " <generated call>"
205-
204+
206205 # # ===========================================================================
207206 # # Prepare the data. Mind that when a vector such as 'psi_sigma' or
208207 # # 'mean_psi_sigma0' turns to be of length one Stan throws an error
@@ -260,7 +259,7 @@ TVGEVBayes <- function(data,
260259 yBar <- 35
261260
262261 if (" chains" %in% names(eDots )) {
263- nChains <- eDots $ chains
262+ nChains <- eDots $ chains
264263 } else {
265264 nChains <- 4L
266265 }
@@ -275,7 +274,7 @@ TVGEVBayes <- function(data,
275274 psi_sigma = as.array(fit $ psi [fit $ ind [[" scale" ]]] * eps ),
276275 psi_xi = as.array(fit $ psi [fit $ ind [[" shape" ]]] * eps ),
277276 y_miss = as.array(rep(yBar * eps , data $ n_miss ) ),
278- y_cens = as.array(rep(yBar * eps , data $ n_cens )))
277+ y_cens = as.array(rep(yBar * eps , data $ n_cens )))
279278 }
280279 }
281280
0 commit comments