%\VignetteIndexEntry{etp}
% JSS Article Template
\documentclass{article}


%%% Additional Packages %%%

% Algorithms
% http://tex.stackexchange.com/questions/229355/algorithm-algorithmic-algorithmicx-algorithm2e-algpseudocode-confused
\usepackage{algorithm}% http://ctan.org/pkg/algorithms
\usepackage{algpseudocode}% http://ctan.org/pkg/algorithmicx


% Font stuff
\usepackage[T1]{fontenc}% for correct hyphenation and T1 encoding
%\usepackage{lmodern}% latin modern font
\usepackage[american]{babel}% for American English

% Math fonts/symbols
\usepackage{amsmath}% sophisticated mathematical formulas with amstex (includes \text{})
\usepackage{mathtools}% fix amsmath deficiencies
\usepackage{amssymb}% sophisticated mathematical symbols with amstex
\usepackage{amstext}% ams mathematical fonts
\usepackage{amsfonts}% ams mathematical fonts

% Figures
\usepackage{graphicx}% for including figures

%%% Commands %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% vetors
\newcommand{\ve}[1]{\mathbf{#1}}           % for vetors
\newcommand{\sv}[1]{\boldsymbol{#1}}   % for greek letters
\newcommand{\m}[1]{\mathbf{#1}}               % for matrices
\newcommand{\sm}[1]{\boldsymbol{#1}}   % for greek letters
\newcommand{\tr}[1]{{#1}^{\mkern-1.5mu\mathsf{T}}}              % for transpose
\newcommand{\norm}[1]{||{#1}||}              % for transpose
\newcommand*{\mve}{\operatorname{ve}}
\newcommand*{\trace}{\operatorname{trace}}
\newcommand*{\rank}{\operatorname{rank}}
\newcommand*{\diag}{\operatorname{diag}}
\newcommand*{\vspan}{\operatorname{span}}
\newcommand*{\rowsp}{\operatorname{rowsp}}
\newcommand*{\colsp}{\operatorname{colsp}}
\newcommand*{\svd}{\operatorname{svd}}
\newcommand*{\edm}{\operatorname{edm}}  % euclidean distance matrix (D * D)


% statistical
\newcommand{\widebar}[1]{\overline{#1}}  

% 
% operators
\newcommand{\Had}{\circ}
\DeclareMathOperator*{\lmin}{Minimize}
\DeclareMathOperator*{\argmin}{arg\,min}
\DeclareMathOperator*{\argmax}{arg\,max}
\DeclareMathOperator*{\arginf}{arg\,inf}
\DeclareMathOperator*{\argsup}{arg\,sup}
%\newcommand*{\arginf}{\operatorname*{arginf}}
%\newcommand*{\argsup}{\operatorname*{argsup}}

% Sets
\newcommand*{\intersect}{\cap}
\newcommand*{\union}{\cup}
\let\oldemptyset\emptyset
\let\emptyset\varnothing

% Fields, Reals, etc. etc
\newcommand{\field}[1]{\mathbb{#1}}
\newcommand{\Reals}{\field{R}}
\newcommand{\Integers}{\field{Z}}
\newcommand{\Naturals}{\field{N}}
\newcommand{\Complex}{\field{C}}
\newcommand{\Rationals}{\field{Q}}

% Hyphenation
\hyphenation{Ar-chi-me-dean}

% Editorial
\newcommand*{\TODO}[1]{\textcolor{red}{TODO: #1}}
\newcommand*{\NOTE}[1]{\textcolor{blue}{Note: #1}}
\newtheorem{theorem}{Theorem}
\newtheorem{Proof}{Proof}

\usepackage[total={6.5in,8.75in}, top=0.9in, left=0.7in, right=0.7in, includefoot]{geometry}


% Misc
%\makeatletter
%\newcommand\myisodate{\number\year-\ifcase\month\or 01\or 02\or 03\or 04\or 05\or 06\or 07\or 08\or 09\or 10\or 11\or 12\fi-\ifcase\day\or 01\or 02\or 03\or 04\or 05\or 06\or 07\or 08\or 09\or 10\or 11\or 12\or 13\or 14\or 15\or 16\or 17\or 18\or 19\or 20\or 21\or 22\or 23\or 24\or 25\or 26\or 27\or 28\or 29\or 30\or 31\fi}% create iso date
\makeatother
%\newcommand*{\abstractnoindent}{}% define abstract such that it has no indent
%\let\abstractnoindent\abstract
%\renewcommand*{\abstract}{\let\quotation\quote\let\endquotation\endquote
%  \abstractnoindent}
%\deffootnote[1em]{1em}{1em}{\textsuperscript{\thefootnotemark}}% setting for footnote

\author{Adam Rahman}
\title{The Educational Testing Problem}


%% need no \usepackage{Sweave.sty}

\begin{document}
\SweaveOpts{concordance=FALSE}

\maketitle

The educational testing problem arises in measuring the reliability of a student's total score in an examination consisting of a number of sub-tests\cite{fletcher1981nonlinear}. In terms of formulation as an optimization problem, the problem is to determine how much can be subtracted from the diagonal of a given symmetric positive definite matrix $\m{S}$ such that the resulting matrix remains positive semidefinite\cite{chu1995educational}. The lower bound of the reliability coefficient for the student's test scores is the optimal value of the objective function.

The Educational Testing Problem (ETP) is formulated as the following dual problem

\[
\begin{array}{rl}
\underset{\ve{d}}{\text{maximize}} & \tr{\ve{1}}\ve{d} \\
\text{subject to} & \\
& \begin{array}{rl}
\m{A} - diag(\ve{d}) &\succeq~~ \ve{0} \\
\ve{d} &\geq~~ \ve{0}
\end{array}
\end{array}
\]

\noindent where $\ve{d} = [d_{1},~d_{2},...,~d_{n}]$ is a vector of size $n$ and $diag(\ve{d})$ denotes the corresponding $n \times n$ diagonal matrix. In the second constraint, having each element in $\ve{d}$ be greater than or equal to 0 is equivalent to having $diag(\ve{d}) \succeq 0$. 

The corresponding primal problem is

\[
\begin{array}{rl}
\underset{\m{X}}{\text{minimize}} & tr(\m{A}\m{X}) \\
\text{subject to} & \\
& \begin{array}{rl}
diag(\m{X}) &\geq~~ \ve{1} \\
\m{X} &\succeq~~ 0
\end{array}
\end{array}
\]

The function \verb!etp! takes as input an $n \times n$ positive definite matrix \verb!A!, and returns the solution to the educational testing problem using \verb!sqlp!.

\begin{verbatim}
R> out <- etp(A)
\end{verbatim}

\section*{Numerical Example}

Consider the following positive definite matrix, stored in \verb!sdpt3r! as \verb!Betp!

\[
\left[
\begin{array}{ccccc}
1.000 & 0.299 & 0.931 & 0.550 & 0.282 \\
0.299 & 1.000 & -0.152 & 0.389 & 0.689 \\
0.931 & -0.152 & 1.000 & 0.624 & 0.386 \\
0.550 & 0.389 & 0.624 & 1.000 & 0.588 \\
0.282 & 0.689 & 0.386 & 0.588 & 1.000 \\
\end{array} \right]
\]

Solving this problem using \verb!sqlp!, we have

\begin{verbatim}
R> data(Betp)

R> out <- etp(Betp)
R> blk <- out$blk
R> At <- out$At
R> C <- out$C
R> b <- out$b

R> out <- sqlp(blk,At,C,b)
\end{verbatim}

The lower bound of the reliability coefficient for the educational testing problem is stored as the solution to the dual objective function, and the amount that can be subtracted from each diagonal element of the original matrix is tored in the output vector \verb!y!.

\begin{verbatim}
R> out$dobj

[1] -0.3353011

R> out$y

            [,1]
[1,] -0.06640282
[2,] -0.06686908
[3,] -0.06677325
[4,] -0.06787994
[5,] -0.06737597
\end{verbatim}

\bibliographystyle{plain}
\bibliography{sdpt3r}
\end{document}