## List

Below are the research projects that I have been associated with during my graduate studies.

Psychometrics
Bayesian Sequential Modeling

## List

The following are courses and associated works that I have taken, taught, or been apart of during my graduate studies at the University of Illinois.

Layout: Soon (TM).

## Understanding Formula Response's Sampling Technique

So, you've made the decision to have students create a formula and have it automatically checked? That shouldn't be much of a problem. I mean, we have LON-CAPA and its hooks into Maxima, a computer algebra system (CAS).  So, this shouldn't really be much of a challenge. In fact, this code right here will serve you just fine! Scout's honor!

Problem Context:
Let a and b denote the sample mean of observations from N and M, respectively. Let sx and sy denotes the sample variance of observations from N and M, respectively. Define the test statistic in terms of a, b, sx and sy.

Note: Don't include "n" or "m" in your answer. Use sqrt() to denote the square root. For example, use "sqrt(x)" to denote $\sqrt{x}$ instead of "x^(0.5)", the system may have problem in identifying decimals in this formula response.

1 2 3 4 <formularesponse answer="(a-b)/(sqrt((sx*15+12*sy)/27*(1/16+1/13)))" id="12"> <responseparam name="tol" type="tolerance" default="1%" description="Numerical Tolerance" /> <textline readonly="no" size="25" /> </formularesponse>

And then the student e-mails pile in... And then the professor e-mails... And then... And then... And then... The day becomes a b-budget horror movie as confusion and desperation sets in to fix the problem.

The issue?

Why isn't (a-b)/(sqrt((sx*15+12*sy)/27)*sqrt(1/16+1/13))) working?

Five... Hours... Later... Why gods of LON-CAPA!? Why?! (I may have slightly exaggerated the amount of time that elapsed, but rest assured that was how long it felt.)

To quote one of my favorite characters on the "Eureka" moment:
Holmes: Well my dear Watson, the reason is very elementary you see...
Watson: No, I do not see! That is why I am turning to you for an explanation of how these seemingly implausible events are linked.

My guess as to the reason why LON-CAPA rejected it:
LON-CAPA does NOT simplify expressions before evaluating them. Note, that in the denominator there is one square root in the answer. In the answer giving students trouble, there were two square roots. I believe that the domains of the square roots did not align creating a discontinuity between the two.

The solution: Control the values being inserted into the expression.
By default, formula response checks the formula against an internal range based on the strings detected. Using the sampling technique, we are able to control the range of values used. To enable the sampling technique, simply add:

1 samples="a,b,sx,sy@4,1,1,1"

to the formularesponse tag declaration.

What's happening here though?
To the left of the @ we are defining the variables used in the expression: a,b,sx,sy.
To the right of the @ we have points that are mapped by their position relative to the variables. That is: a=4,b=1,sx=1,sy=1

But, that is a silly way to test equality since a student may randomly guess a number that is equivalent to the expression evaluated at the given location thanks to the tolerance option.

A better way is to use:

1 samples="a,b,sx,sy@4,1,1,1:8,5,3,9#3"

Let's breakdown what is occurring:
We are again defining the variables to be checked to the LEFT of the @ sign.

On the RIGHT of the @ sign, we still declare points that variables should take. However, we encounter a colon (:) followed by more numbers and then a # and another number.

The colon (:) signifies the region problem should look for points. The region start area is defined to the left of the colon and the end bounds for the region are defined on the right. So, we have the following inequalities:
$4 \le a \le 8$ , $1 \le b \le 5$ , $1 \le sx \le 3$ , and $1 \le sy \le 9$ .

The # indicates how many points should be picked at random from that region to test the equation with. In this case, we are testing three points in the region since we have #3.

Therefore, the corrected piece of code is:

1 2 3 4 <startouttext /> With Sampling Modification <endouttext /> <formularesponse answer="(a-b)/(sqrt((sx*15+12*sy)/27*(1/16+1/13)))" samples="a,b,sx,sy@4,1,1,1:8,5,3,9#3" id="13"> <textline readonly="no" size="25" /> </formularesponse>

