symilr: Symmetric multivariate, penalized image-based linear...

Description Usage Arguments Value Author(s) See Also Examples

View source: R/multiscaleSVDxpts.R

Description

SyMILR minimizes reconstruction error across related modalities. That is, SyMILR will reconstruct each modality matrix from a basis set derived from the other modalities. The basis set can be derived from SVD, ICA or a simple sum of basis representations. This function produces dataset-wide multivariate beta maps for each of the related matrices. The multivariate beta maps are regularized by user input matrices that encode relationships between variables. The idea is overall similar to canonical correlation analysis but generalizes the basis construction and to arbitrary numbers of modalities.

Usage

1
2
3
4
symilr(voxmats, smoothingMatrices, iterations = 10, sparsenessQuantiles,
  positivities, initialUMatrix, mixAlg, orthogonalize = TRUE,
  repeatedMeasures = NA, lineSearchRange = c(0, 10),
  lineSearchTolerance = 0.001, verbose = FALSE)

Arguments

voxmats

A list that contains the named matrices. Note: the optimization will likely perform much more smoothly if the input matrices are each scaled to zero mean unit variance e.g. by the scale function.

smoothingMatrices

list of (sparse) matrices that allow parameter smoothing/regularization. These should be square and same order and size of input matrices.

iterations

number of gradient descent iterations

sparsenessQuantiles

vector of quantiles to control sparseness - higher is sparser

positivities

vector that sets for each matrix if we restrict to positive or negative solution (beta) weights. choices are positive, negative or either as expressed as a string.

initialUMatrix

list of initialization matrix size n by k for each modality. Otherwise, pass a single scalar to control the number of basis functions in which case random initialization occurs. One may also pass a single initialization matrix to be used for all matrices. If this is set to a scalar, or is missing, a random matrix will be used.

mixAlg

'svd', 'ica', 'rrpca-l', 'rrpca-s' or 'avg' denotes the algorithm employed when estimating the mixed modality bases

orthogonalize

boolean to control whether we orthogonalize the solutions explicitly

repeatedMeasures

list of repeated measurement identifiers. this will allow estimates of per identifier intercept.

lineSearchRange

lower and upper limit used in optimize

lineSearchTolerance

tolerance used in optimize, will be multiplied by each matrix norm such that it scales appropriately with input data

verbose

boolean to control verbosity of output

Value

A list of u, x, y, z etc related matrices.

Author(s)

BB Avants.

See Also

milr mild symilr2

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
set.seed(1500)
nsub = 25
npix = c(100,200,133)
nk = 5
outcome = matrix(rnorm( nsub * nk ),ncol=nk)
outcome1 = matrix(rnorm( nsub * nk ),ncol=nk)
outcome2 = matrix(rnorm( nsub * nk ),ncol=nk)
outcome3 = matrix(rnorm( nsub * nk ),ncol=nk)
view1tx = matrix( rnorm( npix[1]  * nk ), nrow=nk )
view2tx = matrix( rnorm( npix[2]  * nk ), nrow=nk )
view3tx = matrix( rnorm( npix[3]  * nk ), nrow=nk )
mat1 = (outcome %*% t(outcome1) %*% (outcome1)) %*% view1tx
mat2 = (outcome %*% t(outcome2) %*% (outcome2)) %*% view2tx
mat3 = (outcome %*% t(outcome3) %*% (outcome3)) %*% view3tx
result = symilr(list( vox = mat1, vox2 = mat2, vox3 = mat3 ),
   initialUMatrix = nk , verbose=TRUE, iterations=5  )
p1 = mat1 %*% (result$v[[1]])
p2 = mat2 %*% (result$v[[2]])
p3 = mat3 %*% (result$v[[3]])

# compare to permuted data
s1 = sample( 1:nsub)
s2 = sample( 1:nsub)
resultp = symilr(list( vox = mat1, vox2 = mat2[s1,], vox3 = mat3[s2,] ),
   initialUMatrix = nk , verbose=TRUE, iterations=5  )
p1p = mat1 %*% (resultp$v[[1]])
p2p = mat2[s1,] %*% (resultp$v[[2]])
p3p = mat3[s2,] %*% (resultp$v[[3]])

# compare to SVD
svd1 = svd( mat1, nu=nk, nv=0 )$u
svd2 = svd( mat2, nu=nk, nv=0 )$u
svd3 = svd( mat3, nu=nk, nv=0 )$u

# real
range(cor(p1,p2))
range(cor(p1,p3))
range(cor(p3,p2))

# permuted
range(cor(p1p,p2p))
range(cor(p1p,p3p))
range(cor(p3p,p2p))

# svd
print( range(cor( svd1,svd2) ))

neuroconductor-devel/ANTsR documentation built on March 8, 2019, 2:13 a.m.