Next: Introduction, Previous: (dir), Up: (dir) [Contents][Index]
This is the num-utils Reference Manual, version 0.0.2, generated automatically by Declt version 3.0 "Montgomery Scott" on Mon Dec 02 10:59:19 2019 GMT+0.
• Introduction | What num-utils is all about | |
• Systems | The systems documentation | |
• Files | The files documentation | |
• Packages | The packages documentation | |
• Definitions | The symbols documentation | |
• Indexes | Concepts, functions, variables and data types |
* Numerical Utilities Library, version 0.0.2 - =num==, a comparison operator for floats - simple arithmetic functions, like =sum= and =l2norm= - element-wise operations for arrays - intervals - special matrices and shorthand for their input - sample statistics - Chebyshev polynomials - quadratures - univariate root finding * Origin This library is a maintenance fork of [[https://github.com/tpapp/cl-num-utils][cl-num-utils]]. Changes include: 1. Make work with Genera 2. Convert to [[https://github.com/sionescu/fiveam][fiveam]] for unit tests ([[https://github.com/tgutu/clunit][clunit]] seems abandoned) 3. Restore quadrature tests 4. Fix SBCL compiler warnings Although the project has been renamed to distinguish it from the original, the package names are the same and should work as a drop-in replacement. * Status It appears that this library was in the midst of a reorganization when released. As near as I can tell from the [[https://github.com/tpapp/cl-num-utils/commit/a0f522b44b465fc071623f9662bdde0163be6467][github history]], all the files in cl-num-utils were moved to src/old/, and then selectively moved into src/ as they were cleaned up and unit tests written. Some, such as data-frame, were moved by Papp into separate projects. Several of the files in old/ could be dusted off and moved into src/ to be used. Check in data-frames project first because I think some were moved there without being removed from cl-num-utils. There was a fair amount of code commented out by the original author. Where we have commented code, we use the block comment syntax #| ... |#, and noted the person performing the removal. We have also added comments throughout the code to make it more readable, or to include our research notes. * Known Issues ** Test Failures [[https://github.com/Symbolics/num-utils/issues/1][Issue 1]] describes a problem with the wrapped-bivariate-to-array test in tests/matrix.lisp. This fails under fiveam, but passes on clunit. I believe there to be a bug, either in fiveam or num-utils (or, possibly, clunit). The [[https://common-lisp.net/project/fiveam/docs/api/macro_005FIT.BESE.FIVEAM_003A_003AIS.html][fiveam reason-arg]] is misleading, it will print the two values, and they are equal. However this only happens after the /second/ call. For example, given this code #+BEGIN_SRC lisp (is (num= (funcall op a b) (funcall op (funcall convert a) b));) "Expected ~A to be equal to ~A" (funcall op a b) (funcall op (funcall convert a) b)) #+END_SRC The sequence #+BEGIN_SRC lisp (funcall op a b) (funcall op (funcall convert a) b) #+END_SRC is called twice, once as part of the test and once as part of the reason-args output. The /first/ time, the results are different. The /second/ time they are the same, making it appear that the result is a false negative. It is not. This test needs to be looked into further. The test code will not win any 'most readable code of the year' award, and the answer is buried below several layers of macro expansions, funcalls and currying. Until this is resolved, use this function with caution. ** Implementation Support Development is primarily done with SBCL on MS Windows, with occasional testing on CCL. [[https://github.com/tpapp/cl-num-utils/issues/15][papp15]] reports that generic function definitions may not work on other implementations. Please report any such problems on the [[https://github.com/Symbolics/num-utils/issues][Github issue tracker]]. ** Symbol conflicts with alexandria Importing both =num-utils= and =alexandria= will result in symbol conflicts. There are two solutions for this: either import only parts of =num-utils= (see the packages named in each file), or shadow some symbols, e.g. #+BEGIN_SRC lisp (cl:defpackage #:my-package (:use #:cl #:alexandria #:num-utils) (:shadowing-import-from #:alexandria #:mean #:variance #:median)) #+END_SRC * Reporting Bugs and Contributing We welcom participants and contributors. When contributing to this repository, please first discuss major changes to the existing code you wish to make via a github issue. Minor changes and major additions are welcome as long as they are released under the Boost License. ** Pull Request Process 1. Ensure any install or build dependencies are removed, e.g. .gitignore 2. Update the README.org with details of changes to the interface. 3. Increase the version numbers in any examples files and the ASDF file. 4. Update README.org to the new version that this Pull Request would represent. The versioning scheme we use is [[https://semver.org/][SemVer]]. Bugs are tracked on Github, please [[https://github.com/Symbolics/num-utils/issues][open an issue]] if you find one. * TODO ** Tasks (by Nunez) - Refactor/rename packages, e.g. consolidate all the matrix utilities into num-util/mops (matrix operations), num-utils/elementwise, num-utils/arithmetic, etc. This way the library can be loaded piecemeal. - Silence SBCL compiler warnings for tests where we are expecting to signal an error - More CCL testing - Test for more specific conditions with fiveam:signal test (now is generic error) - Investigate unit test failure in wrapped-bivariate-to-array - Restore old/arithmetic-types.lisp and write tests ** Tasks (by Papp) - Finish histogram code and tests - Decide whether recursive indexes are practical. The code for both is present, but commented out.
Next: Files, Previous: Introduction, Up: Top [Contents][Index]
The main system appears first, followed by any subsystem dependency.
• The num-utils system |
Steven Nunez <steve.nunez@symbolics.com.sg
Boost Software License - Version 1.0
Numerical utilities for Common Lisp
0.0.2
num-utils.asd (file)
Files are sorted by type and then listed depth-first from the systems components trees.
• Lisp files |
Next: The num-utils/packages․lisp file, Previous: Lisp files, Up: Lisp files [Contents][Index]
/home/quickref/quicklisp/dists/quicklisp/software/num-utils-20191130-git/num-utils.asd
num-utils (system)
Next: The num-utils/utilities․lisp file, Previous: The num-utils․asd file, Up: Lisp files [Contents][Index]
num-utils (system)
packages.lisp
Next: The num-utils/num=․lisp file, Previous: The num-utils/packages․lisp file, Up: Lisp files [Contents][Index]
packages.lisp (file)
num-utils (system)
utilities.lisp
Next: The num-utils/arithmetic․lisp file, Previous: The num-utils/utilities․lisp file, Up: Lisp files [Contents][Index]
utilities.lisp (file)
num-utils (system)
num=.lisp
Next: The num-utils/elementwise․lisp file, Previous: The num-utils/num=․lisp file, Up: Lisp files [Contents][Index]
num=.lisp (file)
num-utils (system)
arithmetic.lisp
Next: The num-utils/extended-real․lisp file, Previous: The num-utils/arithmetic․lisp file, Up: Lisp files [Contents][Index]
arithmetic.lisp (file)
num-utils (system)
elementwise.lisp
Next: The num-utils/interval․lisp file, Previous: The num-utils/elementwise․lisp file, Up: Lisp files [Contents][Index]
elementwise.lisp (file)
num-utils (system)
extended-real.lisp
Next: The num-utils/print-matrix․lisp file, Previous: The num-utils/extended-real․lisp file, Up: Lisp files [Contents][Index]
extended-real.lisp (file)
num-utils (system)
interval.lisp
Next: The num-utils/matrix․lisp file, Previous: The num-utils/interval․lisp file, Up: Lisp files [Contents][Index]
interval.lisp (file)
num-utils (system)
print-matrix.lisp
print-matrix-formatter (function)
Next: The num-utils/matrix-shorthand․lisp file, Previous: The num-utils/print-matrix․lisp file, Up: Lisp files [Contents][Index]
print-matrix.lisp (file)
num-utils (system)
matrix.lisp
Next: The num-utils/statistics․lisp file, Previous: The num-utils/matrix․lisp file, Up: Lisp files [Contents][Index]
matrix.lisp (file)
num-utils (system)
matrix-shorthand.lisp
pad-left-expansion (function)
Next: The num-utils/chebyshev․lisp file, Previous: The num-utils/matrix-shorthand․lisp file, Up: Lisp files [Contents][Index]
matrix-shorthand.lisp (file)
num-utils (system)
statistics.lisp
Next: The num-utils/polynomial․lisp file, Previous: The num-utils/statistics․lisp file, Up: Lisp files [Contents][Index]
statistics.lisp (file)
num-utils (system)
chebyshev.lisp
Next: The num-utils/rootfinding․lisp file, Previous: The num-utils/chebyshev․lisp file, Up: Lisp files [Contents][Index]
chebyshev.lisp (file)
num-utils (system)
polynomial.lisp
evaluate-polynomial (function)
Next: The num-utils/quadrature․lisp file, Previous: The num-utils/polynomial․lisp file, Up: Lisp files [Contents][Index]
polynomial.lisp (file)
num-utils (system)
rootfinding.lisp
Next: The num-utils/common-package․lisp file, Previous: The num-utils/rootfinding․lisp file, Up: Lisp files [Contents][Index]
rootfinding.lisp (file)
num-utils (system)
quadrature.lisp
romberg-quadrature (function)
Previous: The num-utils/quadrature․lisp file, Up: Lisp files [Contents][Index]
quadrature.lisp (file)
num-utils (system)
common-package.lisp
Next: Definitions, Previous: Files, Up: Top [Contents][Index]
Packages are listed by definition order.
Next: The num-utils․interval package, Previous: Packages, Up: Packages [Contents][Index]
packages.lisp (file)
poly
evaluate-polynomial (function)
Next: The num-utils․print-matrix package, Previous: The num-utils․polynomial package, Up: Packages [Contents][Index]
packages.lisp (file)
Next: The num-utils․utilities package, Previous: The num-utils․interval package, Up: Packages [Contents][Index]
packages.lisp (file)
print-matrix-formatter (function)
Next: The num-utils․arithmetic package, Previous: The num-utils․print-matrix package, Up: Packages [Contents][Index]
packages.lisp (file)
Next: The num-utils․matrix-shorthand package, Previous: The num-utils․utilities package, Up: Packages [Contents][Index]
packages.lisp (file)
Next: The num-utils․num= package, Previous: The num-utils․arithmetic package, Up: Packages [Contents][Index]
packages.lisp (file)
clnu.mx
pad-left-expansion (function)
Next: The num-utils․extended-real package, Previous: The num-utils․matrix-shorthand package, Up: Packages [Contents][Index]
packages.lisp (file)
Next: The num-utils․quadrature package, Previous: The num-utils․num= package, Up: Packages [Contents][Index]
packages.lisp (file)
xreal
Next: The num-utils․statistics package, Previous: The num-utils․extended-real package, Up: Packages [Contents][Index]
packages.lisp (file)
romberg-quadrature (function)
Next: The num-utils․rootfinding package, Previous: The num-utils․quadrature package, Up: Packages [Contents][Index]
packages.lisp (file)
clnu.stats
Next: The num-utils․elementwise package, Previous: The num-utils․statistics package, Up: Packages [Contents][Index]
packages.lisp (file)
Next: The num-utils․chebyshev package, Previous: The num-utils․rootfinding package, Up: Packages [Contents][Index]
packages.lisp (file)
nuem
Next: The num-utils․matrix package, Previous: The num-utils․elementwise package, Up: Packages [Contents][Index]
packages.lisp (file)
Next: The num-utils package, Previous: The num-utils․chebyshev package, Up: Packages [Contents][Index]
packages.lisp (file)
Previous: The num-utils․matrix package, Up: Packages [Contents][Index]
common-package.lisp (file)
clnu
common-lisp
Definitions are sorted by export status, category, package, and then by lexicographic order.
• Exported definitions | ||
• Internal definitions |
Next: Internal definitions, Previous: Definitions, Up: Definitions [Contents][Index]
Next: Exported macros, Previous: Exported definitions, Up: Exported definitions [Contents][Index]
Default degree for (weighted) central sample moments.
statistics.lisp (file)
Default tolerance for NUM=.
num=.lisp (file)
Number of digits after the decimal point when printing numeric matrices.
print-matrix.lisp (file)
Default relative interval width for rootfinding.
rootfinding.lisp (file)
Default maximum for the absolute value of the function, used for rootfinding.
rootfinding.lisp (file)
Next: Exported compiler macros, Previous: Exported special variables, Up: Exported definitions [Contents][Index]
LET+ expansion for interval endpoints. If given a list of two values, the second value is an indicator for whether the endpoint is open.
interval.lisp (file)
CHECK-TYPE for multiple places of the same type. Each argument is either a place, or a list of a place and a type-string.
utilities.lisp (file)
Currying in all variables that are not *. Note that this is a macro, so * should not be quoted, and FUNCTION will be used as is, ie it can be a LAMBDA form.
utilities.lisp (file)
Define a method for NUM=, specialized to the given class, comparing values obtained with accessors.
num=.lisp (file)
Define a NUM= method for the given structure, comparing the given slots.
num=.lisp (file)
Define a version of MACRO with multiple arguments, given as a list. Application of MACRO will be nested. The new name is the plural of the old one (generated using format by default).
utilities.lisp (file)
Expand BODY. Useful for generating code programmatically.
utilities.lisp (file)
Apply EXTEND-INTERVAL on PLACE using OBJECT.
interval.lisp (file)
Like GETHASH, but checking that KEY is present and raising the given error if not.
utilities.lisp (file)
Macro for creating a lower triangular matrix. ROWS should be a list of lists, elements are evaluated. Masked elements (above the diagonal) are ignored at the expansion, rows which don’t have enough elements are padded with zeros.
matrix-shorthand.lisp (file)
LAMBDA with WITH-TEMPLATE in its BODY.
extended-real.lisp (file)
Macro for creating a lower triangular matrix. ROWS should be a list of lists, elements are evaluated. Masked elements (above the diagonal) are ignored at the expansion, rows which don’t have enough elements are padded with zeros.
matrix-shorthand.lisp (file)
Multiply place by COEFFICIENT.
arithmetic.lisp (file)
Macro for creating a (dense) matrix (ie a rank 2 array). ROWS should be a list of lists (or atoms, which are treated as lists), elements are evaluated.
matrix-shorthand.lisp (file)
Similar to splice-when, but binds IT to test.
utilities.lisp (file)
Similar to when, but wraps the result in list.
Example: ‘(,foo ,@(splice-when add-bar? bar))
utilities.lisp (file)
When PLACE is NIL, evaluate VALUE-FORM and save it there.
utilities.lisp (file)
Macro for creating an upper triangular matrix. ROWS should be a list of lists, elements are evaluated. Masked elements (below the diagonal) are ignored at the expansion.
matrix-shorthand.lisp (file)
For each binding = (variable value), coerce VALUE to DOUBLE-FLOAT and bind it to VARIABLE for BODY. When VALUE is omitted, VARIABLE is used instead. When BINDING is an atom, it is used for both the value and the variable.
Example:
(with-double-floats (a
(b)
(c 1))
...)
utilities.lisp (file)
Define the function (PREFIX &rest VARIABLES) which can be used to match variables using :PLUSINF, :MINUSINF, REAL, or T.
extended-real.lisp (file)
Next: Exported functions, Previous: Exported macros, Up: Exported definitions [Contents][Index]
utilities.lisp (file)
Next: Exported generic functions, Previous: Exported compiler macros, Up: Exported definitions [Contents][Index]
Return 1-number. The mnemonic is "1 complement", 1- is already a CL library function.
arithmetic.lisp (file)
extended-real.lisp (file)
extended-real.lisp (file)
extended-real.lisp (file)
extended-real.lisp (file)
extended-real.lisp (file)
Absolute difference of A and B.
arithmetic.lisp (file)
Number multiplied by its complex conjugate.
arithmetic.lisp (file)
Convert argument to DOUBLE-FLOAT.
utilities.lisp (file)
If NUMBER represents an integer (as an integer, complex, or float, etc), return it as an integer, otherwise signal an error. Floats are converted with RATIONALIZE.
arithmetic.lisp (file)
Convert SEQUENCE to a SIMPLE-FIXNUM-VECTOR. When COPY?, make sure that the they don’t share structure.
utilities.lisp (file)
Biconditional. Returns A <=> B.
utilities.lisp (file)
Return INDEX such that
(WITHIN? (AREF SORTED-REALS INDEX) VALUE (AREF SORTED-REALS (1+ INDEX)).
SORTED-REALS is assumed to be reals sorted in ascending order (not checked, if this does not hold the result may be nonsensical, though the algorithm will terminate).
If value is below (or above) the first (last) break, NIL (T) is returned.
utilities.lisp (file)
Find the lowest A=I*DIVISOR+OFFSET >= NUMBER, return (values A (- A NUMBER).
arithmetic.lisp (file)
Return the degree of CENTRAL-SAMPLE-MOMENTS.
statistics.lisp (file)
Return a closure approximating F on the given INTERVAL (may be infinite on either end) using the given number of Chebyshev polynomials.
chebyshev.lisp (file)
Chebyshev polynomial regression using the given number of polynomials and points (zeroes of the corresponding Chebyshev polynomial).
chebyshev.lisp (file)
Return the iTH root of the Mth Chebyshev polynomial as double-float.
chebyshev.lisp (file)
Return the roots of the Mth Chebyshev polynomial as a vector of double-floats.
chebyshev.lisp (file)
Cross-tabulate two sequences (using a SPARSE-COUNTER with the given TEST). TEST is used to compare conses.
statistics.lisp (file)
Cumulative product of sequence. Return a sequence of the same kind and length; last element is the total product. The latter is also returned as the second value.
arithmetic.lisp (file)
Cumulative sum of sequence. Return a sequence of the same kind and length; last element is the total. The latter is returned as the second value.
arithmetic.lisp (file)
matrix.lisp (file)
matrix.lisp (file)
Return a DIAGONAL-MATRIX with elements coerced to ELEMENT-TYPE.
matrix-shorthand.lisp (file)
Test if DIVISOR divides NUMBER without remainder, and if so, return the quotient. Works generally, but makes most sense for rationals.
arithmetic.lisp (file)
Elementwise *.
elementwise.lisp (file)
Elementwise +.
elementwise.lisp (file)
Elementwise -.
elementwise.lisp (file)
Elementwise /.
elementwise.lisp (file)
Return the resulting float type when objects (or their elements) are combined using arithmetic operations.
elementwise.lisp (file)
Elementwise logarithm.
elementwise.lisp (file)
Elementwise MAX.
elementwise.lisp (file)
Elementwise MIN.
elementwise.lisp (file)
Return the empirical quantile of a vector of real numbers, sorted in ascending order (not checked). Uses a 0.5 correction.
statistics.lisp (file)
Probabilities that correspond to the empirical quantiles of a vector of length N. That is to say,
(== (quantiles sample (empirical-quantile-probabilities (length sample)))
sample)
for any vector SAMPLE.
statistics.lisp (file)
Return the elements of OBJECT as a vector (or reals) sorted in ascending order.
statistics.lisp (file)
Return the sum of Chebyshev polynomials, weighted by COEFFICIENTS, at X.
chebyshev.lisp (file)
Return the sum of polynomials, weighted by COEFFICIENTS, at X. COFFICIENTS are ordered from the highest degree down to the constant term. X must be of the same type as COEFFICIENTS.
polynomial.lisp (file)
Check of type of OBJECT is fixnum.
utilities.lisp (file)
Find the highest A=I*DIVISOR+OFFSET <= NUMBER, return (values A (- A NUMBER).
arithmetic.lisp (file)
Like MAKE-SEQUENCE, but using a function to fill the result.
utilities.lisp (file)
Return an arithmetic sequence of the given size (length) between the endpoints of the interval. The endpoints of the sequence coincide with the respective endpoint of the interval iff it is closed. RESULT-TYPE determines the result type (eg list), if not given it is a simple-array (of rank 1), narrowing to the appropriate float type or fixnum if possible.
interval.lisp (file)
Create a lower-triangular-matrix.
matrix.lisp (file)
Test if NUMBER is in INTERVAL (which can be NIL, designating the empty set).
interval.lisp (file)
Test if an object represents positive or negative infinity.
extended-real.lisp (file)
Create an INTERVAL.
interval.lisp (file)
Return the smallest connected interval that contains (elements in) OBJECT.
interval.lisp (file)
Difference between left and right.
interval.lisp (file)
Convex combination of left and right, with alpha (defaults to 0.5) weight on right.
interval.lisp (file)
Return a vector of fixnums.
(ivec end) => #(0 ... end-1) (or #(0 ... end+1) when end is negative).
(ivec start end) => #(start ... end-1) or to end+1 when end is negative.
When BY is given it determines the increment, adjusted to match the direction unless STRICT-DIRECTION, in which case an error is signalled.
arithmetic.lisp (file)
$L_2$ norm of OBJECT.
arithmetic.lisp (file)
Abbreviation for decimal logarithm.
arithmetic.lisp (file)
Abbreviation for binary logarithm.
arithmetic.lisp (file)
Create a lower-triangular-matrix.
matrix.lisp (file)
Create a sparse counter. Elements are compared with TEST (should be accepted by HASH-TABLE).
statistics.lisp (file)
utilities.lisp (file)
Verify that each element of VECTOR is nonnegative and return a vector multiplied so that they sum to 1. ELEMENT-TYPE can be used to specify the element-type of the result. When RESULT is given, the result is placed there. When RESULT is NIL, VECTOR is modified instead.
arithmetic.lisp (file)
|a-b|/max(1,|a|,|b|). Useful for comparing numbers.
num=.lisp (file)
Curried version of num=, with given tolerance.
num=.lisp (file)
Return a sequence between FROM and TO, progressing by BY, of the given LENGTH. Only 3 of these a parameters should be given, the missing one (NIL) should be inferred automatically. The sign of BY is adjusted if necessary. If TYPE is LIST, the result is a list, otherwise it determines the element type of the resulting simple array. If TYPE is nil, it as autodetected from the arguments (as a FIXNUM, a RATIONAL, or some subtype of FLOAT). Note that the implementation may upgrade the element type.
arithmetic.lisp (file)
A symmetric interval around CENTER.
interval.lisp (file)
Pool ACCUMULATORS.
statistics.lisp (file)
Return values (min dimension *print-length*) and whether the constraint is binding.
print-matrix.lisp (file)
Format and print the elements of MATRIX (a 2d array) to STREAM, using PADDING between columns.
MASKED-FN is called on row and column indices. If it returns nil, the corresponding element is formatted using FORMATTER and printed. Otherwise, it should return a string, which is printed as is. INDENT is printed before each row.
If ALIGNED?, columns will be right-aligned. At most *PRINT-LENGTH* rows and columns are printed, more is indicated with ellipses (...).
print-matrix.lisp (file)
interval.lisp (file)
Romberg quadrature of F on the interval. The iteration stops if the relative change is below EPSILON, but only after MIN-ITER refinements (to avoid spurious premature convergence). An error occurs when MAX-ITER iterations are reached without convergence.
quadrature.lisp (file)
Find the root of f bracketed between a and b using bisection.
The algorithm stops when either the root is bracketed in an interval of length
TOLERANCE (relative to the initial |a-b|), or root is found such that
abs(f(root)) <= epsilon.
Return five values: the root, the value of the function at the root, and a boolean which is true iff abs(f(root)) <= epsilon. If the third value is true, the fourth and fifth values are the endpoints of the bracketing interval, otherwise they are undefined.
rootfinding.lisp (file)
Find A=I*DIVISOR+OFFSET that minimizes |A-NUMBER|, return (values A (- A NUMBER). When NUMBER is exactly in between two possible A’s, the rounding rule of ROUND is used on NUMBER-OFFSET.
arithmetic.lisp (file)
Test whether all arguments have the same sign (ie all are positive, negative, or zero).
arithmetic.lisp (file)
Return T if X is type SEQUENCE.
utilities.lisp (file)
Shrink interval by given magnitudes (which may be REAL or RELATIVE). When check-flip?, the result is checked for endpoints being in a different order than the original. Negative LEFT and RIGHT extend the interval.
interval.lisp (file)
statistics.lisp (file)
interval.lisp (file)
Return the count for OBJECT.
statistics.lisp (file)
statistics.lisp (file)
Return a vector of subintervals (same length as DIVISIONS), splitting the interval using the sequence DIVISIONS, which can be nonnegative real numbers (or RELATIVE specifications) and SPACERs which divide the leftover proportionally. If there are no spacers and the divisions don’t fill up the interval, and error is signalled.
interval.lisp (file)
Square of number.
arithmetic.lisp (file)
Return INTERVAL evenly divided into COUNT subintervals as a vector. When MID-OPEN-RIGHT?, subintervals in the middle are open on the right and closed on the left, otherwise the opposite; openness of endpoints on the edge follows INTERVAL.
interval.lisp (file)
Tabulate a sequence (using a SPARSE-COUNTER with the given TEST).
statistics.lisp (file)
Find A=I*DIVISOR+OFFSET that maximizes |A|<=|NUMBER| with the same sign, return (values A (- A NUMBER).
arithmetic.lisp (file)
Create a lower-triangular-matrix.
matrix.lisp (file)
Return a vector with elements coerced to ELEMENT-TYPE.
matrix-shorthand.lisp (file)
Calculate quantiles QS of weighted observations. Uses a 0.5 correction.
statistics.lisp (file)
Return non-nil iff value is in [left,right).
utilities.lisp (file)
matrix.lisp (file)
Next: Exported conditions, Previous: Exported functions, Up: Exported definitions [Contents][Index]
Add OBJECT to ACCUMULATOR. Return OBJECT. NILs are ignored by the accumulator, unless a specialized method decides otherwise. Keywords may be used to specify additional information (eg weight).
statistics.lisp (file)
Return OBJECT as an ALIST. Semantics depends on OBJECT.
utilities.lisp (file)
Return (OBJECT . COUNT) pairs as an alist.
statistics.lisp (file)
Return OBJECT as a PLIST. Semantics depends on OBJECT. The default method uses AS-ALIST.
utilities.lisp (file)
Second central moment. For samples, normalized by the total weight (and thus not the unbiased estimator, see VARIANCE).
statistics.lisp (file)
Third central moment.
statistics.lisp (file)
Fourth central moment.
statistics.lisp (file)
Return a CENTRAL-SAMPLE-MOMENTS object that allows the
calculation of the central sample moments of OBJECT up to the given DEGREE.
When WEIGHTS are given, they need to be a sequence of matching length.
statistics.lisp (file)
Return the diagonal elements of MATRIX as a vector.
matrix.lisp (file)
(setf diagonal-vector) (generic function)
Set the diagonal elements of MATRIX using VECTOR.
matrix.lisp (file)
diagonal-vector (generic function)
Univariate elementwise -.
elementwise.lisp (file)
matrix.lisp (file)
matrix.lisp (file)
matrix.lisp (file)
matrix.lisp (file)
Univariate elementwise /.
elementwise.lisp (file)
matrix.lisp (file)
matrix.lisp (file)
matrix.lisp (file)
matrix.lisp (file)
Univariate elementwise LOG.
elementwise.lisp (file)
matrix.lisp (file)
matrix.lisp (file)
matrix.lisp (file)
matrix.lisp (file)
Bivariate elementwise *.
elementwise.lisp (file)
matrix.lisp (file)
matrix.lisp (file)
matrix.lisp (file)
matrix.lisp (file)
matrix.lisp (file)
matrix.lisp (file)
matrix.lisp (file)
matrix.lisp (file)
matrix.lisp (file)
matrix.lisp (file)
matrix.lisp (file)
matrix.lisp (file)
matrix.lisp (file)
matrix.lisp (file)
Bivariate elementwise +.
elementwise.lisp (file)
matrix.lisp (file)
matrix.lisp (file)
matrix.lisp (file)
matrix.lisp (file)
matrix.lisp (file)
matrix.lisp (file)
Bivariate elementwise -.
elementwise.lisp (file)
matrix.lisp (file)
matrix.lisp (file)
matrix.lisp (file)
matrix.lisp (file)
matrix.lisp (file)
matrix.lisp (file)
Bivariate elementwise /.
elementwise.lisp (file)
matrix.lisp (file)
matrix.lisp (file)
matrix.lisp (file)
matrix.lisp (file)
matrix.lisp (file)
matrix.lisp (file)
matrix.lisp (file)
matrix.lisp (file)
Bivariate elementwise LOG.
elementwise.lisp (file)
Univariate elementwise CEILING.
elementwise.lisp (file)
Univariate elementwise CONJUGATE.
elementwise.lisp (file)
Univariate elementwise EXP.
elementwise.lisp (file)
matrix.lisp (file)
matrix.lisp (file)
matrix.lisp (file)
matrix.lisp (file)
Bivariate elementwise EXPT.
elementwise.lisp (file)
Univariate elementwise FLOOR.
elementwise.lisp (file)
Return the contents of OBJECT as a SORTED-REALS.
statistics.lisp (file)
Elementwise reduce, traversing in row-major order.
elementwise.lisp (file)
Univariate elementwise SQRT.
elementwise.lisp (file)
matrix.lisp (file)
matrix.lisp (file)
matrix.lisp (file)
matrix.lisp (file)
Return an interval that includes INTERVAL and OBJECT. NIL stands for the empty set.
interval.lisp (file)
Kurtosis FIXME talk about bias, maybe implement unbiased?
statistics.lisp (file)
Square of the $L_2$ norm of OBJECT.
arithmetic.lisp (file)
Left endpoint of interval.
interval.lisp (file)
automatically generated reader method
The mean of elements in OBJECT.
statistics.lisp (file)
Median of OBJECT.
statistics.lisp (file)
Compare A and B for approximate equality, checking corresponding elements when applicable (using TOLERANCE).
Two numbers A and B are NUM= iff |a-b|/max(1,|a|,|b|) <= tolerance.
Unless a method is defined for them, two objects are compared with EQUALP.
Generally, methods should be defined so that two objects are NUM= if they the same class, same dimensions, and all their elements are NUM=.
num=.lisp (file)
statistics.lisp (file)
matrix.lisp (file)
matrix.lisp (file)
interval.lisp (file)
interval.lisp (file)
True iff the left endpoint of the interval is open.
interval.lisp (file)
automatically generated reader method
True iff the right endpoint of the interval is open.
interval.lisp (file)
automatically generated reader method
Product of elements in object.
arithmetic.lisp (file)
Return an element at quantile Q. May be an interpolation or an approximation, depending on OBJECT and Q. NOTE: Extensions should define methods for QUANTILES, not QUANTILE.
statistics.lisp (file)
Multiple quantiles (see QUANTILE). NOTE: Extensions should define methods for QUANTILES, not QUANTILE.
statistics.lisp (file)
Right endpoint of interval.
interval.lisp (file)
automatically generated reader method
Standard deviation. For samples, the square root of the unbiased estimator (see VARIANCE).
statistics.lisp (file)
interval.lisp (file)
Skewness FIXME talk about bias, maybe implement unbiased?
statistics.lisp (file)
Sum of elements in object. KEY is applied to each element.
arithmetic.lisp (file)
The total weight of elements in ACCUMULATOR.
statistics.lisp (file)
Transpose.
matrix.lisp (file)
Variance of OBJECT. For samples, normalized by the weight-1 (and thus unbiased if certain assumptions hold, eg weights that count frequencies).
statistics.lisp (file)
Next: Exported structures, Previous: Exported generic functions, Up: Exported definitions [Contents][Index]
statistics.lisp (file)
error (condition)
statistics.lisp (file)
error (condition)
statistics.lisp (file)
error (condition)
Next: Exported classes, Previous: Exported conditions, Up: Exported definitions [Contents][Index]
Central sample moments calculated on-line/single-pass.
M weighted mean
S2 weighted sum of squared deviations from the mean, not calculated when NIL
S3 weighted sum of cubed deviations from the mean, not calculated when NIL
S4 weighted sum of 4th power deviations from the mean, not calculated when NIL
Allows on-line, numerically stable calculation of moments. See cite{bennett2009numerically} and cite{pebay2008formulas} for the description of the algorithm. M_2, ..., M_4 in the paper are s2, ..., s4 in the code.
statistics.lisp (file)
tally-mixin (structure)
real
0.0d0
central-sample-moments-m (function)
(setf central-sample-moments-m) (function)
(or (real 0) null)
0.0d0
central-sample-moments-s2 (function)
(setf central-sample-moments-s2) (function)
(or real null)
0.0d0
central-sample-moments-s3 (function)
(setf central-sample-moments-s3) (function)
(or (real 0) null)
0.0d0
central-sample-moments-s4 (function)
(setf central-sample-moments-s4) (function)
Diagonal matrix. The elements in the diagonal are stored in a vector.
matrix.lisp (file)
structure-object (structure)
vector
diagonal-matrix-elements (function)
(setf diagonal-matrix-elements) (function)
Hermitian/symmetric matrix, with elements stored in the _lower_ triangle.
Implements _both_ real symmetric and complex Hermitian matrices — as technically, real symmetric matrices are also Hermitian. Complex symmetric matrices are _not_ implemented as a special matrix type, as they don’t have any special properties (eg real eigenvalues, etc).
matrix.lisp (file)
wrapped-matrix (structure)
Lower triangular matrix. ELEMENTS in the upper triangle are treated as zero.
matrix.lisp (file)
wrapped-matrix (structure)
Relative sizes are in terms of width.
interval.lisp (file)
structure-object (structure)
(real 0)
relative-fraction (function)
(setf relative-fraction) (function)
Accumulator which sorts elements. ELEMENTS return the sorted elements.
statistics.lisp (file)
structure-object (structure)
vector
#()
sorted-reals-ordered-elements (function)
(setf sorted-reals-ordered-elements) (function)
list
sorted-reals-unordered-elements (function)
(setf sorted-reals-unordered-elements) (function)
Spacers divide the leftover portion of an interval.
interval.lisp (file)
structure-object (structure)
(real 0)
1
spacer-weight (function)
(setf spacer-weight) (function)
statistics.lisp (file)
structure-object (structure)
hash-table
sparse-counter-table (function)
(setf sparse-counter-table) (function)
Upper triangular matrix. ELEMENTS in the lower triangle are treated as zero.
matrix.lisp (file)
wrapped-matrix (structure)
A matrix that has some special structure (eg triangular, symmetric/hermitian). ELEMENTS is always a matrix. Not used directly, not exported.
matrix.lisp (file)
structure-object (structure)
(array * (* *))
wrapped-matrix-elements (function)
(setf wrapped-matrix-elements) (function)
Next: Exported types, Previous: Exported structures, Up: Exported definitions [Contents][Index]
Interval with finite endpoints.
interval.lisp (file)
Abstract superclass for all intervals.
interval.lisp (file)
standard-object (class)
Interval from -∞ to RIGHT.
interval.lisp (file)
Interval from LEFT to ∞.
interval.lisp (file)
Representing the real line (-∞,∞).
interval.lisp (file)
num= (method)
Previous: Exported classes, Up: Exported definitions [Contents][Index]
Extended real number.
extended-real.lisp (file)
Simple vector of double-float elements.
utilities.lisp (file)
Simple vector or fixnum elements.
utilities.lisp (file)
Simple vector of single-float elements.
utilities.lisp (file)
Triangular matrix (either lower or upper).
matrix.lisp (file)
Previous: Exported definitions, Up: Definitions [Contents][Index]
• Internal macros | ||
• Internal functions | ||
• Internal generic functions | ||
• Internal structures | ||
• Internal classes | ||
• Internal types |
Next: Internal functions, Previous: Internal definitions, Up: Internal definitions [Contents][Index]
LET+ form for slots of the structure DIAGONAL-MATRIX.
matrix.lisp (file)
LET+ form for slots of the structure DIAGONAL-MATRIX. Read-only.
matrix.lisp (file)
LET+ form for slots of the structure SORTED-REALS.
statistics.lisp (file)
LET+ form for slots of the structure SORTED-REALS. Read-only.
statistics.lisp (file)
FIXME documentation, factor our general part
statistics.lisp (file)
Define a comparison, extendeding a pairwise comparison to an arbitrary number of arguments.
extended-real.lisp (file)
elementwise.lisp (file)
Define an univariate elementwise operation.
elementwise.lisp (file)
Define an univariate elementwise operation.
elementwise.lisp (file)
Define binary elementwise operations for FUNCTION, implemented by converting them to arrays.
matrix.lisp (file)
elementwise.lisp (file)
Define binary elementwise operations for FUNCTION for two arguments of the same class.
matrix.lisp (file)
Define unary elementwise operations for FUNCTION for all subclasses of wrapped-elements.
matrix.lisp (file)
Define binary elementwise operations for FUNCTION for all subclasses of wrapped-elements.
matrix.lisp (file)
arithmetic.lisp (file)
matrix.lisp (file)
elementwise.lisp (file)
Common parts for univariate rootfinder functions.
Sets up the following:
- function OPPOSITE-SIGN-P for checking that two numbers are on the opposite side of 0
- function EVALUATE-AND-RETURN-IF-WITHIN-EPSILON which checks that |f(x)| <= EPSILON, if so, returns from the block with (VALUES X FX T), otherwise simply returns the value
- function RETURN-IF-WITHIN-TOLERANCE checks if the interval [A,B] bracketing X is small enough (smaller than TOLERANCE) and if so, returns (X FX NIL (INTERVAL A B))
- variables FA and FB to hold function values at A and B
Initially, it checks for either $f(a)$ or $f(b)$ being a root, and establishes $a leq b$ by exchanging $a,f(a)$ and $b,f(b)$ if necessary. Also checks that $f(a)$ and $f(b)$ are of opposite sign. Checks that both tolerance and epsilon are nonnegative.
rootfinding.lisp (file)
Next: Internal generic functions, Previous: Internal macros, Up: Internal definitions [Contents][Index]
Return (values INTERCEPT SLOPE) for linear mapping x:-> intercept+slope*x from [a,b] to [c,d].
chebyshev.lisp (file)
Inverse of cinf-to-ab.
chebyshev.lisp (file)
Test if element with indexes row and col is (strictly) above the diagonal.
matrix.lisp (file)
Test if element with indexes row and col is (strictly) below the diagonal.
matrix.lisp (file)
statistics.lisp (file)
statistics.lisp (file)
statistics.lisp (file)
statistics.lisp (file)
statistics.lisp (file)
statistics.lisp (file)
Chebyshev polynomial recursion formula.
chebyshev.lisp (file)
Map x in [c,plus-infinity) to z in [a,b] using x -> (x-c)/(1+x-c)+(b-a)+a.
chebyshev.lisp (file)
statistics.lisp (file)
matrix.lisp (file)
matrix.lisp (file)
quadrature.lisp (file)
matrix.lisp (file)
quadrature.lisp (file)
interval.lisp (file)
quadrature.lisp (file)
statistics.lisp (file)
interval.lisp (file)
statistics.lisp (file)
statistics.lisp (file)
quadrature.lisp (file)
matrix.lisp (file)
matrix.lisp (file)
matrix.lisp (file)
Convert OBJECT to an array, check that it
1. has the required rank,
2. has a valid sparse element type, and
3. that it satisfies PREDICATES.
Return the array.
matrix.lisp (file)
Extend TEST (a pairwise comparison) to an arbitrary number of arguments (but at least one, FIRST).
extended-real.lisp (file)
matrix.lisp (file)
matrix.lisp (file)
quadrature.lisp (file)
quadrature.lisp (file)
quadrature.lisp (file)
quadrature.lisp (file)
quadrature.lisp (file)
quadrature.lisp (file)
quadrature.lisp (file)
matrix.lisp (file)
matrix.lisp (file)
statistics.lisp (file)
matrix.lisp (file)
matrix.lisp (file)
quadrature.lisp (file)
matrix.lisp (file)
statistics.lisp (file)
statistics.lisp (file)
statistics.lisp (file)
matrix.lisp (file)
matrix.lisp (file)
quadrature.lisp (file)
quadrature.lisp (file)
quadrature.lisp (file)
quadrature.lisp (file)
quadrature.lisp (file)
quadrature.lisp (file)
quadrature.lisp (file)
quadrature.lisp (file)
quadrature.lisp (file)
Return true iff $|a-b| < \delta$.
rootfinding.lisp (file)
Return true iff $|f| < \epsilon$.
rootfinding.lisp (file)
Return true iff A and B are on opposite sides of 0.
rootfinding.lisp (file)
Pad ragged-right rows. Used internally to implement ragged right matrix specifications.
matrix-shorthand.lisp (file)
Standard formatter for matrix printing. Respects *print-precision*, and formats complex numbers as a+bi, eg 0.0+1.0i.
print-matrix.lisp (file)
interval.lisp (file)
interval.lisp (file)
quadrature.lisp (file)
quadrature.lisp (file)
quadrature.lisp (file)
quadrature.lisp (file)
quadrature.lisp (file)
Add STEP (= $A(h q^{-k}$) to an existing Richardson EXTRAPOLATION. See the documentation of RICHARDSON-EXTRAPOLATION for details.
quadrature.lisp (file)
Internal function implementing Romberg quadrature. Requires an iterative quadrature instance, a relative EPSILON and MIN-ITER for the stopping criterion, and the maximum number of iterations allowed. Works on finite intervals.
quadrature.lisp (file)
Default DELTA for rootfinding methods, uses bracket width.
rootfinding.lisp (file)
Return a type that is a supertype of ELEMENT-TYPE and is closed under arithmetic operations. May not be the narrowest.
arithmetic.lisp (file)
Return type that sequence can be mapped to using arithmetic operations.
arithmetic.lisp (file)
Return a SORTED-REALS structure.
statistics.lisp (file)
statistics.lisp (file)
statistics.lisp (file)
statistics.lisp (file)
interval.lisp (file)
interval.lisp (file)
statistics.lisp (file)
statistics.lisp (file)
statistics.lisp (file)
quadrature.lisp (file)
quadrature.lisp (file)
quadrature.lisp (file)
quadrature.lisp (file)
quadrature.lisp (file)
quadrature.lisp (file)
quadrature.lisp (file)
quadrature.lisp (file)
quadrature.lisp (file)
matrix.lisp (file)
matrix.lisp (file)
Check if TYPE is a valid type for sparse matrices. Only supertypes and subtypes of NUMBER are allowed.
matrix.lisp (file)
Return the empirical quantile of a vector of real numbers, sorted in ascending order (not checked). Uses a 0.5 correction.
statistics.lisp (file)
Return table of probability brackets for weighted quantile calculations., built from the weights (which should be positive reals, not checked). Uses a 0.5 correction.
statistics.lisp (file)
matrix.lisp (file)
Return 0 coerced to the element type of ARRAY. It is assumed that the latter satisfies VALID-SPARSE-TYPE?.
matrix.lisp (file)
Next: Internal structures, Previous: Internal functions, Up: Internal definitions [Contents][Index]
Implementation of CHEBYSHEV-APPROXIMATE.
chebyshev.lisp (file)
Univariate elementwise SQUARE.
elementwise.lisp (file)
Pool two accumulators. When they are of a different type, the resulting accumulator will be downgraded to the level afforded by the information available in the accumulators.
statistics.lisp (file)
interval.lisp (file)
interval.lisp (file)
Refine quadrature with more points. Return the sum for those points.
quadrature.lisp (file)
Return the coefficient $q$ for Richardson approximation.
quadrature.lisp (file)
Return a quadrature for integrating FUNCTION on INTERVAL, which may be infinite, in which case FUNCTION will be transformed. TRANSFORMATION can be used to select the transformation when applicable, otherwise it is NIL.
quadrature.lisp (file)
Next: Internal classes, Previous: Internal generic functions, Up: Internal definitions [Contents][Index]
Quadrature building block.
F is the function.
A and B are the endpoints.
H is the stepsize.
quadrature.lisp (file)
structure-object (structure)
(function (double-float) double-float)
iterative-quadrature-f (function)
(setf iterative-quadrature-f) (function)
double-float
iterative-quadrature-a (function)
(setf iterative-quadrature-a) (function)
double-float
iterative-quadrature-b (function)
(setf iterative-quadrature-b) (function)
double-float
iterative-quadrature-h (function)
(setf iterative-quadrature-h) (function)
fixnum
0
iterative-quadrature-n (function)
(setf iterative-quadrature-n) (function)
double-float
0.0d0
iterative-quadrature-sum (function)
(setf iterative-quadrature-sum) (function)
quadrature.lisp (file)
iterative-quadrature (structure)
Given A(h)=A_0 + sum_{k=1}^infty a_k h^{kp}, calculate approximations for A given A(h q^{-k}), where the latter can be incorporated using RICHARDSON-ITERATION with consecutive values for k=1,...,max_iter, which returns the latest A(0) as the first and the largest relative change, which can be used to test termination.
The algorithm uses Richardson extrapolation, the required coefficient is q^k.
quadrature.lisp (file)
structure-object (structure)
double-float
richardson-extrapolation-coefficient (function)
(setf richardson-extrapolation-coefficient) (function)
fixnum
0
richardson-extrapolation-n (function)
(setf richardson-extrapolation-n) (function)
(array double-float (*))
richardson-extrapolation-diagonal (function)
(setf richardson-extrapolation-diagonal) (function)
Mixin structure that contains a tally. Not exported. W is the total weight.
statistics.lisp (file)
structure-object (structure)
central-sample-moments (structure)
tally (method)
(real 0)
0
tally-mixin-w (function)
(setf tally-mixin-w) (function)
quadrature.lisp (file)
iterative-quadrature (structure)
Next: Internal types, Previous: Internal structures, Up: Internal definitions [Contents][Index]
Interval with left endpoint.
interval.lisp (file)
standard-object (class)
real
:left
left (generic function)
boolean
:open-left?
open-left? (generic function)
Interval with right endpoint.
interval.lisp (file)
standard-object (class)
real
:right
right (generic function)
boolean
:open-right?
open-right? (generic function)
Left endpoint is -∞.
interval.lisp (file)
standard-object (class)
Right endpoint is ∞.
interval.lisp (file)
standard-object (class)
Previous: Internal classes, Up: Internal definitions [Contents][Index]
Representing infinity (extending the real line).
extended-real.lisp (file)
Previous: Definitions, Up: Top [Contents][Index]
• Concept index | ||
• Function index | ||
• Variable index | ||
• Data type index |
Next: Function index, Previous: Indexes, Up: Indexes [Contents][Index]
Jump to: | F L N |
---|
Jump to: | F L N |
---|
Next: Variable index, Previous: Concept index, Up: Indexes [Contents][Index]
Jump to: | &
(
1
<
=
>
A B C D E F G H I K L M N O P Q R S T U V W Z |
---|
Jump to: | &
(
1
<
=
>
A B C D E F G H I K L M N O P Q R S T U V W Z |
---|
Next: Data type index, Previous: Function index, Up: Indexes [Contents][Index]
Jump to: | *
A B C D E F H L M N O R S T U W |
---|
Jump to: | *
A B C D E F H L M N O R S T U W |
---|
Previous: Variable index, Up: Indexes [Contents][Index]
Jump to: | C D E F H I L M N P R S T U W |
---|
Jump to: | C D E F H I L M N P R S T U W |
---|