However, sometimes even sampling ranges of points do not allow the correct response to be tested. For example, say you wanted a student to factor an equation. You probably only want the factored form. Though, using the region bounded approach described above on an expression without any removable discontinuities will yield a correct answer to a factoring question with the original expression! To avoid such an outcome, mathresponse must be used with the following modifications:

1 2 3 4 5 6 7 8 9 10 <script type="loncapa/perl"> $fun = "(x^3 - 3*x^2 + 3*x - 9)/(x^4 - 81)";$answer = &cas("maxima","factor(ratsimp($fun));"); </script> <mathresponse cas="maxima" answerdisplay="$answer" args="\$answer"> <answer> is(RESPONSE[1]=LONCAPALIST[1]); </answer> <textline readonly="no" size="40" /> </mathresponse>

This method tests for direct equivalence to the students answer.

## The Trace of the Kronecker Product

One of the coolest ideas I've come across recently relates to the way patterns form in matrices. Moreover, the way we can induce a pattern in a matrix. Enter the Kronecker Product, the way pattern-based matrix multiplication occurs.

Definition: Kroncker product uses matrix $A$ as an $m \times n$ matrix and matrix $B$ as a $p \times q$ matrix so that the Kronecker product $A \otimes B$ is the $mp \times nq$ block matrix:

$\mathbf{A}\otimes\mathbf{B} = \begin{bmatrix} a_{11} \mathbf{B} & \cdots & a_{1n}\mathbf{B} \\ \vdots & \ddots & \vdots \\ a_{m1} \mathbf{B} & \cdots & a_{mn} \mathbf{B} \end{bmatrix}$

Substituting in $B$ 's values then yields:

${\mathbf{A}\otimes\mathbf{B}} = \begin{bmatrix} a_{11} b_{11} & a_{11} b_{12} & \cdots & a_{11} b_{1q} & \cdots & \cdots & a_{1n} b_{11} & a_{1n} b_{12} & \cdots & a_{1n} b_{1q} \\ a_{11} b_{21} & a_{11} b_{22} & \cdots & a_{11} b_{2q} & \cdots & \cdots & a_{1n} b_{21} & a_{1n} b_{22} & \cdots & a_{1n} b_{2q} \\ \vdots & \vdots & \ddots & \vdots & & & \vdots & \vdots & \ddots & \vdots \\ a_{11} b_{p1} & a_{11} b_{p2} & \cdots & a_{11} b_{pq} & \cdots & \cdots & a_{1n} b_{p1} & a_{1n} b_{p2} & \cdots & a_{1n} b_{pq} \\ \vdots & \vdots & & \vdots & \ddots & & \vdots & \vdots & & \vdots \\ \vdots & \vdots & & \vdots & & \ddots & \vdots & \vdots & & \vdots \\ a_{m1} b_{11} & a_{m1} b_{12} & \cdots & a_{m1} b_{1q} & \cdots & \cdots & a_{mn} b_{11} & a_{mn} b_{12} & \cdots & a_{mn} b_{1q} \\ a_{m1} b_{21} & a_{m1} b_{22} & \cdots & a_{m1} b_{2q} & \cdots & \cdots & a_{mn} b_{21} & a_{mn} b_{22} & \cdots & a_{mn} b_{2q} \\ \vdots & \vdots & \ddots & \vdots & & & \vdots & \vdots & \ddots & \vdots \\ a_{m1} b_{p1} & a_{m1} b_{p2} & \cdots & a_{m1} b_{pq} & \cdots & \cdots & a_{mn} b_{p1} & a_{mn} b_{p2} & \cdots & a_{mn} b_{pq} \end{bmatrix}$

Within both of these forms, we are able to see a distinct placement of matrices within another matrix.

### Theory to More Theory

Prove that $\mathrm{tr}\left( {A \otimes B} \right) = \mathrm{tr}\left( A \right)\mathrm{tr}\left( B \right)$

