matlib
Matrix Functions for Teaching and Learning Linear Algebra and Multivariate Statistics
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (13.3%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
Matrix Functions for Teaching and Learning Linear Algebra and Multivariate Statistics
Basic Info
- Host: GitHub
- Owner: friendly
- Language: R
- Default Branch: master
- Homepage: http://friendly.github.io/matlib/
- Size: 43.4 MB
Statistics
- Stars: 68
- Watchers: 11
- Forks: 16
- Open Issues: 7
- Releases: 11
Topics
Metadata Files
README.md
matlib 
Matrix Functions for Teaching and Learning Linear Algebra and Multivariate Statistics, http://friendly.github.io/matlib/
Version 1.0.1
These functions were originally designed for tutorial purposes in teaching & learning matrix algebra
ideas using R. In some cases, functions are provided for concepts or computations available
elsewhere in R, but where the name is not obvious, e.g., R() for the rank of a matrix,
or tr() for matrix trace.
In other
cases, we provide cover functions to show or demonstrate an algorithm in more detail, sometimes
providing a verbose = argument to print the details of computations, e.g., Det() for a
matrix determinant, Inverse() for a matrix inverse, using gaussianElimination() to show the
steps.
In addition, a collection of functions are provided for drawing vector diagrams in 2D and 3D, illustrating various concepts of linear algebra more concretely than has been available before. For example,
showEqn(A, b)shows the matrix equations $\mathbf{A x} = \mathbf{b}$ in text or LaTeX form, whileplotEqn(A, b)andplotEqn3d(A, b)plots those equations in 2D or 3D space.matrix2latex(),latexMatrix(),Eqn()and friends facilitate writing matrix equations in LaTeX.vectors(),vectors3d()plot geometric vector diagrams in 2D or 3D, with other functions to draw angles and arcs.regvec3d()calculates and plot vectors representing a bivariate regression model,lm(y ~ x1 + x2)
Installation 📦
Get the released version from CRAN:
install.packages("matlib")
Or the development version from my R-universe:
install.packages('matlib', repos = c('https://friendly.r-universe.dev', 'https://cloud.r-project.org'))
The development version can also be installed to your R library directly from this repo via:
if (!require(remotes)) install.packages("remotes")
remotes::install_github("friendly/matlib", build_vignettes = TRUE)
The functions that draw 3D graphs use the rgl package. On macOS, rgl 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.
Topics 🍪
The functions in this package are grouped under the following topics
- Convenience functions:
tr()- trace of a matrixR()- rank of a matrixJ()- constant vector, matrix or arraylen()- Euclidean length of a vector or columns of a matrixvec()- vectorize a matrixProj(y, X)- projection of vector y on columns of matrix Xmpower(A, p)- matrix powers for a square symmetric matrixxprod(...)- vector cross-product
- Determinants: functions for calculating determinants by cofactor expansion
minor()- Minor of A[i,j]cofactor()- Cofactor of A[i,j]rowMinors()- Row minors of A[i,]rowCofactors()- Row cofactors of A[i,]Det()- Determinants by elimination or eigenvalues
- Elementary row operations: functions for solving linear equations "manually" by the steps used in row echelon form and Gaussian elimination
rowadd()- Add multiples of rows to other rowsrowmult()- Multiply rows by constantsrowswap()- Interchange two rows of a matrix
- Linear equations: functions to illustrate linear equations of the form $\mathbf{A x = b}$
showEqn(A, b)- show matrices (A, b) as linear equations, as text or in LaTeXplotEqn(A, b),plotEqn3d(A, b)- plot matrices (A, b) as linear equations
- Gaussian elimination: functions for illustrating Gaussian elimination for solving systems of linear equations of the form
$\mathbf{A x = b}$. These functions provide a
verbose=TRUEargument to show the intermediate steps and afractions=TRUEargument to show results usingMASS::fractions().
gaussianElimination(A, B)- reduces $(A, B)$ to $(I, A^{-1} B)$Inverse(X),inv()- usesgaussianEliminationto find the inverse of X, $\mathbf{X}^{-1}$echelon(X)- usesgaussianEliminationto find the reduced echelon form of XGinv(X)- usesgaussianEliminationto find the generalized inverse of XLU(X)- LU decomposition of a matrix Xcholesky(X)- calculates a Cholesky square root of a matrixswp()- matrix sweep operator
- Eigenvalues: functions to illustrate the algorithms for calculating eigenvalues and eigenvectors and related matrix decompositions and generalizations.
Eigen()- eigenvalues and eigenvectorsSVD()- singular value decomposition, \$mathbf{X = U D V}$powerMethod()- find the dominant eigenvector using the power methodshowEig()- draw eigenvectors on a 2D scatterplot with a dataEllipseMoorePenrose()- illustrates how the Moore-Penrose inverse can be calculated usingSVD()
- Vector diagrams: functions for drawing vector diagrams in 2D and 3D
arrows3d()- draw nice 3D arrowscorner(),arc()- draw a corner or arc showing the angle between two vectors in 2D/3DpointOnLine()- position of a point along a linevectors(),vectors3d()- plot geometric vector diagrams in 2D/3Dregvec3d()- calculate and plot vectors representing a bivariate regression model,lm(y ~ x1 + x2)in mean-deviation form.
- Matrix equations in LaTeX
matrix2latex(): Convert matrix to LaTeX equationlatexMatrix(): Create and manipulate LaTeX representations of matriceslatexMatrixOperations: Matrix operators (e.g.,%*%,%O%) and functions (matmult(),kronecker()) for matrix arithmetic, but rendered in LaTeXEqn(): A wrapper for equations composed fromlatexMatrix()expressions and LaTeX text, with ability to preview the results in a Viewer pane.
Vignettes and presentations
A small collection of vignettes is now available. Use browseVignettes("matlib") to explore them.
| Vignette | Title | |-------------------------------------------------------------------------------------------|----------------------------------------------- | | a1-det-ex1 | Properties of determinants | | a2-det-ex2 | Evaluation of determinants | | a3-inv-ex1 | Inverse of a matrix | | a4-inv-ex2 | Matrix inversion by elementary row operations | | a5-ginv | Generalized inverse | | a6-inv-3d | Linear transformations and matrix inverse in 3D | | a7-eigen-ex1 | Eigenvalues and Eigenvectors: Properties | | a8-eigen-ex2 | Eigenvalues: Spectral Decomposition | | a9-linear-equations | Solving Linear Equations | | aA-gramreg | Gram-Schmidt Orthogonalization and Regression | | aB-data-beta | Vector Spaces of Least Squares and Linear Equations | | latex-equations | LaTeX Equations with latexMatrix, Eqn and matrix2latex|
See also:
- Fox & Friendly, Visualizing Simultaneous Linear Equations, Geometric Vectors, and Least-Squares Regression with the matlib Package for R. June 2016, useR! Conference, Stanford.
Ivan Savov, Linear algebra explained in four pages
Michael Rodriguez & Andrew Zieffler Matrix Algebra for Educational Scientists. An online book describing matrix operations and their statistical applications, with R code for many examples.
Owner
- Name: Michael Friendly
- Login: friendly
- Kind: user
- Location: Toronto
- Company: York University
- Website: https://datavis.ca
- Twitter: datavisFriendly
- Repositories: 57
- Profile: https://github.com/friendly
GitHub Events
Total
- Issues event: 8
- Watch event: 2
- Issue comment event: 41
- Push event: 28
Last Year
- Issues event: 8
- Watch event: 2
- Issue comment event: 41
- Push event: 28
Committers
Last synced: 9 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Michael Friendly | f****y@y****a | 475 |
| philchalmers | r****s@g****m | 172 |
| John Fox | j****x@m****a | 129 |
| l-d-s | l@s****g | 1 |
| Jay Hesselberth | j****h@g****m | 1 |
| Duncan Murdoch | m****n@g****m | 1 |
| Douglas Whitaker | d****g@1****t | 1 |
| John Fox | J****x | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 9 months ago
All Time
- Total issues: 57
- Total pull requests: 14
- Average time to close issues: 4 months
- Average time to close pull requests: about 2 months
- Total issue authors: 17
- Total pull request authors: 6
- Average comments per issue: 9.16
- Average comments per pull request: 1.79
- Merged pull requests: 14
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 20
- Pull requests: 1
- Average time to close issues: 14 days
- Average time to close pull requests: about 19 hours
- Issue authors: 3
- Pull request authors: 1
- Average comments per issue: 16.95
- Average comments per pull request: 0.0
- Merged pull requests: 1
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- friendly (31)
- john-d-fox (6)
- philchalmers (5)
- JanaJarecki (2)
- silberc (1)
- rjrovetti (1)
- foyizzle (1)
- ggrothendieck (1)
- TengMCing (1)
- aoandrade (1)
- g-aruda (1)
- gejak2004 (1)
- dumbdrummer182 (1)
- jefferis (1)
- charlesjom (1)
Pull Request Authors
- friendly (6)
- philchalmers (4)
- jayhesselberth (2)
- l-d-s (1)
- douglaswhitaker (1)
- dmurdoch (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 2
-
Total downloads:
- cran 2,608 last-month
- Total docker downloads: 42,448
-
Total dependent packages: 12
(may contain duplicates) -
Total dependent repositories: 7
(may contain duplicates) - Total versions: 20
- Total maintainers: 1
cran.r-project.org: matlib
Matrix Functions for Teaching and Learning Linear Algebra and Multivariate Statistics
- Homepage: https://github.com/friendly/matlib
- Documentation: http://cran.r-project.org/web/packages/matlib/matlib.pdf
- License: GPL-2 | GPL-3 [expanded from: GPL (≥ 2)]
-
Latest release: 1.0.0
published over 1 year ago
Rankings
Maintainers (1)
conda-forge.org: r-matlib
- Homepage: https://github.com/friendly/matlib
- License: GPL-2.0-or-later
-
Latest release: 0.9.5
published over 4 years ago
Rankings
Dependencies
- MASS * imports
- car * imports
- methods * imports
- rgl * imports
- xtable * imports
- carData * suggests
- knitr * suggests
- markdown * suggests
- rglwidget * suggests
- rmarkdown * suggests
- webshot2 * suggests
- R >= 3.3.0 depends
- utils * imports
- knitr * suggests
- minidown * suggests
- rmarkdown * suggests
- tinytest * suggests
- MASS * imports
- car * imports
- methods * imports
- rgl * imports
- xtable * imports
- carData * suggests
- knitr * suggests
- rglwidget * suggests
- rmarkdown * suggests
- R >= 3.1 depends
- utils * imports
- R6 * suggests
- callr * suggests
- covr * suggests
- curl * suggests
- pingr * suggests
- processx >= 3.1.0 suggests
- rlang * suggests
- testthat * suggests
- tibble * suggests
- MASS * imports
- car * imports
- methods * imports
- rgl * imports
- xtable * imports
- carData * suggests
- knitr * suggests
- rglwidget * suggests
- rmarkdown * suggests
- R >= 3.4 depends
- utils * imports
- callr * suggests
- covr * suggests
- digest * suggests
- glue >= 1.6.0 suggests
- grDevices * suggests
- htmltools * suggests
- htmlwidgets * suggests
- knitr * suggests
- methods * suggests
- mockery * suggests
- processx * suggests
- ps >=1.3.4.9000 suggests
- rlang >= 1.0.2.9003 suggests
- rmarkdown * suggests
- rprojroot * suggests
- rstudioapi * suggests
- testthat * suggests
- tibble * suggests
- whoami * suggests
- withr * suggests
- R >= 3.4.0 depends
- R6 * imports
- ps >= 1.2.0 imports
- utils * imports
- callr >= 3.7.0 suggests
- cli >= 3.3.0 suggests
- codetools * suggests
- covr * suggests
- curl * suggests
- debugme * suggests
- parallel * suggests
- rlang >= 1.0.2 suggests
- testthat >= 3.0.0 suggests
- withr * suggests
- R >= 3.3 depends
- cli >= 3.4.0 imports
- glue * imports
- lifecycle >= 1.0.3 imports
- rlang >= 1.0.6 imports
- bit64 * suggests
- covr * suggests
- crayon * suggests
- dplyr >= 0.8.5 suggests
- generics * suggests
- knitr * suggests
- pillar >= 1.4.4 suggests
- pkgdown >= 2.0.1 suggests
- rmarkdown * suggests
- testthat >=3.0.0 suggests
- tibble >= 3.1.3 suggests
- waldo >= 0.2.0 suggests
- withr * suggests
- xml2 * suggests
- zeallot * suggests