-
Notifications
You must be signed in to change notification settings - Fork 0
/
Simulation_D30.R
87 lines (58 loc) · 2.16 KB
/
Simulation_D30.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
### This is the Main Function and contains a simulation case
### Also CHECK THE TIME REQUIRED FOR THE MODEL
rm(list = ls())
#################################### SIMULATED DATA PROPERTIES ####################################################
## Number of points
N.test = 100
N.train = 100
## Number of Clusters
F = 2
## Distribution of the points within three clusters
p.dist = c(0.5,0.5)
## Total Number of features D
D = 20
## Total Percentage of irrelevant feature
prob.noise.feature = 0.2
## Overlap between Cluster of molecular Data of the relevant features
prob.overlap = 0.01
###### Get the Data #####################################
## Initialize the Training Data
source('simulate.R')
simulate()
####### Assign training and testing data ###############
Y <- Y.dat
Y.new <- Y.new.dat
############################# PARAMETERS for GIBB's SAMPLING ####
iter = 100
iter.burnin = 100
iter.thin = 5
k = F
Nps = iter.burnin/iter.thin
######################### Initialize the Parameters ##############################
source('initialize.R')
initialize()
##################### OPTIONAL COMPARISON WITH KNOWN METHODS ######################
######### BASIC METHODS + SOME ADVANCED METHODS ############################################
source('TRAINComparisonx.R')
TRAINComparison()
########### Train the Model #########################################
source('burninDPMM.R')
burninDPMM()
source('gibbsDPMM.R')
gibbsDPMM()
########## Analyze the fit ##########################################
### Good feature selection from heatmap plus cindex plus randindex
source('MCMCanalyze.R')
MCMCanalyze()
######## Predict on New Data Set BASED ON JUST THE MOLECULAR DATA #####################################
source('predictCLASS.R')
predictCLASS(Y.new)
## Check the predicted Rand Index
source('predictTIME.R')
predictchineseAFTtime(Y.new)
### Check of the Predicted C-index
predicted.cindex <- survConcordance(Surv(exp(time.new),censoring.new) ~ exp(-post.time.avg))[1]
##################### OPTIONAL COMPARISON WITH KNOWN METHODS ######################
######### BASIC METHODS + SOME ADVANCED METHODS ############################################
source('TESTCOMPARISON.R')
TESTCOMPARISON()