matlib: Matrix Functions for Teaching and Learning Linear Algebra and Multivariate Statistics.
Source:R/matlib-package.R
matlib-package.Rd
These functions are designed mainly for tutorial purposes in teaching & learning matrix algebra ideas and applications to statistical methods using R.
Details
In some cases, functions are provided for concepts available
elsewhere in R, but where the function call or name is not obvious. In other
cases, functions are provided to show or demonstrate an algorithm, sometimes
providing a verbose
argument to print the details of computations.
In addition, a collection of functions are provided for drawing vector diagrams in 2D and 3D.
These are not meant for production uses. Other methods are more efficient for larger problems.
Topics
The functions in this package are grouped under the following topics
Convenience functions:
tr
,R
,J
,len
,vec
,Proj
,mpower
,vandermode
Determinants: functions for calculating determinants by cofactor expansion
minor
,cofactor
,rowMinors
,rowCofactors
Elementary row operations: functions for solving linear equations "manually" by the steps used in row echelon form and Gaussian elimination
rowadd
,rowmult
,rowswap
Linear equations: functions to illustrate linear equations of the form $A x = b$
showEqn
,plotEqn
Gaussian elimination: functions for illustrating Gaussian elimination for solving systems of linear equations of the form $A x = b$.
gaussianElimination
,Inverse
,inv
,echelon
,Ginv
,LU
,cholesky
,swp
Eigenvalues: functions to illustrate the algorithms for calculating eigenvalues and eigenvectors
eigen
,SVD
,powerMethod
,showEig
Vector diagrams: functions for drawing vector diagrams in 2D and 3D
arrows3d
,corner
,arc
,pointOnLine
,vectors
,vectors3d
,regvec3d
Most of these ideas and implementations arose in courses and books by the authors. [Psychology 6140](http://friendly.apps01.yorku.ca/psy6140/) was a starting point. Fox (1984) introduced illustrations of vector geometry.
macOS Installation Note
The functions that draw 3D graphs use the rgl package. On macOS, the rgl package requires that XQuartz be installed. After installing XQuartz, it's necessary either to log out of and back into your macOS account or to reboot your Mac.
References
Fox, J. Linear Statistical Models and Related Methods. John Wiley and Sons, 1984
Fox, J. and Friendly, M. (2016). "Visualizing Simultaneous Linear Equations, Geometric Vectors, and Least-Squares Regression with the matlib Package for R". useR Conference, Stanford, CA, June 27 - June 30, 2016.