GrowLeaves: Extend the leaves of a graph In Albluca/ElPiGraph.R: Elastic principal graph construction

Description

This function is a wrapper to the computeElasticPrincipalGraph function that construct the appropriate initial graph and grammars when increasing the nume number around the branching point

Usage

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14``` ```GrowLeaves(X, NumNodes, NumEdges = Inf, InitNodes = 2, Lambda = 0.01, Mu = 0.1, InitNodePositions, InitEdges = NULL, ElasticMatrix = NULL, MaxSteps = 100, MaxNumberOfIterations = 10, TrimmingRadius = Inf, eps = 0.01, Do_PCA = TRUE, AdjustVect = NULL, CenterData = TRUE, ComputeMSEP = TRUE, verbose = FALSE, ShowTimer = FALSE, ReduceDimension = NULL, drawAccuracyComplexity = TRUE, drawPCAView = TRUE, drawEnergy = TRUE, n.cores = 1, MinParOP = 20, ClusType = "Sock", nReps = 1, Subsets = list(), ProbPoint = 1, Mode = 1, FinalEnergy = "Base", alpha = 0, beta = 0, FastSolve = FALSE, ICOver = NULL, DensityRadius = NULL, AvoidSolitary = FALSE, EmbPointProb = 1, ParallelRep = FALSE, SampleIC = TRUE, AdjustElasticMatrix = NULL, AdjustElasticMatrix.Initial = NULL, Lambda.Initial = NULL, Mu.Initial = NULL, ...) ```

Arguments

 `X` numerical 2D matrix, the n-by-m matrix with the position of n m-dimensional points `NumNodes` integer, the number of nodes of the principal graph `NumEdges` integer, the maximum nulber of edges `InitNodes` integer, number of points to include in the initial graph `Lambda` real, the lambda parameter used the compute the elastic energy `Mu` real, the lambda parameter used the compute the elastic energy `InitNodePositions` numerical 2D matrix, the k-by-m matrix with k m-dimensional positions of the nodes in the initial step `InitEdges` numerical 2D matrix, the e-by-2 matrix with e end-points of the edges connecting the nodes `ElasticMatrix` numerical 2D matrix, the k-by-k elastic matrix `MaxNumberOfIterations` integer, maximum number of steps to embed the nodes in the data `TrimmingRadius` real, maximal distance of point from a node to affect its embedment `eps` real, minimal relative change in the position of the nodes to stop embedment `Do_PCA` boolean, should data and initial node positions be PCA trnasformed? `AdjustVect` boolean vector keeping track of the nodes for which the elasticity parameters have been adjusted. When true for a node its elasticity parameters will not be adjusted. `CenterData` boolean, should data and initial node positions be centered? `ComputeMSEP` boolean, should MSEP be computed when building the report? `verbose` boolean, should debugging information be reported? `ShowTimer` boolean, should the time to construct the graph be computed and reported for each step? `ReduceDimension` integer vector, vector of principal components to retain when performing dimensionality reduction. If NULL all the components will be used `drawAccuracyComplexity` boolean, should the accuracy VS complexity plot be reported? `drawPCAView` boolean, should a 2D plot of the points and pricipal curve be dranw for the final configuration? `drawEnergy` boolean, should changes of evergy VS the number of nodes be reported? `n.cores` either an integer (indicating the number of cores to used for the creation of a cluster) or cluster structure returned, e.g., by makeCluster. If a cluster structure is used, all the nodes must contains X (this is done using clusterExport)' `MinParOP` integer, the minimum number of operations to use parallel computation `ClusType` string, the type of cluster to use. It can gbe either "Sock" or "Fork". Currently fork clustering only works in Linux `nReps` integer, number of replica of the construction `Subsets` list of column names (or column number). When specified a principal curve will be computed for each of the subsets specified. `ProbPoint` real between 0 and 1, probability of inclusing of a single point for each computation `Mode` integer, the energy computation mode `FinalEnergy` string indicating the final elastic emergy associated with the configuration. Currently it can be "Base" or "Penalized" `alpha` positive numeric, the value of the alpha parameter of the penalized elastic energy `beta` positive numeric, the value of the beta parameter of the penalized elastic energy `FastSolve` boolean, should FastSolve be used when fitting the points to the data? `ICOver` string, initial condition overlap mode. This can be used to alter the default behaviour for the initial configuration of the principal curve. `DensityRadius` numeric, the radius used to estimate local density. This need to be set when ICOver is equal to "Density" `AvoidSolitary` boolean, should configurations with "solitary nodes", i.e., nodes without associted points be discarded? `EmbPointProb` numeric between 0 and 1. If less than 1 point will be sampled at each iteration. EmbPointProb indicates the probability of using each points. This is an *experimental* feature, which may helps speeding up the computation if a large number of points is present. `ParallelRep` `SampleIC` boolean, should the initial configuration be considered on the sampled points when applicable? `AdjustElasticMatrix` a penalization function to adjust the elastic matrices after a configuration has been chosen (e.g., AdjustByConstant). If NULL (the default), no penalization will be used. `AdjustElasticMatrix.Initial` a penalization function to adjust the elastic matrices of the initial configuration (e.g., AdjustByConstant). If NULL (the default), no penalization will be used. `Lambda.Initial` real, the lambda parameter used the construct the elastic matrix associted with ther initial configuration if needed. If NULL, the value of Lambda will be used. `Mu.Initial` real, the mu parameter used the construct the elastic matrix associted with ther initial configuration if needed. If NULL, the value of Mu will be used. `...` optional parameter that will be passed to the AdjustElasticMatrix function

Value

A list of principal graph strucutures containing the curves constructed during the different replica of the algorithm. If the number of replicas is larger than 1. The the final element of the list is the "average curve", which is constructed by fitting the coordinates of the nodes of the reconstructed curves

Examples

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14``` ```Elastic curve with different parameters PG <- computeElasticPrincipalCurve(X = tree_data, NumNodes = 30, InitNodes = 2, verbose = TRUE) PG <- computeElasticPrincipalCurve(X = circle_data, NumNodes = 30, InitNodes = 2, verbose = TRUE) PG <- computeElasticPrincipalCurve(X = tree_data, NumNodes = 30, InitNodes = 2, verbose = TRUE, Mu = 1, Lambda = .001) PG <- computeElasticPrincipalCurve(X = circle_data, NumNodes = 30, InitNodes = 2, verbose = TRUE, Mu = 1, Lambda = .001) Bootstrapping the construction of the curve PG <- computeElasticPrincipalCurve(X = tree_data, NumNodes = 40, InitNodes = 2, drawAccuracyComplexity = FALSE, drawPCAView = FALSE, drawEnergy = FALSE, verbose = FALSE, nReps = 50, ProbPoint = .8) PlotPG(X = tree_data, TargetPG = PG[[length(PG)]], BootPG = PG[1:(length(PG)-1)]) ```

Albluca/ElPiGraph.R documentation built on June 10, 2018, 5:22 p.m.