smoothMultiRegression: Reconstruct a n by k vector given n by p matrix of...

Description Usage Arguments Value Author(s) Examples

View source: R/multiscaleSVDxpts.R

Description

Reconstruct a n by k vector given n by p matrix of predictors.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
smoothMultiRegression(
  x,
  y,
  iterations = 10,
  sparsenessQuantile = 0.5,
  positivity = FALSE,
  smoothingMatrixX = NA,
  smoothingMatrixY = NA,
  nv = 2,
  extraPredictors,
  verbose = FALSE
)

Arguments

x

input matrix on which prediction is based

y

target matrix

iterations

number of gradient descent iterations

sparsenessQuantile

quantile to control sparseness - higher is sparser.

positivity

restrict to positive or negative solution (beta) weights. choices are positive, negative or either as expressed as a string.

smoothingMatrixX

allows parameter smoothing, should be square and same size as input matrix

smoothingMatrixY

allows parameter smoothing, should be square and same size as input matrix

nv

number of predictor spatial vectors

extraPredictors

additional column predictors

verbose

boolean option

Value

vector of size p is output

Author(s)

Avants BB

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## Not run: 
mask = getMask( antsImageRead( getANTsRData( 'r16' ) ) )
spatmat = t( imageDomainToSpatialMatrix( mask, mask ) )
smoomat = knnSmoothingMatrix( spatmat, k = 200, sigma = 1.0 )
mat <- matrix(rnorm(sum(mask)*50),ncol=sum(mask),nrow=50)
mat[ 1:25,100:10000]=mat[ 1:25,100:10000]+1
age = matrix( rnorm( nrow(mat)*2 ), ncol=2 )
for ( i in c( 5000:6000, 10000:11000, 16000:17000 )  ){
  mat[ , i ] = age[,1]*0.1 + mat[,i]
  }
sel = 1:25
fit = smoothMultiRegression( x=mat[sel,], y=age[sel,], iterations = 10,
  sparsenessQuantile = 0.5,
  smoothingMatrixX = smoomat, smoothingMatrixY = NA, verbose=T )
tt = mat %*% fit$v
print( cor.test( age[-sel,1], tt[-sel,1] ) )
vimg = makeImage( mask, (fit$v[,1] ) ); print(range(vimg)*10)
plot( mask, vimg, window.overlay=range(abs(vimg)))

## End(Not run)

neuroconductor-devel/ANTsR documentation built on April 1, 2021, 1:02 p.m.