mild.Rd
This function simplifies calculating image-wide multivariate PCA maps. The model will minimize a matrix energy similar to norm( X - UVt - UranVrant ) where the U are standard design and random effect (intercept) design matrices. The random intercept matrix is only included if repeated measures are indicated.
mild(
dataFrame,
voxmats,
basisK,
myFormulaK,
smoothingMatrix,
iterations = 10,
gamma = 1e-06,
sparsenessQuantile = 0.5,
positivity = c("positive", "negative", "either"),
initializationStrategy = 0,
repeatedMeasures = NA,
orthogonalize = FALSE,
verbose = FALSE
)
This data frame contains all relevant predictors except for the matrices associated with the image variables.
The named list of matrices that contains the changing predictors.
an integer determining the size of the basis.
This is a character string that defines a valid regression
which in this case should include predictors named as paste0("mildBasis",1:basisK)
allows parameter smoothing, should be square and same size as input matrix
number of gradient descent iterations
step size for gradient descent
quantile to control sparseness - higher is sparser
restrict to positive or negative solution (beta) weights. choices are positive, negative or either as expressed as a string.
optional initialization matrix or seed. seed should be a single number; matrix should be a n by k matrix.
list of repeated measurement identifiers. this will allow estimates of per identifier intercept.
boolean to control whether we orthogonalize the v
boolean to control verbosity of output
A list of different matrices that contain names derived from the formula and the coefficients of the regression model.
set.seed(1500)
nsub <- 12
npix <- 100
outcome <- rnorm(nsub)
covar <- rnorm(nsub)
mat <- replicate(npix, rnorm(nsub))
mat2 <- replicate(npix, rnorm(nsub))
nk <- 3
myform <- paste(
" vox2 ~ covar + vox + ",
paste0("mildBasis", 1:nk, collapse = "+")
) # optional covariates
df <- data.frame(outcome = outcome, covar = covar)
result <- mild(df, list(vox = mat, vox2 = mat2),
basisK = 3, myform,
initializationStrategy = 10
)
result <- mild(df, list(vox = mat, vox2 = mat2),
basisK = 3, myform,
initializationStrategy = 4
)
myumat <- svd(mat2, nv = 0, nu = 3)$u
result <- mild(df, list(vox = mat, vox2 = mat2),
basisK = 3, myform,
initializationStrategy = 0
)