# A Brief On Tensor Analysis

The first two books treat a large amount of subjects in mathematics, including tensor calculus, geometry etc. The aim is to provide a bridge between mathematics and physics. In Munkres's book, you will find a nice exposition about tensor products of vector spaces, which is used in the study of multivariate integrals. Greub's book is a more abstract account on the subject (and, in my opinion, more advanced), but a very nice reference too. Maybe Winitzki's book is more appropriate for you, since the book is a linear algebra-type of book, so it has proofs for theorems and some nice tools for direct applications too. Roman's book also treats the case of tensor products of vector spaces.

## A Brief on Tensor Analysis

Diffusion tensor magnetic resonance imaging (DT-MRI) is a powerful quantitative technique with the ability to detect in vivo microscopic characteristics and abnormalities of brain tissue. It has been successfully applied to a number of neurological conditions, such as stroke, multiple sclerosis and brain tumors, providing information otherwise inaccessible on the pathological substrates. DT-MRI has also been used to study patients with cognitive decline, mainly those with Alzheimer's disease. Several image-analysis approaches have been employed, including region of interest, histogram, voxel-based analyses and DT-MRI-based tractography. Specific patterns of spatial distribution of tissue damage and correlations with neuropsychological measures have been reported. This review focuses on the use of DT-MRI to investigate dementias. The main clinical results and the different methods of image analysis will be overviewed and discussed.

The notion of a tensor captures three great ideas: equivariance, multilinearity, separability. But trying to be three things at once makes the notion difficult to understand. We will explain tensors in an accessible and elementary way through the lens of linear algebra and numerical linear algebra, elucidated with examples from computational and applied mathematics.

Our investigation of the preferred mode was guided by a three-part hypothesis. First, we hypothesized that empirical population responses may often have a clear preferred mode. Second, we hypothesized that the preferred mode likely differs between brain areas. To address these hypotheses, we assessed the preferred mode for three neural datasets recorded from primary visual cortex (V1) and four neural datasets recorded from M1. V1 datasets were strongly neuron-preferred, while M1 datasets were strongly condition-preferred. Third, we hypothesized that the preferred mode might be informative regarding the origin of population responses. We concentrated on models of M1, and found that existing models based on tuning for external variables were neuron-preferred, in opposition to the M1 data. However, existing models with strong internal dynamics were condition-preferred, in agreement with the data. Model success or failure depended not on parameter choice or fit quality, but on model class. We conclude that tensor structure is informative regarding the predominant origin of time-varying activity, and can be used to test specific hypotheses. In the present case, the tensor structure of M1 datasets is consistent with only a subset of existing models.

(a) Responses of four example neurons for a V1 dataset recorded via an implanted electrode array during presentation of movies of natural scenes. Each colored trace plots the trial-averaged firing rate for one condition (one of 25 movies). For visualization, traces are colored red to blue based on the firing rate early in the stimulus. (b) Responses of four example neurons for an M1 dataset recorded via two implanted electrode arrays during a delayed-reach task (monkey J). Example neurons were chosen to illustrate the variety of observed responses. Each colored trace plots the trial-averaged firing rate for one condition; i.e., one of 72 straight and curved reach trajectories. For visualization, traces are colored based on the firing rate during the delay period between target onset and the go cue. Insets show the reach trajectories (which are the same for each neuron) using the color-coding for that neuron. M1 responses were time-locked separately to the three key events: target onset, the go cue, and reach onset. For presentation, the resulting average traces were spliced together to create a continuous firing rate as a function of time. However, the analysis window included primarily movement-related activity. Gray boxes indicate the analysis windows (for V1, T = 91 time points spanning 910 ms; for M1, T = 71 time points spanning 710 ms). Horizontal bars: 200 ms; vertical bars: 20 spikes per second.

Neural population data is often analyzed in matrix form, allowing a number of standard analyses. Such analyses include assessing covariance structure and applying principal component analysis to extract the most prevalent response patterns [47]. One can then quantify, for a given number of extracted response patterns, how well they reconstruct the original data. This can provide a rough estimate of the number of degrees of freedom in the data [48].

