Gaussian Matrix? - linear-algebra

Does a "Gaussian Matrix" refer to a matrix that has undergone gaussian elimination to become an upper triangular matrix (the U in lu factorization), or instead to the elimination matrix that multiplies a matrix to make it upper triangular via elimination steps?

To be honest, I never heard of a Gaussian matrix in the context of Gaussian/Gauss-Jordan elimination. Rather, the matrices were referred to directly by their property. For example - as you mentioned - upper triangular matrix. The term does not pop up on Wikipedia article either. Even in this thesis the term only arises for realizations of Gaussian random variables organized to a matrix; no direct relation to the elimination procedure.
However, I know Gaussian matrices from a very different context. Namely, as the Gram matrix when a Gaussian kernel is applied. This seems to be somewhat backed by WolframAlpha.

Related

How to modify the RFGLS_estimate_spatial command to account for spatio temporal dependance

Good morning,
I'm working on some spatio temporal data concerning PM 2.5.
I want to apply a version of random forest which explicitly accounts for spatial dependence in the observations, as introduced in "Random Forest for spatially dependent data" https://www.tandfonline.com/doi/abs/10.1080/01621459.2021.1950003#:~:text=Spatial%20linear%20mixed%2Dmodels%2C%20consisting,the%20covariate%20effect%20is%20nonlinear.
Here is the R package: https://www.google.com/url?sa=t&source=web&rct=j&url=https://cran.r-project.org/web/packages/RandomForestsGLS/vignettes/RandomForestsGLS_user_guide.pdf&ved=2ahUKEwjF6JiRhf73AhUQyxoKHbkBB-8QFnoECAUQAQ&usg=AOvVaw31g4t0m-Uoz1Wy-2ysDvla
The point is that I want to account for spatio temporal dependence, not just spatial dependence.
Theoretically if I could provide in input to the function the estimation of the spatio temporal covariance matrix Q (which will be a NT x NT matrix) then the fitting could run as in the original version of the alghoritm.
I have no idea about how to modify the function RFGLS_estimate to be able to provide in input the covariance matrix Q to be used to grow the trees.
Any suggestion?
Thank you very much in advance
You are correct that conceptually the RFGLS method can work with any input covariance (or inverse covariance matrix Q). However, currently the RandomForestsGLS R-package can only model certain classes of spatial or temporal dependence families but not spatio-temporal dependence. This is because certain spatial covariances (like the Nearest Neighbor Gaussian Process) and temporal covariances (like autoregressive model) yield sparse inverse covariance matrices that help considerably speed up the RFGLS algorithm. We are currently working on an extension that allows use of an user-specified covariance model.

Migration Matrix in a Two-Dimensional Torus-Like Space: create a migration matrix in R

I'm working on a standard problem in random walk in two dimension.
In particular, I'm trying to generate a migration matrix for a toroidal model (Toroidal Transition Matrix) in R.
I have previously posted the same problem here: Transition matrix for a two-dimensional random walk in a torus: compute matrix in R
However, I did not get any feedback.
Similarly to what I mentioned in that post, I decided to assume independent movement along each dimension. Therefore, instead of calculating a Toroidal migration matrix and retrieve transition probabilities, I have multiplied independent probabilities from two separate 'one-dimensional circular model'.
I'm not sure whether this is formally correct and I would like to have some opinion on this regard.
Yes, to walk within the torus with each dimension being independent you do just multiply the transition probabilities. If there are n states in your circular graph, then there would be n^2 states in your torus and so you should expect a n^2 x n^2 transition matrix.
To give any more detail you'll have to specify exactly what you need to know.

how does R choose eigenvectors?

