lazy.symbolic {lazy.symbolic} | R Documentation |
lazy.symbolic: Collection of some useful symbolic tools for lazy boys and girls
Description
Japanese help file: lazy.symbolic_JPH
Details
A "Semi symbolic matrix" means a matrix or vector whose elements are symbols
representing the matrix elements.
A "Fully symbolic matrix" means a matrix or vector whose elements are
symbols which must be treated as matrices.
A fully symbolic matrix has an attribute
fullsymb
whose value is TRUE.
See SymbolicOps for examples.
Symbolic Matrix Operations
-
Generation of Matrix or Matrix Expressions:
-
demomat: creation of demo matrix
-
gen_random_expr: generation of random expressions
-
Basic Matrix Operators:
See modify_math_operators for more natural operators. -
Plus or %p%: add matrices (+)
-
Minus or %m%: subtract matrices (-)
-
Times or %t%: elementwise multiplication of vectors and matrices (*)
-
matTimes or %T%: multiply matrices (%*%)
-
matKTimes or %@%: Kronecker product (%@%)
-
tp: transposition of a fully symbolic matrix (t)
-
modify_math_operators Modification of Mathematical Operators
This function modifies the native mathematical operators, shown in the parentheses above, so that they can handle symbolic objects. This (SymbolicOps) contains some examples of modified mathematical operators.
-
Matrix Inversion by Sweep Operator:
-
matSweep: inversion by Sweep operator
-
invGE: inversion by Gaussian elimination
-
Inv: inversion Sweep or Gaussian elimination
-
Determinant:
-
Det: determinant by the Sweep Operator
-
DetL: determinant by Laplace Expansion
-
Differentiation:
-
mD: differentiation of a scalar function with respect to a matrix
-
mD0: core function for differentiation
-
decompose_MatProd: decompose matrix product
-
simplify_power: simplification of matrix power
-
trace_reorder: cyclic shift of argument
-
gradma: numeric evaluation of analytic result
-
gradmn: numeric first derivative
-
Functions for Numerical Evaluation of Symbolic Expressions:
-
matReplace: replace a pattern with new pattern
-
Eval: evaluation of an expression with replacements
-
Simplification of Expressions:
-
Simplify: simplification of symbolic expression (very primitive!)
-
Expand: expand (distribute) expression
-
LaTeX functions:
-
to_latex Convert a string containing an expression to LaTeX.
-
print_tex_as_html Print the LaTeX expression as html in RStudio Viewer pane
-
Summation Operation Functions:
-
mat2sum: convert a full symbolic matrix expression to summation
-
sum2mat: convert a summation to full symbolic matrix expression
-
sum2mat0: convert a summation to full symbolic matrix expression (Regexpr Version to be deprecated.)
-
sumEval: evaluate summation created by mat2sum
-
sum2sum: convert summation to Sum
-
sumExpand: expand (distribute) summations
-
sumMoveOut: move summation to the left (Not Yet Available)
-
sumSimplify: simplify summation
-
sumMoveIn: move summation to the right
-
suminfo: analyze summation
-
sumDisplay: display the structure of summations
-
Kronecker Product Functions:
-
KP: Symbolic expression of the i-j element of the Kronecker product of A and B
-
tr2vecK: Conversion of the trace of the matrix product
-
vec2vecK: Conversion of the vec of the matrix product
-
Utility Functions:
-
loc_balpar: locations of the matching parentheses
-
locbalpar: find the location of the matching parenthesis
-
analyze_expr: decompose an expression into terms and factors
-
nterms: count the # of terms
-
find_terms: decompose an expression into additive terms
-
find_factors: decompose a term into multiplicative factors
-
find_varfunc: find the variables/functions in an expression
-
is_valid: check if the expression is valid or not
-
analyze_3d_val: analysis of ... and values
-
gmatch: Return the captured value for each group
Originally from Other Packages
-
from lazy.tools:
-
demomat: Set up a matrix whose elements consist of row and col numbers
-
Printm: print objects with their names and formats.
-
Printb: print super matrix (partitioned or block matrix) with separators.
-
analyze_three_dots: analyze three dots and return the names and the values
-
lv: return the last value: .Last.value
-
ceiling_n: Return the Ceiling and Power of the Input using Radix (Base) of n
-
Seq: Smart Sequence Generation
-
from lazy.mat:
-
b_diag: Makes a Block Diagonal Matrix from the Arguments.
-
Diag: Creats a diagonam matrix from its argument vector or matrix.
-
pmat: Generate a permutation matrix to switch row or column
-
Kmat: Generate a commutation matrix to convert vec(A) to vec(t(A)).
-
repmat: Stack a matrix n times either horizontally or vertically.
-
ssq: Returns the doubly weighted sum of squares of all the elements of A.
-
tr: trace of the input matrix. (modified in lazy.symbolic)
-
transp: Transpose each matrix contained in a list/array/syupermatrix.
-
vec: Vectorization of a matrix.
-
vecdiag: Returns diagonal elements of A as a vector.
-
vech: Vectorization of the lower or upper half of a square matrix.
-
vechindex: Returns the index to convert vech(Mat) to Mat and vice versa.
-
vechinv: Recover the Symmetric Matrix from its lower or upper half elements stored in a vector created by vech function.
-
vecindex: Returns the index to convert vec(Mat) to vec(t(Mat)) and vice versa.
-
supermat: Declare a supermatrix with SMdim attribute.
-
getSM: Extract a submatrix from a supermatrix.
-
modSM<-: Assign values to the submatrix of a supermatrix.
-
Mh2Mv: Convert a horizontally stacked supermatrix to a vertially stacked one.
-
Mv2Mh: Convert a vertically stacked supermatrix to a horizontally stacked one.
-
JacobianMat: numerical derivatives