madapter.DiagCov {BayesFluxR} | R Documentation |
Use the diagonal of sample covariance matrix as inverse mass matrix.
madapter.DiagCov(adapt_steps, windowlength, kappa = 0.5, epsilon = 1e-06)
adapt_steps |
Number of adaptation steps |
windowlength |
Lookback window length for calculation of covariance |
kappa |
How much to shrink towards the identity |
epsilon |
Small value to add to diagonal so as to avoid numerical non-pos-def problem |
list containing 'juliavar' and 'juliacode' and all given arguments.
## Not run:
## Needs previous call to `BayesFluxR_setup` which is time
## consuming and requires Julia and BayesFlux.jl
BayesFluxR_setup(installJulia=TRUE, seed=123)
net <- Chain(Dense(5, 1))
like <- likelihood.feedforward_normal(net, Gamma(2.0, 0.5))
prior <- prior.gaussian(net, 0.5)
init <- initialise.allsame(Normal(0, 0.5), like, prior)
x <- matrix(rnorm(5*100), nrow = 5)
y <- rnorm(100)
bnn <- BNN(x, y, like, prior, init)
madapter <- madapter.DiagCov(100, 10)
sampler <- sampler.GGMC(madapter = madapter)
ch <- mcmc(bnn, 10, 1000, sampler)
## End(Not run)