To assess the preferred mode we reconstructed each population tensor twice: once using a fixed number (k) of basis-neurons, and once using the same fixed number (k) of basis-conditions. Reconstruction error was the normalized squared error between the reconstructed tensor and the original data tensor. If basis-neurons provided the better reconstruction, the neuron mode was considered preferred. If basis-conditions provided the better reconstruction, the condition mode was considered preferred. (We explain later the algorithm for choosing the number of basis elements k, and explore robustness with respect to that choice).

For the V1 dataset illustrated in Fig 1 the neuron mode was preferred; it provided the least reconstruction error (Fig 2C, left). In contrast, for the M1 dataset illustrated in Fig 1 the condition mode was preferred (Fig 2C, right). This analysis considered all time points in the shaded regions of Fig 1. Keeping in mind that reconstruction along either mode is expected to perform reasonably well (data points are rarely uncorrelated along any mode) the disparity between V1 and M1 is large: for V1 the basis-neuron reconstruction performed 33% better than the basis-condition reconstruction, while for M1 it performed 68% worse.

Reconstruction error is measured as a function of the number of times included in the population tensor. (a) Schematic of the method. A fixed number (three in this simple illustration) of basis-neurons (red) and basis-conditions (blue) is used to reconstruct the population tensor. This operation is repeated for different subsets of time (i.e., different sizes of the population tensor) three of which are illustrated. Longer green brackets indicate longer timespans. (b) The firing rate (black) of one example V1 neuron for one condition, and its reconstruction using basis-neurons (red) and basis-conditions (blue). Short red/blue traces show reconstructions when the population tensor included short timespans. Longer red/blue traces show reconstructions when the population tensor was expanded to include longer timespans. Dark red/blue traces show reconstructions when the population tensor included all times. For illustration, data are shown for one example neuron and condition, after the analysis was applied to a population tensor that included all neurons and conditions (same V1 dataset as in Figs 1A and 2C). The dashed box indicates the longest analyzed timespan. Responses of the example neuron for other conditions are shown in the background for context. Vertical bars: 10 spikes per second. (c) Plot of normalized reconstruction error (averaged across all neurons and conditions) for the V1 dataset analyzed in b. Red and blue traces respectively show reconstruction error when using 12 basis neurons and 12 basis conditions. The horizontal axis corresponds to the duration of the timespan being analyzed. Green arrows indicate timespans corresponding to the green brackets in b. Shaded regions show error bars (Methods). (d) As in b but illustrating the reconstruction error for one M1 neuron, drawn from the population analyzed in Figs 1B and 2C. (e) As in c but for the M1 dataset, using 25 basis neurons and 25 basis conditions. The right-most values in c and e plot the reconstruction error when all times are used, and thus correspond exactly to the bar plots in Fig 2C.

The emergence of the preferred mode was often readily apparent even when reconstructing single-neuron responses (note that the entire tensor was always reconstructed, but each neuron can nevertheless be viewed individually). Fig 3B shows the response of one V1 neuron for one condition (black trace) with reconstructions provided by the neuron basis (red) and condition basis (blue). Each of the (shortened) light red and light blue traces show reconstructions for a particular timespan (Ti). Dark red and dark blue traces show reconstructions for the full timespan (Ti = T). Unsurprisingly, for short timespans (short traces near the middle of the plot) the two reconstructions performed similarly: blue and red traces both approximated the black trace fairly well. However, for longer timespans the condition-mode reconstruction became inaccurate; the longest blue trace provides a poor approximation of the black trace. In contrast, the neuron-mode reconstruction remained accurate across the full range of times; short and long red traces overlap to the point of being indistinguishable. Thus, the reason why the V1 data were neuron-preferred (Fig 2C) is that the neuron basis, but not the condition basis, continued to provide good reconstructions across long timespans. 041b061a72