SOIR: Scalar-on-Image regression in STAR framework using sarim

Description Usage Arguments Value Examples

View source: R/SOIR.R

Description

Returns a sx-object for Scalar-on-Image regression within sarim function

Usage

1
2
3
4
SOIR(images, dimension = rep(sqrt(ncol(images)), 2),
  neighbours = c("2dfirst", "2dsecond", "2dallfirst", "3dfirst",
  "3dsecond", "3dallfirst"), solver = c("rue", "lanczos"),
  demean = FALSE, add_diag = NULL, ...)

Arguments

images

The vectorized images (columnwise)

dimension

Vector which defines the dimension of the images

neighbours

String defining the type of neighbourhood of underlying GMRF

solver

String defining the solve which should be used

demean

Logical, definign wether the mena of images should be substraced

add_diag

numeric value, default is NULL. For numeric stability one can add a value to main diagonal to structure matrix

...

Further arguments for the underlying function Sarim::sx(), most relevant are ka_a, ka_b and ka_start

Value

sx-object with images, structure matrix and so on.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
### simple call:
ims <- matrix(1:(100*32*32), nrow = 100, ncol = 32*32)
SOIR(ims)

### visualization of the structure matrix
plot(SOIR(ims))

### Call within Sarim:
beta <- rnorm(32*32)
y <- ims  %*% beta + rnorm(100, sd = 5)
mod <- Sarim::sarim(y ~ SOIR(ims, add_diag = 0.1, ), nIter = 10)

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