fusedanova: Fit a Fused ANOVA model

Description Usage Arguments Value See Also Examples

View source: R/fusedanova.R

Description

Adjust a penalized ANOVA model with Fused-LASSO (or Total Variation) penality, ie. a sum of weighted l1-norm on the difference of each coefficient. See details below.

Usage

1

Arguments

x

matrix (or column vector) which rows represent individuals and columns independant variables.

class

vector or factor giving the class of each individual. If missing, 1:nrow(x) is used (clustering mode with one individual per class).

...

list of additional parameters to overwrite the defaults of the fitting procedure. Include :

  • weights: character; which type of weights is supposed to be used. The supported weights are : "default", "laplace", "gaussian", "adaptive", "naivettest", "ttest", "welch" and "personal". Se details below. By default, its value is "default".

  • gamma: numeric; the gamma parameter needed for "laplace", "gaussian" and "adaptive" weights. By default, 0.

  • W: numeric matrix; the matrix of weights needed if the "personal" weights were selected. By default, a matrix with zero row and zero column.

  • standardize: logical; should each variable be standardized before the calculus ? By default, TRUE.

  • splits: integer; coding for forcing split or nosplit algorithms :

    • 0 : Default value, let the programm decide which algorithm to use depending on the choosen weights.

    • 1 : Forces the algorithm not to take the splits into account.

    • 2 : Forces the algorithm to take the splits into account even if the solution paths contains no split.

    Note : For the moment, only the no split algorithm has been coded. Please ensure that your weights choice leads to the no split algorithm or set split to 1.

  • epsilon: numeric; tolerance parameter for numeric calculations. By default, eps. Note : this is currently not used.

  • checkargs: logical; should arguments be checked to (hopefully) avoid internal crashes? Default is TRUE. Automatically set to FALSE when a call is made from cross-validation

  • lambdalist: numeric vector; a set of lambda value for which a prediction is asked. By default, a null vector. If the length of lambdalist is not 0, the fusedanova class returnded by the fusedanova function will have a not null attribute prediction.

  • mc.cores: integer; the number of cores to use. The default uses all the cores available.

  • verbose: boolean; should the code print out its progress. By default, FALSE.

  • mxSplitSize: integer; the maximum size for a group for being checked the cores available.

Value

an object with class fusedanova, see the documentation page fusedanova for details.

The optimization problem solved by fused-ANOVA is

βhat λ1 = argminβ sumk sum_i (Yik - &betak)2 + λ sumk,l wk,l | βk - βl |,

where Y_ik is the intensity of a continuous random variable for sample i in condition k and beta_k is the mean parameter of condition k. We denote by K the total number of conditions and n_k the number of sample in each condition.

More details related to the weights are coming...

See Also

See also fusedanova, plot,fusedanova-method and cv.fa.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
data(aves)
fa.laplace <- fusedanova(x=aves$weight, class=aves$family, weights="laplace", gamma=5)
plot(fa.laplace, labels=aves$order)

fa.ttest <- fusedanova(x=aves$weight, class=aves$family, weights="naivettest")
plot(fa.ttest, labels=aves$order)

fa.ada <- fusedanova(x=aves$weight, class=aves$family, weights="adaptive", gamma=2)
plot(fa.ada, labels=aves$order)

## End(Not run)

fusedanova documentation built on May 31, 2017, 1:38 a.m.