Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/al-jshen/compute
/ functions
Functions
442 in github.com/al-jshen/compute
⨍
Functions
442
◇
Types & classes
42
↓ 65 callers
Method
sample_n
Generates a vector of `n` randomly sampled values from the given probability distribution.
src/distributions/mod.rs:32
↓ 28 callers
Method
to_vec
Converts the matrix to a Vector.
src/linalg/array/matrix.rs:436
↓ 21 callers
Method
into_iter
(self)
src/linalg/array/vec.rs:139
↓ 15 callers
Function
is_matrix
(m: &[f64], nrows: usize)
src/linalg/utils.rs:47
↓ 15 callers
Function
matmul
( a: &[f64], b: &[f64], rows_a: usize, rows_b: usize, transpose_a: bool, transpose_b:
src/linalg/utils.rs:362
↓ 15 callers
Function
mean
Calculates the mean of an array of data points.
src/statistics/moments.rs:37
↓ 13 callers
Function
gamma
Calculates the [Gamma function](https://en.wikipedia.org/wiki/Gamma_function) using the [Lanczos approximation](https://en.wikipedia.org/wiki/Lanczos_
src/functions/gamma.rs:31
↓ 13 callers
Method
sample
Samples from the given T distribution.
src/distributions/t.rs:38
↓ 11 callers
Method
t
Transpose the matrix.
src/linalg/array/matrix.rs:412
↓ 11 callers
Function
transpose
Transpose a matrix.
src/linalg/utils.rs:158
↓ 10 callers
Function
dot
(x: &[f64], y: &[f64])
src/linalg/utils.rs:570
↓ 10 callers
Function
is_square
(m: &[f64])
src/linalg/utils.rs:58
↓ 8 callers
Method
shape
Get the number of rows and columns in the matrix.
src/linalg/array/matrix.rs:282
↓ 7 callers
Function
invert_matrix
Given an n by n matrix, invert it. The resulting matrix is returned as a flattened array.
src/linalg/utils.rs:183
↓ 7 callers
Function
matmul_blocked
Performs blocked matrix multiplication with block size `bsize`. See the API for the [matmul](crate::linalg::matmul).
src/linalg/utils.rs:314
↓ 6 callers
Function
cholesky
Computes the Cholesky decomposition of the matrix `a` using the Cholesky-Banachiewicz algorithm.
src/linalg/decomposition/cholesky.rs:9
↓ 6 callers
Method
extend
(&mut self, iter: T)
src/linalg/array/vec.rs:183
↓ 6 callers
Function
linspace
Generates evenly spaced values within a given interval, with a set number of points. Both the start and stop points are included.
src/linalg/utils.rs:38
↓ 6 callers
Function
max
Returns the largest element in the array.
src/statistics/order.rs:9
↓ 6 callers
Method
size
Get the total number of elements in the matrix.
src/linalg/array/matrix.rs:287
↓ 6 callers
Method
to_matrix
(self)
src/linalg/array/vec.rs:66
↓ 5 callers
Function
arange
Generates evenly spaced values within a given interval. Values generated in the half-open interval [start, stop). That is, the stop point is not inclu
src/linalg/utils.rs:29
↓ 5 callers
Method
deviance
Return the deviance of the model.
src/predict/glms/glm.rs:247
↓ 5 callers
Function
lu
Computes the pivoted LU decomposition of a square matrix. For some matrix A, this decomposition is A = PLU. The resulting matrix has U in its upper tr
src/linalg/decomposition/lu.rs:14
↓ 5 callers
Method
reshape
(&self, nrows: i32, ncols: i32)
src/linalg/array/vec.rs:71
↓ 5 callers
Function
solve
Solve the linear system Ax = b.
src/linalg/utils.rs:274
↓ 5 callers
Function
var
Calculates the population variance from an array of data points in a numerically stable manner using the Welford algorithm.
src/statistics/moments.rs:49
↓ 4 callers
Method
diag
Get the diagonal elements of the matrix.
src/linalg/array/matrix.rs:243
↓ 4 callers
Method
lu
(&self)
src/linalg/array/matrix.rs:163
↓ 4 callers
Method
lu_solve
Solve the linear system Ax = b given a LU decomposed matrix A. The first argument should be a tuple, where the first element is the LU decomposed matr
src/linalg/array/matrix.rs:526
↓ 4 callers
Function
row_to_col_major
Convert a 1D matrix from row-major ordering into column-major ordering.
src/linalg/utils.rs:134
↓ 3 callers
Method
cholesky
Return the Cholesky decomposition of the matrix. Resulting matrix is lower triangular.
src/linalg/array/matrix.rs:143
↓ 3 callers
Function
cholesky_solve
Solves the system Lx=b, where L is a lower triangular matrix (e.g., a Cholesky decomposed matrix), and b is a one dimensional vector.
src/linalg/decomposition/cholesky.rs:32
↓ 3 callers
Function
col_to_row_major
Convert a 1D matrix from column-major ordering into row-major ordering.
src/linalg/utils.rs:146
↓ 3 callers
Method
inv_link
(&self, eta: &[f64])
src/predict/glms/families.rs:43
↓ 3 callers
Function
lu_solve
Solve the linear system Ax = b given a LU decomposed matrix A. The first argument should be a tuple, where the first element is the LU decomposed matr
src/linalg/decomposition/lu.rs:56
↓ 3 callers
Function
min
A module for computing order statistics. This includes medians, quantiles, and extrema. Returns the smallest element in the array.
src/statistics/order.rs:4
↓ 3 callers
Function
norm
Calculates the norm of a vector.
src/linalg/utils.rs:609
↓ 3 callers
Function
rbfkernel
(a: &Matrix, b: &Matrix, var: f64, lengthsq: f64)
examples/gp_regression/src/main.rs:81
↓ 3 callers
Method
update
Update the coefficients of the polynomial regressor.
src/predict/polynomial.rs:21
↓ 3 callers
Function
welford_statistics
Uses the Welford online algorithm to calculate the count, mean, and m2 of an array of data points. This is the driver for the `mean`, `variance`, and
src/statistics/moments.rs:23
↓ 2 callers
Function
acf
Calculates the autocorrelation of lag (-)k of a vector of time series data, assuming that the points are equally spaced in time.
src/timeseries/functions.rs:17
↓ 2 callers
Function
binom_coeff
Calculates the [binomial coefficient](https://en.wikipedia.org/wiki/Binomial_coefficient) nCk for two integers `n` and `k`, with `n >= k`.
src/functions/combinatorial.rs:7
↓ 2 callers
Function
bootstrap
Given an array of data, returns `n_bootstrap` vectors, where each has elements that are drawn from the original array with replacement, and the length
src/validation/resample.rs:8
↓ 2 callers
Method
coef
Return the maximum likelihood estimates for the parameters.
src/predict/glms/glm.rs:238
↓ 2 callers
Method
compute_ddbeta
(&self, x: &[f64], dmu: &[f64], var: &[f64], weights: &[f64])
src/predict/glms/glm.rs:113
↓ 2 callers
Method
data
(&self)
src/linalg/array/vec.rs:30
↓ 2 callers
Function
design
Create a design matrix from a given matrix.
src/linalg/utils.rs:465
↓ 2 callers
Method
get_col_as_vector
Return a copy of the column of the matrix as a Vector.
src/linalg/array/matrix.rs:362
↓ 2 callers
Method
get_dim
(&self)
src/distributions/multivariatenormal.rs:61
↓ 2 callers
Method
get_row_as_vector
Return a copy of the row of the matrix as a Vector.
src/linalg/array/matrix.rs:356
↓ 2 callers
Function
hist_bin_centers
Given the edges of some intervals, return the centers of the intervals. If `edges` is length n, then the resulting vector will be length n - 1.
src/statistics/hist.rs:5
↓ 2 callers
Method
inf_norm
Calculates the infinity norm of the matrix.
src/linalg/array/matrix.rs:396
↓ 2 callers
Function
interp1d_linear
( x: &[f64], y: &[f64], tgt: &[f64], extrapolate: ExtrapolationMode, )
src/functions/interpolate.rs:9
↓ 2 callers
Method
inv
Invert the matrix.
src/linalg/array/matrix.rs:73
↓ 2 callers
Function
ipiv_parity
Calculates the parity of a swap permutation array ipiv (e.g. that you get as an output from Lapack).
src/linalg/utils.rs:111
↓ 2 callers
Function
is_positive_definite
(m: &[f64])
src/linalg/utils.rs:96
↓ 2 callers
Function
jackknife
Given a length-n array of data, returns all leave-one-out length n-1 vectors. See <https://en.wikipedia.org/wiki/Jackknife_resampling>
src/validation/resample.rs:23
↓ 2 callers
Method
optimize
Run the optimization algorithm, given a vector of parameters to optimize and a function which calculates the residuals.
src/optimize/adam.rs:84
↓ 2 callers
Method
predict
Use the fitted model to make predictions on some new data.
src/predict/glms/glm.rs:300
↓ 2 callers
Method
predict
Predict n values ahead. For forecasts after the first forecast, uses previous forecasts as "data" to create subsequent forecasts.
src/timeseries/autoregressive.rs:58
↓ 2 callers
Method
reshape_mut
Reshape the matrix in-place. A size of `-1` in either the rows or the columns means that the size for that dimension will be automatically determined
src/linalg/array/matrix.rs:293
↓ 2 callers
Method
sample
Samples from the given Binomial distribution. For `np <= 30`, this is done with an inversion algorithm. Otherwise, this is done with the BTPE algorith
src/distributions/binomial.rs:46
↓ 2 callers
Method
sample_matrix
Generates a matrix of size `n x m` with values randomly sampled from the given distribution.
src/distributions/mod.rs:37
↓ 2 callers
Method
set_stepsize
(&mut self, stepsize: f64)
src/optimize/adam.rs:64
↓ 2 callers
Method
solve
Solve the linear system Ax = b using LU decomposition.
src/linalg/array/matrix.rs:553
↓ 2 callers
Function
sum
(x: &[f64])
src/linalg/utils.rs:501
↓ 2 callers
Method
sum_cols
Sum the matrix down the columns.
src/linalg/array/matrix.rs:384
↓ 2 callers
Method
sum_rows
Sum the matrix across the rows.
src/linalg/array/matrix.rs:375
↓ 2 callers
Function
trapezoid
Integrate samples from a function
src/integrate/samples.rs:4
↓ 2 callers
Function
xtx
Given a matrix X with k rows, return X transpose times X, which is a symmetric matrix.
src/linalg/utils.rs:217
↓ 1 callers
Function
acovf
Calculates the autocovariance of lag (-)k of a vector of time series data, assuming that the points are equally spaced in time.
src/timeseries/functions.rs:5
↓ 1 callers
Method
apply_dbeta_penalty
(&self, dbeta: &mut [f64], coef: &[f64])
src/predict/glms/glm.rs:129
↓ 1 callers
Method
apply_ddbeta_penalty
(&self, ddbeta: &mut [f64], n_predictors: usize)
src/predict/glms/glm.rs:135
↓ 1 callers
Method
argmax
Find the position of the largest element in the matrix. Returns (row, column).
src/linalg/array/matrix.rs:498
↓ 1 callers
Method
argmin
Find the position of the smallest element in the matrix. Returns (row, column).
src/linalg/array/matrix.rs:492
↓ 1 callers
Method
as_ref
(&self)
src/linalg/array/vec.rs:124
↓ 1 callers
Function
backward_substitution
Solve a matrix equation of the form Ux=b, where U is an upper triangular matrix. See the [Wikipedia page](https://en.wikipedia.org/wiki/Triangular_mat
src/linalg/decomposition/substitution.rs:23
↓ 1 callers
Method
backward_substitution
Solve a matrix equation of the form Ux=b, where U is an upper triangular matrix. See the [Wikipedia page](https://en.wikipedia.org/wiki/Triangular_mat
src/linalg/array/matrix.rs:132
↓ 1 callers
Function
beta
Calculates the [beta function](https://en.wikipedia.org/wiki/Beta_function) using the relationship between the beta function and the gamma function.
src/functions/gamma.rs:46
↓ 1 callers
Function
binomial_btpe
(n: u64, p: f64)
src/distributions/binomial.rs:91
↓ 1 callers
Function
binomial_inversion
(n: u64, p: f64)
src/distributions/binomial.rs:77
↓ 1 callers
Method
cholesky_solve
(&self, system: &Vector)
src/linalg/array/matrix.rs:511
↓ 1 callers
Method
coef_covariance_matrix
Returns the fitted covariance for the estimated parameters.
src/predict/glms/glm.rs:283
↓ 1 callers
Method
coef_standard_error
Returns the estimated standard errors on the estimated parameters. This is equivalent to the square root of the diagonals of the covariance matrix.
src/predict/glms/glm.rs:293
↓ 1 callers
Method
compute_dbeta
( &self, x: &[f64], y: &[f64], mu: &[f64], dmu: &[f64], var: &
src/predict/glms/glm.rs:86
↓ 1 callers
Method
d_inv_link
(&self, eta: &[f64], mu: &[f64])
src/predict/glms/families.rs:57
↓ 1 callers
Method
det
Calculates the determinant of the matrix using the LU decomposition.
src/linalg/array/matrix.rs:205
↓ 1 callers
Method
deviance
(&self, y: &[f64], mu: &[f64])
src/predict/glms/families.rs:71
↓ 1 callers
Function
diag
(a: &[f64])
src/linalg/utils.rs:124
↓ 1 callers
Function
diag_matrix
Create a diagonal matrix with the given elements along the elements.
src/linalg/utils.rs:173
↓ 1 callers
Method
diff
(&self)
src/linalg/array/vec.rs:87
↓ 1 callers
Function
digamma
Calculates the [digamma function](https://en.wikipedia.org/wiki/Digamma_function), which is the logarithmic derivative of the gamma function. It obeys
src/functions/gamma.rs:54
↓ 1 callers
Method
dispersion
Calculates the dispersion of the model.
src/predict/glms/glm.rs:269
↓ 1 callers
Function
erf
Calculates the [error function](https://en.wikipedia.org/wiki/Error_function) erf(x). # Remarks Uses Equation 7.1.26 in Stegun in combination with Ho
src/functions/statistical.rs:59
↓ 1 callers
Method
fit
Fit the polynomial regressor to some observed data `y` given some explanatory variables `x`. Uses least squares fitting.
src/predict/polynomial.rs:42
↓ 1 callers
Method
fit
Fit the GLM using the [scoring algorithm](https://en.wikipedia.org/wiki/Score_(statistics)#Scoring_algorithm), which gives the maximumum likelihood es
src/predict/glms/glm.rs:144
↓ 1 callers
Method
fit
Fit the AR(p) model to the data using the Yule-Walker equations.
src/timeseries/autoregressive.rs:27
↓ 1 callers
Function
forward_substitution
Solve a matrix equation of the form Lx=b, where L is a lower triangular matrix. See the [Wikipedia page](https://en.wikipedia.org/wiki/Triangular_matr
src/linalg/decomposition/substitution.rs:7
↓ 1 callers
Method
forward_substitution
Solve a matrix equation of the form Lx=b, where L is a lower triangular matrix. See the [Wikipedia page](https://en.wikipedia.org/wiki/Triangular_matr
src/linalg/array/matrix.rs:120
next →
1–100 of 442, ranked by callers