get_beta: Extract beta coeffiscients from sarim output

Description Usage Arguments Value Examples

View source: R/utilities_SOIR.R

Description

Extract beta coeffiscients from sarim output

Usage

1
2
get_beta(model, intercept = FALSE, burnin = 50, reduce = TRUE,
  reduce_with = mean)

Arguments

model

list, output list from sarim function

intercept

logical indicating if sarim was calculated with intercept

burnin

integer, controlls how many iterations at start should be deleted

reduce

logical, controlls wether the output should be reduced to 1 number per beta

reduce_with

function, defines the function to reduce output, e.g. mean

Value

either a vector, the mean of each beta or a matrix

Examples

1
2
3
4
5
beta <- rnorm(32*32)
y <- ims  %*% beta + rnorm(100, sd = 5)
Sarim::sarim(y ~ SOIR(ims, neighbours = "2dallfirst", add_diag = 0.1), nIter = 10) %>%
get_beta(burnin = 2) %>%
plot_coefficient_image

RaphaelRe/SOIR documentation built on May 28, 2019, 12:19 p.m.