-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcol2.Rnw
More file actions
119 lines (115 loc) · 6.25 KB
/
col2.Rnw
File metadata and controls
119 lines (115 loc) · 6.25 KB
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
% !Rnw root = main.Rnw
\begin{column}{.49\textwidth}
\begin{beamercolorbox}[center,wd=\textwidth]{postercolumn}
% tweaks the width, makes a new \textwidth
\begin{minipage}[T]{.98\textwidth}
\parbox[t][\topcolumn]{\textwidth}{
% must be some better way to set the the height,
% width and textwidth simultaneously
% Since all columns are the same length, it is all nice and tidy.
% You have to get the height empirically
% ---------------------------------------------------------%
% fill each column with content
\begin{block}{L-PLS and its variants (Exo-LPLS and Endo-LPLS)} % Visulazation block
\begin{columns}[b]
\begin{column}{0.35\textwidth}
\begin{figure}
\centering
\includegraphics[width = \textwidth]{figure/lpls}
\caption{Extension of PLS including some background information}
\label{fig:lpls}
\end{figure}
\end{column}
\begin{column}{0.63\textwidth}
\begin{itemize}
\item Partial Least Square can also be used in understanding the covariance structure and the relation between different matrices.
\item More information can give better insight in solving any problem. So, a background information on variation under study helps to model the complex dynamics of the real world phenomena.
\item L-shaped PLS (LPLS) helps in exploring covariance structure of three matrices.
\item LPLS with its variant Endo and Exo LPLS, enables to see the relationship between two matrices with no direct connection.
\end{itemize}
\end{column}
\end{columns}
<<heatMap, echo = FALSE, fig.keep='none', include=FALSE>>=
#Plot of personality-score matrix
X.sc <- scale(X)
X.sc <- X.sc[-c(125,287),] #Removing two students without personality score
Z.sc <- scale(Z)
hmap.x <- heatmap(X.sc, keep.dendro = T, na.rm = TRUE)
hmap.z <- heatmap(Z.sc, keep.dendro = T, na.rm = TRUE)
x.r <- hmap.x$rowInd; x.c <- hmap.x$colInd
z.r <- hmap.z$rowInd; z.c <- hmap.z$colInd
@
<<heatMapPrint, echo=FALSE, include=FALSE>>=
getMap <- function(X, row.idx = NULL, col.idx = NULL, filename = NULL, wth = 8, ht = 4, color = heat.colors(nrow(X)), n.stud = 588, side = 2) {
pdf(filename, width = wth, height = ht)
par(mar = c(10,2,1,2), family = 'Palatino')
row.idx <- if (is.null(row.idx)) TRUE else row.idx
col.idx <- if (is.null(col.idx)) TRUE else col.idx
image(t(X[row.idx, col.idx]),
axes = F, col.main = "black", cex.lab = 0.5,
col = color)
axis(1, at = seq(0, 1, length.out = dim(X)[2]),
labels = colnames(X)[col.idx],
las = 3, col.axis = "black")
mtext(paste(n.stud, 'number of Person'), side = side, line=1)
# ## Heatmap using ggplot2
# dataSet <- melt(X[row.idx, col.idx])
# dataSet$Var1 <- as.character(dataSet$Var1)
# print(ggplot(dataSet,
# aes_string(y = 'Var1',
# x = 'Var2')) +
# geom_tile(aes_string(fill = 'value')) +
# theme(axis.text.x = element_text(angle = 90, hjust = 1)) +
# scale_fill_gradient(low = 'yellow',
# high = 'red',
# space = 'Lab') +
# labs(x = '', y = '') +
# theme(axis.ticks.y = element_blank(),
# axis.text.y = element_blank(),
# legend.title = element_blank(),
# legend.position = 'none'))
dev.off()
}
getMap(X.sc, x.r, x.c, 'heatMapX.pdf', side = 4, n.stud = 288)
getMap(Z.sc, z.r, x.c, 'heatMapZ.pdf', side = 4, n.stud = 2200, ht = 6)
getMap(Y, rev(x.r), filename = 'heatMapY.pdf',
wth = 5, ht = 4, color = rainbow(7, start = 0.01, end = 0.3), n.stud = 288)
getMap(W, filename = 'heatMapW.pdf',
wth = 5, ht = 7, color = rainbow(7, start = 0.01, end = 0.3), n.stud = 5000)
@
\end{block}
\vfill
\begin{block}{U-shaped Partial Least Square Regression (UPLS)}
\begin{columns}[T, onlytextwidth]
\column{0.34\textwidth}
\begin{figure}[H]
\centering
\includegraphics[width = \textwidth]{figure/upls}
\caption{UPLS structure}
\label{fig:upls}
\end{figure}
\column{0.6\textwidth}
\begin{description}
\item[\textbf{Scenario}]\hfill\\
\begin{itemize}
\item Large amount of chaotic yet informative data streams, if organized, can give light on any research process
\item Integration of such easily available data source can supply background information to the variables under study and helps, not only to understand the causal relationship and covariance structure, but also to visualize them in understandable form and generate new hypothesis
\end{itemize}
\end{description}
\end{columns}
\vspace{1cm}
\begin{description}
\item[\textbf{What is UPLS}]\hfill\\
UPLS is an extension of LPLS that enable us to,
\begin{itemize}
\item include background information for predictor matrix \textbf{X} and response matrix \textbf{Y}
\item Foresee the relationship between two matrices that are from entirely different situations, i.e. the relation between \textbf{W} and \textbf{Z} through the eye of \textbf{X} and \textbf{Y} (Figure above)
\end{itemize}
\end{description}
\end{block}
}
% ---------------------------------------------------------%
% end the column
\end{minipage}
\end{beamercolorbox}
\end{column}