When given a matrix with repeated eigenvalues, but non-defective, how does the R function eigen choose a basis for the eigenspace? Eg if I call eigen on the identity matrix, it gives me the standard basis. How did it choose that basis over any other orthonormal basis?
Still not a full answer, but digging a little deeper: the source code of eigen shows that for real, symmetric matrices it calls .Internal(La_rs(x, only.values))
The La_rs function is found here, and going through the code shows that it calls the LAPACK function dsyevr
The dsyevr function is documented here:
DSYEVR first reduces the matrix A to tridiagonal form T with a call
to DSYTRD. Then, whenever possible, DSYEVR calls DSTEMR to compute
the eigenspectrum using Relatively Robust Representations. DSTEMR
computes eigenvalues by the dqds algorithm, while orthogonal
eigenvectors are computed from various "good" L D L^T representations
(also known as Relatively Robust Representations).
The comments provide this link that gives more expository detail:
The next task is to compute an eigenvector for $\lambda - s$. For each $\hat{\lambda}$ the algorithm computes, with care, an optimal twisted factorization
...
obtained by implementing triangular factorization both from top down and bottom up and joining them at a well chosen index r ...
[emphasis added]. The emphasized words suggest that there are some devils in the details; if you want to go further down the rabbit hole, it looks like the internal dlarrv function is where the eigenvectors actually get calculated ...
For more details, see DSTEMR's documentation and:
Inderjit S. Dhillon and Beresford N. Parlett: "Multiple representations
to compute orthogonal eigenvectors of symmetric tridiagonal matrices,"
Linear Algebra and its Applications, 387(1), pp. 1-28, August 2004.
Inderjit Dhillon and Beresford Parlett: "Orthogonal Eigenvectors and
Relative Gaps," SIAM Journal on Matrix Analysis and Applications, Vol. 25, 2004. Also LAPACK Working Note 154.
Inderjit Dhillon: "A new O(n^2) algorithm for the symmetric
tridiagonal eigenvalue/eigenvector problem",
Computer Science Division Technical Report No. UCB/CSD-97-971,
UC Berkeley, May 1997.
It probably uses some algorithm written in FORTRAN a long time ago.
I suspect there is a procedure which is performed on the matrix to adjust it into a form from which eigenvalues and eigenvectors can be easily determined. I also suspect that this procedure won't need to do anything to an identity matrix to get it into the required form and so the eigenvalues and eigenvectors are just read off immediately.
In the general case of degenerate eigenvalues the answers you get will depend on the details of this algorithm. I doubt there is any choice being made - it's just whatever it spits out first.

BLAS/LAPACK routine for doing Gaussian elimination

I'm a new user of BLAS/Lapack, and I'm just wondering is there a routine which does Gaussian elimination or even Gaussian-Jordan elimination? I googled and looked at their documentations, but still couldn't find them.
Thanks a lot for helping me out!
Gaussian elimination is basically the same as LU factorization. The routine xGETRF computes the LU factorization (e.g., DGETRF for real double precision matrices). The U factor corresponds to the matrix after Gaussian elimination. The U factor is stored in the upper triangular part (including the diagonal) of the matrix A on exit.
LU factorization / Gaussian elimination is commonly used to solve linear systems of equations. You can use the xGETRS routine to solve a linear system once you have computed the LU factorization.

R : multidimensional scaling

I have several questions:
1. What's the difference between isoMDS and cmdscale?
2. May I use asymmetric matrix?
3. Is there any way to determine optimal number of dimensions (in result)?
One of the MDS methods is distance scaling and it is divided in metric and non-metric. Another one is the classical scaling (also called distance geometry by those in bioinformatics). Classical scaling can be carried out in R by using the command cmdscale. Kruskal's method of nonmetric distance scaling (using the stress function and isotonic regression) can be carried out by using the command isoMDS in library MASS.
The standard treatment of classical scaling yields an eigendecomposition problem and as such is the same as PCA if the goal is dimensionality reduction. The distance scaling methods, on the other hand, use iterative procedures to arrive at a solution.
If you refer to the distance structure, I guess you should pass a structure of the class dist which is an object with distance information. Or a (symmetric) matrix of distances, or an object which can be coerced to such a matrix using as.matrix(). (As I read in the help, only the lower triangle of the matrix is used, the rest is ignored).
(for classical scaling method): One way of determining the dimensionality of the resulting configuration is to look at the eigenvalues of the doubly centered symmetric matrix B (= HAH). The usual strategy is to plot the ordered eigenvalues (or some function of them) against dimension and then identify a dimension at which the eigenvalues become “stable” (i.e., do not change perceptively). At that dimension, we may observe an “elbow” that shows where stability occurs (for points of a n-dimensional space, stability in the plot should occur at dimension n+1). For easier graphical interpretation of a classical scaling solution, we usually choose n to be small, of the order 2 or 3.

Resources