Learn R Programming

treelet (version 0.3-0)

Run_JTree: The function computes the basis representation of the matrix at maxlev

Description

It is the main function of the treelet algorithm. calls three functions: Build_JTree,JTree_Basis

Usage

Run_JTree(X, maxlev, drawTree)

Arguments

X
data matrix (each row is an observation)
maxlev
default: dim-1 (levels L=0,1,2,...,maxlevel)
drawTree
draw the tree structure if we build the whole tree. Use "TRUE"

Value

  • basisBasis functions entered ROW-WISE --- coarse-to-fine where m is the dimension of the data
  • sumsPart of basis funcs of subspaces V1,...,V_{m-1}---- entered rowwise (fine-to-coarse)
  • difsBasis funcs of subspaces W1,...,W_{m-1}---- entered rowwise (fine-to-coarse)
  • Zpospositions of the two clusters merged; number between 1 and d (the length of the comp vector)
  • PCidxID of principal components; [1 2] or [2 1]
  • TElement in the list array contains a 2-by-2 rot matrix
  • all_nodesnode labels
  • Zindices of clusters that are merged
  • C_oldthe covariance matrix
  • cc_oldthe old correlation matrix
  • basis_covthe same as the basis_cov as returned by JTree_Basis

Examples

Run this code
#Generating the Sample Data
N=1000;
dim_x=10;
sigma_x=1;
set.seed(100);

s1_2=290;
s2_2=300;
c1=-0.3;
c2=0.925;
u1=sqrt(s1_2)*matrix(rnorm(N),ncol=1);
u2=sqrt(s2_2)*matrix(rnorm(N),ncol=1);
u3=c1*u1+c2*u2;
s3_2=c1^2*s1_2+c2^2*s2_2;
Xraw=cbind(u1,u1,u1,u1,u2,u2,u2,u2,u3,u3);
#Xraw=cbind(rep(u1,4),rep(u2,4),u3,u3);
X=Xraw+sigma_x*matrix(rnorm(N*dim_x),ncol=dim_x)

#Run_JTree, Give the full treelet decomposition
k=1;
maxlev=dim(X)[2]-k;
output=Run_JTree(X,maxlev);
# Display the output image
#library(matlab)
#imagesc(output$basis)
#Display the output in tree structure
#draw_tree(output)

Run the code above in your browser using DataLab