In our case, we are particularly interested in the diagonal of two square matrices joined by the Kronecker product. Why? Well, the trace of a square $n \times n$ matrix is defined to be the sum of the elements on the main diagonal, which runs from the upper left corner of the matrix to the lower right corner of the matrix. Mathematically, we have:

$\mathrm{tr}(A) = a_{11} + a_{22} + \dots + a_{nn}=\sum\limits_{i=1}^{n} {a_{ii}}$

Returning back to our previous line of discussion regarding the Kronecker product, we'll amend the matrices presented in the definition slightly so that matrix $A$ now has square dimensions of $a \times a$ and matrix $B$ now has square dimensions of $b \times b$ . Thus, we will have a Kronecker product in the following form:
${\bf{A}} \otimes {\bf{B}} = \left[ {\begin{array}{*{20}{c}}{{a_{11}}{\bf{B}}}& \cdots &{{a_{1a}}{\bf{B}}}\\ \vdots & \ddots & \vdots \\{{a_{a1}}{\bf{B}}}& \cdots &{{a_{aa}}{\bf{B}}}\end{array}} \right]$
The dimensions of this matrix are now $\left( {ab} \right) \times \left( {ab} \right)$ .
Thus, from non-expand Kronecker product form, we can see that sum of the main diagonal will be: $\sum\limits_{i = 1}^a {{a_{ii}}B}$
So, taking the trace of $A \otimes B$ gives $\mathrm{tr}\left( {A \otimes B} \right) = \sum\limits_{i = 1}^a {\left( {{a_{ii}}\sum\limits_{j = 1}^b {{b_{jj}}} } \right)}$ .
Note: The trace is also being applied to $B$ .
Therefore, we get: $\mathrm{tr}\left( {A \otimes B} \right) = \sum\limits_{i = 1}^a {\left( {{a_{ii}}\sum\limits_{j = 1}^b {{b_{jj}}} } \right)} = \sum\limits_{i = 1}^a {\left( {{a_{ii}}\mathrm{tr}\left( B \right)} \right)} = \mathrm{tr}\left( B \right)\sum\limits_{i = 1}^a {\left( {{a_{ii}}} \right)} = \mathrm{tr}\left( B \right)\mathrm{tr}\left( A \right) = \mathrm{tr}\left( A \right)tr\left( B \right)$

## MSOS

Project Title: Multivariate Statistics - Old School (MSOS)
Project URL: http://cran.r-project.org/web/packages/msos/index.html
Project Version: 1.0.1
Project Status: Active
Project Description: MSOS is an R package that provides the functionality of R functions and data sets used in John Marden's Multivariate Statistics Old School textbook. Furthermore, the package provides detailed documentation of the functions and datasets within R as well as a slew of examples.

## Did you know? UIUC Edition

The University of Illinois at Urbana-Champaign, effectively referred to hereinafter as UIUC, is starting up again. The freshman parents are saying there goodbyes, the freshman are feeling a new sense of freedom, and UIUC's hidden gems are dying. Isn't that a bit harsh? The gems are dying? No. Characterizing the university's gems as dying is not harsh at all. Infact, the passing of time causes knowledge to change and potentially be relearned at a later point if the knowledge is not transcribed. Therefore, I give to UIUC my knowledge of the hidden gems in a hope to prevent these gems from being disappearing.

1. Touring Altgeld Bell Tower is available every Monday through Friday from 12:30 p.m. to 1 p.m.
2. Tours of the National Center for Supercomputing Applications (NCSA) are available on request for the center's:
3. View late night movies at the Art Theatre located in Downtown Champaign.
4. Relax at one of the local parks run by Urbana Park DistrictChampaign Park District, or UIUC.
5. Eclectic shops are located in Lincoln Square Mall, which resides in Downtown Urbana.
6. Fresh Food is everywhere. Really, what else would you expect going to school in the middle of corn fields...
• Farmer's Markets:
 MARKET LOCATION DATES/TIME Champaign-Urbana Public Health Department Farmers Market 201 W. Kenyon Rd., Champaign, IL TuesdaysJune 6 - October 1 1:00 - 5:30 p.m. Prairie Fruits Farm and Creamery 4410 N. Lincoln Ave., Champaign, IL WednesdaysMid-June - Mid-August 4:00 - 6:00 p.m. Sustainable Student Farm Illini Union on the Quad ThursdaysThrough Mid-Fall Semester 11:00 a.m. - 5:00 p.m. Urbana's Market at the Square Corner of Illinois & Vine Streets in Downtown Urbana SaturdaysMay 5 - November 3 7:00 a.m. - Noon Prosperity Gardens 302 North First Street, Champaign, IL Summer MonthsTBA Local Food Coop 300 S. Broadway Suite 166 Urbana, IL 61801 Monday - SundayYear Round 8:00 a.m. - 8:00 p.m.
