rm(list=ls())
setwd("~/Dropbox/JournalSubmission/0Stats20230228/rcode/empanalysis/")
library(corpcor)
library(optimx)
library(numDeriv)
<-function (x.tre, call = match.call()) {
newick2phylog<- function(x.tre) {
complete if (length(x.tre) > 1) {
<- ""
w for (i in 1:length(x.tre)) w <- paste(w, x.tre[i],
sep = "")
<- w
x.tre
}<- nchar(gsub("[^)]", "", x.tre))
ndroite <- nchar(gsub("[^(]", "", x.tre))
ngauche if (ndroite != ngauche)
stop(paste(ngauche, "( versus", ndroite, ")"))
if (regexpr(";", x.tre) == -1)
stop("';' not found")
<- 0
i <- 0
kint <- 0
kext <- FALSE
arret if (regexpr("\\[", x.tre) != -1) {
<- gsub("\\[[^\\[]*\\]", "", x.tre)
x.tre
}<- gsub(" ", "", x.tre)
x.tre while (!arret) {
<- i + 1
i if (substr(x.tre, i, i) == ";")
<- TRUE
arret if (substr(x.tre, i, i + 1) == "(,") {
<- kext + 1
kext <- paste("Ext", kext, sep = "")
add <- paste(substring(x.tre, 1, i), add, substring(x.tre,
x.tre + 1), sep = "")
i <- i + 1
i
}else if (substr(x.tre, i, i + 1) == ",,") {
<- kext + 1
kext <- paste("Ext", kext, sep = "")
add <- paste(substring(x.tre, 1, i), add, substring(x.tre,
x.tre + 1), sep = "")
i <- i + 1
i
}else if (substr(x.tre, i, i + 1) == ",)") {
<- kext + 1
kext <- paste("Ext", kext, sep = "")
add <- paste(substring(x.tre, 1, i), add, substring(x.tre,
x.tre + 1), sep = "")
i <- i + 1
i
}else if (substr(x.tre, i, i + 1) == "(:") {
<- kext + 1
kext <- paste("Ext", kext, sep = "")
add <- paste(substring(x.tre, 1, i), add, substring(x.tre,
x.tre + 1), sep = "")
i <- i + 1
i
}else if (substr(x.tre, i, i + 1) == ",:") {
<- kext + 1
kext <- paste("Ext", kext, sep = "")
add <- paste(substring(x.tre, 1, i), add, substring(x.tre,
x.tre + 1), sep = "")
i <- i + 1
i
}else if (substr(x.tre, i, i + 1) == "),") {
<- kint + 1
kint <- paste("I", kint, sep = "")
add <- paste(substring(x.tre, 1, i), add, substring(x.tre,
x.tre + 1), sep = "")
i <- i + 1
i
}else if (substr(x.tre, i, i + 1) == "))") {
<- kint + 1
kint <- paste("I", kint, sep = "")
add <- paste(substring(x.tre, 1, i), add, substring(x.tre,
x.tre + 1), sep = "")
i <- i + 1
i
}else if (substr(x.tre, i, i + 1) == "):") {
<- kint + 1
kint <- paste("I", kint, sep = "")
add <- paste(substring(x.tre, 1, i), add, substring(x.tre,
x.tre + 1), sep = "")
i <- i + 1
i
}else if (substr(x.tre, i, i + 1) == ");") {
<- "Root"
add <- paste(substring(x.tre, 1, i), add, substring(x.tre,
x.tre + 1), sep = "")
i <- i + 1
i
}
}<- strsplit(x.tre, "[(),;]")[[1]]
lab.points <- lab.points[lab.points != ""]
lab.points <- (regexpr(":", lab.points) == -1)
no.long if (all(no.long)) {
<- paste(lab.points, ":", c(rep("1", length(no.long) -
lab.points 1), "0.0"), sep = "")
}else if (no.long[length(no.long)]) {
length(lab.points)] <- paste(lab.points[length(lab.points)],
lab.points[":0.0", sep = "")
}else if (any(no.long)) {
stop("Non convenient ancdes.ancdes.array leaves or nodes with and without length")
}<- strsplit(x.tre, "[(),;]")[[1]]
w <- w[w != ""]
w <- make.names(w, unique = TRUE)
leurre <- gsub("[.]", "_", leurre)
leurre for (i in 1:length(w)) {
<- paste(w[i])
old <- sub(old, leurre[i], x.tre, fixed = TRUE)
x.tre
}<- strsplit(lab.points, ":")
w <- function(x) {
label <- x[1]
lab <- gsub("[.]", "_", lab)
lab return(lab)
}<- function(x) {
longueur <- x[2]
long return(long)
}<- unlist(lapply(w, label))
labels <- unlist(lapply(w, longueur))
longueurs <- make.names(labels, TRUE)
labels <- gsub("[.]", "_", labels)
labels <- labels
w for (i in 1:length(w)) {
<- w[i]
new <- sub(leurre[i], new, x.tre)
x.tre
}<- rep("", length(w))
cat for (i in 1:length(w)) {
<- w[i]
new if (regexpr(paste("\\)", new, sep = ""), x.tre) !=
-1)
<- "int"
cat[i] else if (regexpr(paste(",", new, sep = ""), x.tre) !=
-1)
<- "ext"
cat[i] else if (regexpr(paste("\\(", new, sep = ""), x.tre) !=
-1)
<- "ext"
cat[i] else cat[i] <- "unknown"
}return(list(tre = x.tre, noms = labels, poi = as.numeric(longueurs),
cat = cat))
}<- complete(x.tre)
res <- res$poi
poi <- res$noms
nam names(poi) <- nam
<- res$cat
cat <- list(tre = res$tre)
res $leaves <- poi[cat == "ext"]
resnames(res$leaves) <- nam[cat == "ext"]
$nodes <- poi[cat == "int"]
resnames(res$nodes) <- nam[cat == "int"]
<- list()
listclass <- c(names(res$leaves), names(res$nodes))
dnext <- as.list(dnext)
listpath names(listpath) <- dnext
<- res$tre
x.tre while (regexpr("[(]", x.tre) != -1) {
<- regexpr("\\([^\\(\\)]*\\)", x.tre)
a <- a[1] + 1
n1 <- n1 - 3 + attr(a, "match.length")
n2 <- substring(x.tre, n1, n2)
chasans <- paste("\\(", chasans, "\\)", sep = "")
chaavec <- unlist(strsplit(chasans, ","))
nam <- strsplit(x.tre, chaavec)[[1]][2]
w1 <- unlist(strsplit(w1, "[,\\);]"))[1]
parent <- nam
listclass[[parent]] <- gsub(chaavec, "", x.tre)
x.tre <- which(unlist(lapply(listpath, function(x) any(x[1] ==
w2
nam))))for (i in w2) {
<- c(parent, listpath[[i]])
listpath[[i]]
}
}$parts <- listclass
res$paths <- listpath
res<- c(res$leaves, res$nodes)
dnext names(dnext) <- c(names(res$leaves), names(res$nodes))
$droot <- unlist(lapply(res$paths, function(x) sum(dnext[x])))
res$call <- call
resclass(res) <- "phylog"
#if (!add.tools)
return(res)
#return(newick2phylog.addtools(res))
}
<-function(n,r){
combreturn(factorial(n)/(factorial(n-r)*factorial(r)))
}
<-function(tmp){ # return pair for "tmp" sequences.
pair_fcn=comb(length(tmp),2)
numl=0
count<-array(0,c(numl))
positfor(i in 1:length(tmp)){
for(j in 1:length(tmp)){
if(i<j){
=count+1
count=paste(c(tmp[i]),c(tmp[j]),sep=",")
posit[count]
}
}
} return(posit)
# end of pair_fcn.
}
<-function(tmp){#generate pair in array format.
pair_array<-pair_fcn(tmp)
pair <-matrix(c(0),nrow=length(pair),ncol=2)
p_arrfor(i in 1:length(pair)){
1]=unlist(strsplit(pair[i],","))[1]
p_arr[i,2]=unlist(strsplit(pair[i],","))[2]
p_arr[i,
}return(p_arr)
# end of function pair_array.
}
<-function(res,tipnames){ #this function gets the acenstor-descendants relationship.
ord_fcn<-matrix(rev(res$nde),ncol=1)
bmtp<-rev((res$parts))
rvpt <-array(0,c(length(rvpt),2))
reptfor(i in 1:length(rvpt)){
=unlist(rvpt[i])
rept[i,]
} <-cbind(bmtp,rept)
cmb<-res$droot[(length(tipnames)+1):length(res$droot)]
brnlen<-matrix(cmb[1,],nrow=1)
root<-cmb[-1,]
cmb<-brnlen[1:(length(brnlen)-1)]
brnlen<-order(brnlen,decreasing=TRUE)
new_ord<-cmb[new_ord,]
cmb<-rbind(root,cmb)
cmbreturn(cmb)
# end of function ord_fcn.
}
<-function(res){# this function gets rid of unnecessarily "_" symbol.
getntn<-length(res$parts)
size<-array(0,c(size,3))
relarr<-(res$parts)
rvpt <-array(0,c(length(rvpt),2))
reptfor(i in 1:length(rvpt)){
=unlist(rvpt[i])
rept[i,]
}for(i in 1:size){
1]<-names(res$parts)[i]
relarr[i,
}2:3]<-rept
relarr[,<-matrix(0,row<-size)
temp
for(j in 2:3){
for (i in 1: size){
<-unlist(strsplit(relarr[,j][i], "_" ))
stmp<-stmp[1]
temp[i]
}<-temp
relarr[,j]
}
<- res$droot[!(res$droot==max(res$droot))]
ndlen<-names(ndlen)
nam<-array(0,c(length(nam)))
ck1<-0
countfor (ele in c(nam)){
<-count+1
count<- length( unlist(strsplit(ele ,"_" )))
len if( len==2 ){ck1[count]<-1}
}<-ndlen[!ck1]
ndlen<-order(ndlen)
new_ord<-relarr[new_ord,]
relarr
return(relarr)
# end of function getntn.
}
<-function(res){#this function is used to obtain branch length.
getbrnlen<- res$droot[!(res$droot==1)]
ndlen
<-names(ndlen)
nam
<-array(0,c(length(nam)))
ck1<-0
countfor (ele in c(nam)){
<-count+1
count<- length( unlist(strsplit(ele ,"_" )))
len if( len==2 ){ck1[count]<-1}
}<-ndlen[!ck1]
ndlen
<-sort(ndlen)
ndlen<-array(0,c(length(ndlen)))
ck2for(i in 1:(length(ndlen)-1)){
if(abs(ndlen[i]-ndlen[i+1])<10^(-5)){ck2[i]=1}
}
<-ndlen[!ck2]
ndlen
<-array(0,c(length(ndlen)))
brnlen<-ndlen
tmplen
for(i in 1:(length(brnlen)-1)){
<-tmplen[i+1]-tmplen[i]
brnlen[i]
}length(brnlen)] <- 1 -tmplen[(length(tmplen))]
brnlen[return(brnlen)
# end of function getbrnlen.
}
<-function(x,branchlength=branchlength,ancdes.array=ancdes.array,nleaves=nleaves,tipnames=tipnames,model.Index=model.Index){ #now it is a function of bt, h, sigma^2 and sigma_H^2
cov_mtx<-x[1]
bt<-x[2]
h<-x[3]
sigma_sq<-x[4]
sigma.H_sq
# bt<-1
<-0.5
h# sigma_sq<-0.68
# sigma.H_sq<-0.68
if(model.Index==1){bt<-1}
if(model.Index==2){sigma.H_sq<-0}
if(model.Index==3){bt<-1;sigma.H_sq<-0}
<-function(ist,sqc){#finds position to insert between two parents, for hybrdization only.
ins_fcn<-as.numeric(unlist(strsplit(ist,"X"))[2])
ist<-array(0,c(length(otmp)))
arrfor(i in 1:length(arr)){
<-as.numeric(unlist(strsplit(sqc[i],"X"))[2])
arr[i]
}<-which(arr==(ist-1))+1
inspreturn(insp)
}<-function(){#return the variance.
var_fcnfor(i in 1:length(otmp)){#use to fill other diagonal.
<-which(rownames(mtx)%in%otmp[i])
newi<-which(rownames(omtx)%in%otmp[i])
oldi<-omtx[oldi,oldi]
mtx[newi,newi]#fill in old value from omtx exclude the new hyd.
}
<-tmp[which(tmp%in%ins)-1]#grab elements.
prn1<-tmp[which(tmp%in%ins)+1]
prn2<-which(rownames(omtx) %in% prn1)#grab position according to prn1.
prn1<-which(rownames(omtx) %in% prn2)
prn2
<- bt^2*h^2*omtx[prn1,prn1]+bt^2*(1-h)^2*omtx[prn2,prn2]+2*bt^2*h*(1-h)*omtx[prn1,prn2]
vhii
<-which(!(tmp %in% otmp))#use to insert variance for hyd.
hii<-vhii #fill in the diagonal hyd.
mtx[hii,hii]return(mtx)
#formula for insertion hyd variance.
}
<-function(){#fill matrix due to sepciation.
fillspcmtx<-function(){ #use to cut one row of the pair array which the speciation happens.
elm<-c(tmp[nsi],tmp[nsj])
ckfor(i in 1:dim(pn_arr)[1]){
if(sum(pn_arr[i,]==ck)==2){break}
}return(i)}
<-pair_array(tmp)
pn_arr<-pair_array(otmp)
po_arr
#search new speciate position.
<-which(!(tmp %in% otmp))[1]
nsi<-which(!(tmp %in% otmp))[2]
nsj<-which(!(otmp %in% tmp))
osii<- omtx[osii,osii]
mtx[nsi,nsj]#Fill in value: the covariance for 2 speciated species equal the variance of the parent.
<-pn_arr[-elm(),]#delete the ancdes.array that is already used.
pn_arr
#The following fills covaraince components by the previous matrix.
while(length(pn_arr[,1])>0){
<-which(rownames(mtx) %in% pn_arr[1,1])
newi<-which(rownames(mtx) %in% pn_arr[1,2])
newj
if( tmp[nsi] %in% pn_arr[1,]){
<-which(!(pn_arr[1,] %in% tmp[nsi]))
otg<- which( rownames(omtx) %in% otmp[osii])
oldi<-which(rownames(omtx) %in% pn_arr[1,otg])
oldj
}
if( tmp[nsj] %in% pn_arr[1,] ){
<-which(!(pn_arr[1,] %in% tmp[nsj]))
otg<- which( rownames(omtx) %in% otmp[osii])
oldi<-which(rownames(omtx) %in% pn_arr[1,otg])
oldj
}
if(!(tmp[nsi] %in% pn_arr[1,]) && !(tmp[nsj] %in% pn_arr[1,])){
#detect common between omtx and mtx.
<-which(rownames(omtx) %in% pn_arr[1,1])
oldi<-which(rownames(omtx) %in% pn_arr[1,2])
oldj
}<-omtx[oldi,oldj]
mtx[newi,newj]<-pn_arr[-1,]#delete row.
pn_arrif(length(pn_arr)==2){pn_arr<-matrix(pn_arr,nrow=1)}
#end of while loop.
}
<-mtx+t(mtx)
mtx
<-omtx[osii,osii]+ branchlength[length(tmp)-1]
mtx[nsi,nsi]<-omtx[osii,osii]+ branchlength[length(tmp)-1]
mtx[nsj,nsj]<-which(tmp %in% otmp )
dianew<-which(otmp %in% tmp )
diaoldfor(i in 1:length(dianew)){
<-omtx[diaold[i],diaold[i]]+branchlength[length(tmp)-1]
mtx[dianew[i],dianew[i]]
}return(mtx)
#end of fillspcmtx.
}
<-function(){#fill in value into matrix due to hybridzation.
fillhydmtx<-pair_array(tmp)
pn_arr
while(length(pn_arr[,1])>0){
<-which(rownames(mtx) %in% pn_arr[1,1])
newi<-which(rownames(mtx) %in% pn_arr[1,2])
newjif (ins %in% pn_arr[1,]){#ins is the hybridized node.
<-pn_arr[1,which(!(pn_arr[1,] %in% ins ))]
otg<-which(rownames(omtx) %in% otg)
otgj#the other guy, could be the hybrdized nodes parent or others.
#find the parent of ins.
<-tmp[which(tmp%in%ins)-1]#grab element.
prn1<-tmp[which(tmp%in%ins)+1]
prn2<-which(rownames(omtx) %in% prn1)#grab position.
prn1<-which(rownames(omtx) %in% prn2)
prn2
<-bt*h*omtx[prn1,otgj] +bt*(1-h)*omtx[prn2,otgj] # cov(X, bt*hX+bt*(1-h)Y) we are going to use h=1/2.
mtx[newi,newj]
else{#this is not hyd node, just read from previous mtx.
}#only need to read from rownames().
<-which(rownames(omtx) %in% pn_arr[1,1])
oldi<-which(rownames(omtx) %in% pn_arr[1,2])
oldj<-omtx[oldi,oldj]
mtx[newi,newj]#end of else loop .
}<-pn_arr[-1,] # delete ancdes.array array after using it.
pn_arrif(length(pn_arr)==2){pn_arr<-matrix(pn_arr,nrow=1)}
#end of while loop.
}return(mtx)
#end of fillhydmtx.
}
#THE MAIN PROGRAM for covariance matrix.
<-FALSE # use to check the hybrdized event.
ckins<-ancdes.array[,2:3]# the descedant nodes.
rept<-matrix((ancdes.array)[,1],ncol=1) #the acenstor node.
bmtp
<-2
loop=array(0,c(loop))
tmpif(loop==2){tmp=rept[1,]
<-tmp
otmp<-diag(branchlength[1],c(length(tmp)))
mtxrownames(mtx)<-c(tmp)
colnames(mtx)<-c(tmp)
<-mtx
omtx#end of loop==2
}while(loop<length(bmtp)){#loaded the acenstor-descendant ancdes.array.
<-loop+1#use loop to use the ancdes.array
loop=array(0,c(length(otmp)+1))#the new seq.
tmp<-matrix(0,nrow=length(tmp),ncol=length(tmp))
mtx=loop-1#index for matching the right element: will use below.
q<-which(otmp==bmtp[q])#index for insertion position.
opif(length(op)!=0){#op!=0 means that weve detected speciation.
:(op+1)]=rept[q,] #insertion the new speciation species.
tmp[op
if(op==1){tmp[(op+2):length(tmp)]=otmp[(op+1):(length(tmp)-1)]}
if((op+1)==length(tmp)){tmp[1:(op-1)]=otmp[1:(op-1)] }
if(op!=1 && (op+1)!=length(tmp)){
+2):length(tmp)]=otmp[(op+1):(length(tmp)-1)]
tmp[(op1:(op-1)]=otmp[1:(op-1)]}
tmp[
rownames(mtx)<-c(tmp)
colnames(mtx)<-c(tmp)
<- fillspcmtx()
mtx<-tmp
otmp<-mtx
omtx#above generate sequence and cov. matrix for speciation.
else{# op = 0 means that we have detected the hybridize event.
}<-(bmtp[q])#grab the insertion element, ins will be used in the fillhydmtx function.
ins<-ins_fcn(ins,otmp)#catch the position for insertion.
insp<-ins #insert the hyd element.
tmp[insp]+1):length(tmp)]=otmp[insp:(length(tmp)-1)]
tmp[(insp1:(insp-1)]=otmp[1:(insp-1)]
tmp[rownames(mtx)<-c(tmp)
colnames(mtx)<-c(tmp)
<-var_fcn()
diamtx<- fillhydmtx()
mtx<-mtx+t(mtx)+diamtx
mtx#fill in the diagonal elements.
<-tmp
otmp<-mtx
omtx#above generate the sequnce and fill in the value into matrix for hybrdization.
<-TRUE #since we did an insertion, the next step is to replace 3 elements.
ckins#end of the length(op)!=0 if-else.
}
if(ckins){#replace 3 elements in tmp sequence.
<-array(0,c(length(tmp)))
tmpwhich(otmp==ins)]<- rept[loop-1,1] # replaced with hyd element.
tmp[which(otmp == bmtp[loop])] = rept[loop,which(rept[loop,]!=ins)]
tmp[which(otmp == bmtp[loop+1])] = rept[loop+1,which(rept[loop+1,]!=ins)]
tmp[#replace 3 new nodes.
<-which(otmp==ins)
tx1<-which(otmp == bmtp[loop])
tx2<-which(otmp == bmtp[loop+1])
tx3for(i in 1:length(tmp)){
if (i != tx1 && i!=tx2 && i!=tx3){
=otmp[i]
tmp[i]
}
}
<-tmp
otmprownames(mtx)<-c(tmp)
colnames(mtx)<-c(tmp)
<-mtx+diag(branchlength[length(tmp)-1],c(length(tmp)) )
mtx
<-mtx
omtx<-FALSE
ckins<-loop+2
loop#end of replace 3 elements
}#end of while loop
}
if(sum(tipnames%in%tmp)!=nleaves){#catches the last speciation event.
<-tipnames
tmp<-matrix(0,nrow=length(tmp),ncol=length(tmp))
mtxrownames(mtx)<-c(tmp)
colnames(mtx)<-c(tmp)
<-fillspcmtx()
mtx#end of if (sum(tipnames%in%tmp)!=nleaves).
}
<-mtx*sigma_sq
mtx
<-hybrid.node(ancdes.array,nleaves) #extra burst for hybrid
hybrid.Indexfor(i in hybrid.Index){
<-mtx[i,i]+sigma.H_sq
mtx[i,i]
}
if(model.Index==1){rm(bt)}
if(model.Index==2){rm(sigma.H_sq)}
if(model.Index==3){rm(bt);rm(sigma.H_sq)}
return(mtx)
#end of cov_mtx
}
<-function(ancdes.array,nleaves){
hybrid.node<-c()
hyd.sigma_hfor (i in 1:dim(ancdes.array)[1]){
if(ancdes.array[i,2]==ancdes.array[i,3]){
<-as.numeric(unlist(strsplit(ancdes.array[i,2],"X"))[2])
hyd.idxif ( hyd.idx<=nleaves){
<-c(hyd.sigma_h,hyd.idx )}else{
hyd.sigma_h
<-which(ancdes.array[,1]==ancdes.array[i,2])
hyd.speciation<-as.numeric(unlist(strsplit(ancdes.array[hyd.speciation,],"X")[2:3]))[c(2,4)]
candidate.hyd.desfor(hyd.des in candidate.hyd.des){
if(hyd.des<=nleaves){
<-c(hyd.sigma_h,hyd.des )}}
hyd.sigma_h
}
}
}return(hyd.sigma_h )
}
#sunflower 11 taxa (3 hybrids) Gross and Riesberg paper
<-c("(((1:17,2:17)21:17,(3:19,(((4:6,(5:6)13:0)12:5,(6:11)16:0)15:4,(7:15)19:0)18:4)22:15)26:6,(((19:0,(16:0,(13:0,8:6)14:5)17:4)20:5,9:20)23:6,(10:23,11:23) 24:3)25:14)27:0;")
x.tre
<-newick2phylog(x.tre)
res<-getntn(res)
ancdes.array<-getbrnlen(res)
branchlength<-branchlength[-length(branchlength)]
branchlength<-sort(names(res$droot[which(res$droot==max(res$droot))]))
tipnames<-length(tipnames)
nleaves<-nleaves
n<-2
model.Indexload("regsunflower.RData")
check for positive definiteness of Gtau
The script in question is designed to test whether the variance-covariance matrix for the network model \(G_\hat{\tau}\) is positive definite. This test is performed after the MLE estimate is given, and it is important to ensure this regularity condition is met, as it guarantees that the regression parameters are normally distributed. This, in turn, allows for maximum likelihood analysis to be performed.
The results of the script can be found at the bottom of the webpage, and they indicate that the positive definite property is satisfied for all 12 data sets used in this analysis.
check point.
To ensure the likelihood satisfies the regularity condition, it is necessary to check whether \(G_{\hat{\tau}}\) is positive definite. Please see the following
<-0.5
h<-1
sigma_sq<-0
sigma.H_sqfor(btIndex in 1:dim(MLE.array)[1]){
<-MLE.array[btIndex,1]
tau=c(tau,h,sigma_sq,sigma.H_sq)
x.mle<-cov_mtx(x=x.mle,branchlength=branchlength,ancdes.array=ancdes.array,nleaves=nleaves,tipnames=tipnames,model.Index=model.Index)
V_hatprint(paste("data", btIndex,". Is positve definite ?",sep=""))
print(is.positive.definite(V_hat, tol=1e-8))
}
[1] "data1. Is positve definite ?"
[1] TRUE
[1] "data2. Is positve definite ?"
[1] TRUE
[1] "data3. Is positve definite ?"
[1] TRUE
[1] "data4. Is positve definite ?"
[1] TRUE
[1] "data5. Is positve definite ?"
[1] TRUE
[1] "data6. Is positve definite ?"
[1] TRUE
[1] "data7. Is positve definite ?"
[1] TRUE
[1] "data8. Is positve definite ?"
[1] TRUE
[1] "data9. Is positve definite ?"
[1] TRUE
[1] "data10. Is positve definite ?"
[1] TRUE
[1] "data11. Is positve definite ?"
[1] TRUE
[1] "data12. Is positve definite ?"
[1] TRUE