https://github.com/cran/ensembleBMA
Raw File
Tip revision: 2bbb7ed69a64dd97b55a40d832b19fbc77e89b10 authored by Chris Fraley on 02 September 2022, 06:20:05 UTC
version 5.1.8
Tip revision: 2bbb7ed
modelParameters.ensembleBMAgamma0.R
`modelParameters.ensembleBMAgamma0` <-
function(fit, dates = NULL, ...) 
{
#
# copyright 2006-present, University of Washington. All rights reserved.
# for terms of use, see the LICENSE file
#

 dateTable <- dimnames(fit$weights)[[2]]

 if (is.null(dates)) dates <- dateTable

 dates <- sort(unique(as.character(dates)))

 if (length(dates) > length(dateTable)) 
   stop("parameters not available for some dates")

 I <- match( dates, dateTable, nomatch=0)

 if (any(!I) || !length(I)) 
   stop("parameters not available for some dates")

 list(weights = fit$weights[,I], 
      prob0coefs = fit$prob0coefs[,,I],
      biasCoefs = fit$biasCoefs[,,I], 
      varCoefs = fit$varCoefs[,I],
      power = fit$power,
      model = "gamma0")
}

back to top