• University of Illinois Meat Science Lab
• Specialities: Any kind of meat you can imagine and crates of eggs for a very good price from butchers in training.
• Open: Tuesday and Thursday from 1:00 p.m. - 5:30 p.m. and Friday from 8:00 a.m. - 1:00 p.m.
• Location: 1503 South Maryland Avenue, Urbana, Illinois 61801
• Strawberry Fields
7. The Bike Project - "bike'r'us"
8. Bevier Cafe - "the poor man's lunch"
• The College of Agricultural Consumer and Environmental Sciences (ACES) trains world-class culinary students using the cafe as a restaurant setting.
• Open: Monday through Friday from 8:00 a.m. - 2:30 p.m.
• Location: Room 260, 905 S. Goodwin Ave., Urbana, IL 61801
9. Allerton Park and Recreation Center - "the best escape from campus"
10. Krannert Center for Performing Art
11. The University of Illinois Parking Department makes the following lots available after 5 PM each weekday and allows campus visitors to park in these lots over the weekend for free:
12. University Calendar
• Look up events happening all over the university.
• Download event schedules to iCal or Outlook.
13. Gas prices for the ever commuting college student
14. To be continued...

As time permits, I may add more to this list...

This article has contributions from: AJ C., John B., and Megan P.

## Visualize

Project Title: Visualize
Project URLhttp://cran.r-project.org/web/packages/visualize/
Project Version: 4.2
Project Status: Active
Project Description: Visualize is an R package meant to graph probability distributions according to user supplied parameters. The package provides support for all standard distributions included in R. Furthermore, when working with discrete distributions, the user is able to specify whether the inequality is strict or not. The package has been confirmed to being in use at the University of Illinois at Urbana-Champaign and at the University of Amsterdam.

The package supports graphing the following distributions:

 Discrete Continuous Binomial Negative Binomial Poisson Geometric Hypergeometric Uniform Beta Normal Student's t Gamma Exponential Chisquare Log Normal Logistic Cauchy

Screenshots:

Sample Code:

#Install if needed #install.packages("visualize") library(visualize) par(mfrow=c(2,2)) #Continuous Distribution Sample visualize.norm(stat=c(-1,1),mu=0,sd=1,section="bounded") visualize.t(stat=c(-1,1),df=25,section="tails") visualize.f(stat=1.5,df1=5,df2=4,section="lower") visualize.cauchy(stat = 2, location = 1, scale = 2, section="upper") #Discrete Distribution Sample visualize.binom(stat = 3, size=20, prob=.3, section="lower") visualize.pois(stat = 3, lambda=3.5, section="upper",strict=TRUE) visualize.hyper(stat = c(2,5), m = 10, n = 7, k = 5, section="bounded",strict=c(FALSE,TRUE)) visualize.nbinom(stat = c(4,7), size = 2, prob = 0.35, section = "tails", strict=c(FALSE,FALSE))

Live Action Demo:

## Proof on Intersections of Subsets

Obligatory going back to college Set Theory for the Soul...

#### Prompt:

Given $f:X \to Y$ and two subsets $A,B \subseteq X$ , prove that $f\left( {A \cap B} \right) \subseteq f\left( A \right) \cap f\left( B \right)$ .

#### The Given:

If we break down our given information into diagrams, the result that we are being asked to prove becomes clearer.

To begin, we first must note that we are told that $f$ is a function that maps $X$ - the domain - to $Y$ - the codomain or image. Therefore, we have:

Furthermore, we are told that within $X$ we have two subsets: $A, B$ . We represent these subsets visually as:

#### The Request:

The request is the statement that we are being asked to prove is true or not true.

In our case, the statement under consideration is: $f\left( {A \cap B} \right) \subseteq f\left( A \right) \cap f\left( B \right)$ .

Examining $f\left( {A \cap B} \right)$ we note:

• The intersection of the subsets that is contained within $X$ .
• The points in the intersection should be mapped to $Y$ through $f$ .

Thus, we expect to see:

Now for $f\left( A \right) \cap f\left( B \right)$ :

If we take just $f\left( A \right)$ we would get:

Similarly, with $f\left( B \right)$ we would get:

Combining them yields:

Notice that we still have an overlap?

#### Detailed Proof:

At the top, we loosely defined function within the given section. Before we continue, we need to have a firm meaning of a function:

Function
A function, $f$ , is a relation from a set $X$ to a set $Y$ such that every $x$ in $X$ is uniquely associated with an object $f(x)$ in $Y$ giving a coordinate pair of $\left\langle {x,y} \right\rangle$ .In addition, if coordinates $\left\langle {x,y} \right\rangle$ and $\left\langle {x,z} \right\rangle$ share the same spot in the domain, $x$ , then they must share the same spot in the codomain or image. Thus, $y = z$ .

1. Let $y \in f\left( {A \cap B} \right)$ .
• Here we are picking an element at random that is within the codomain of $f$ given a domain of ${A \cap B}$ .
2. Then, as a result of $f$ being defined as a function, $\exists x \in A \cap B$ such that $y = f\left( x \right)$
• If we pick a point in the intersection of the subsets, then there exists a point in the image that the point in the intersection is mapped to.
3. With $x \in A$ and $y = f\left( x \right)$ , then $y \in f\left( A \right)$
• We are using two facts:
1. Since $x$ is in the intersection of $A$ and $B$ , $x$ must also exist in the set of $A$ by definition of intersection.
2. $f$ maps the point $x$ to $f\left( x\right)$ , which was discussed above.

From these two facts we are able to say that element $y$ exists in $f\left( x\right)$ .

• Similarly, $x \in B$ and $y = f\left( x \right)$ , yields $y \in f\left( B \right)$ .
• Reasoning follows from above point.
• Therefore, $y \subseteq f\left( A \right) \cap f\left( B \right)$ .
• We are now able to conclude that because $y$ exists in both images, that upon intersecting the images, $y$ exist in the intersection of sets.
• Since we chose an $x$ at random, where $x \in A \cap B$ , and we have shown that $\exists y = f\left( x \right) \in f\left(A\right) \cap f\left(B\right) , f\left(A \cap B\right)$ .We have $f\left(A \cap B\right) \subseteq {f\left(A \right) \cap f\left(B\right)}$ .

• We are switching now from an element selected to an actual subset here. Specifically:
• $y$ is an element taken at random from a subset that met the intersection criteria.Because $y$ is a single element at random, we are able to equate the element to its own subset (i.e. ${y} \subseteq {A \cap B}$ ).However, that subset is constantly shifting to all the different elements that meet the initial criteria.

Thus, it really is not a subset with just one element but a subset containing all the elements of the above set.

#### Proof:

Let $y \in f\left( {A \cap B} \right)$ .

Then, as a result of $f$ 's definition, $\exists x \in A \cap B$ such that $y = f\left( x \right)$

With $x \in A$ and $y = f\left( x \right)$ , then $y \in f\left( A \right)$

Similar reasoning, $x \in B$ and $y = f\left( x \right)$ , yields $y \in f\left( B \right)$ .

Therefore, $y \subseteq f\left( A \right) \cap f\left( B \right)$ .

Hence, $f\left( {A \cap B} \right) \subseteq f\left( A \right) \cap f\left( B \right)$ .