Package: salad 1.1

Hervé Perdry

salad: Simple Automatic Differentiation

Handles both vector and matrices, using a flexible S4 class for automatic differentiation. The method used is forward automatic differentiation. Many functions and methods have been defined, so that in most cases, functions written without automatic differentiation in mind can be used without change.

Authors:Hervé Perdry [aut, cre]

salad_1.1.tar.gz
salad_1.1.tar.gz(r-4.5-noble)salad_1.1.tar.gz(r-4.4-noble)
salad_1.1.tgz(r-4.4-emscripten)salad_1.1.tgz(r-4.3-emscripten)
salad.pdf |salad.html
salad/json (API)
NEWS

# Install 'salad' in R:
install.packages('salad', repos = c('https://cran.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

This package does not link to any Github/Gitlab/R-forge repository. No issue tracker or development information is available.

2.30 score 9 scripts 507 downloads 39 exports 0 dependencies

Last updated 1 months agofrom:f69e9e54e6. Checks:OK: 2. Indexed: yes.

TargetResultDate
Doc / VignettesOKDec 05 2024
R-4.5-linuxOKDec 05 2024

Exports:%o%applyarrayas.matrixatan2betacbind2choosecolMeanscolSumsddetdiagdiag<-dnormdnorm.dualdualdualFun1gradient.descentifelselbetalchooselogNepermatrixmatrixprod_ddmatrixprod_dnmatrixprod_ndoptiWrapouterpsigammarbind2rowMeansrowSumssaladsolvevaluevarnameswhich.maxwhich.min

Dependencies:

salad package

Rendered fromsalad.Rmdusingknitr::rmarkdownon Dec 05 2024.

Last update: 2024-11-04
Started: 2024-06-25

Readme and manuals

Help Manual

Help pageTopics
Apply functions over array margins of dual objectsapply,dual-method
Arithmetic Operators*,dual,dual-method *,dual,numeric-method *,numeric,dual-method +,dual,dual-method +,dual,missing-method +,dual,numericOrArray-method +,numericOrArray,dual-method -,dual,dual-method -,dual,missing-method -,dual,numericOrArray-method -,numericOrArray,dual-method /,dual,dual-method /,dual,numeric-method /,numeric,dual-method Arithmetic ^,dual,dual-method ^,dual,numeric-method ^,numeric,dual-method
Binding methods for dual objectsbind cbind2,dual,dual-method cbind2,dual,missing-method cbind2,dual,numericOrArray-method cbind2,numericOrArray,dual-method rbind2,dual,dual-method rbind2,dual,missing-method rbind2,dual,numericOrArray-method rbind2,numericOrArray,dual-method rbind2_dd
Concatenation methodsc c,numericOrArray-method c-dual concat0
Row and column sums and meanscolMeans colMeans,dual-method colMeans.dual colSums colSums,dual-method colSums.dual rowMeans rowMeans,dual-method rowMeans.dual rowSums rowSums,dual-method rowSums.dual
Comparison OperatorsCompare,dual,ANY-method Comparison
get list of derivativesd d.dual d.numeric value value.dual value.numeric varnames varnames.dual varnames.numeric
Matrix diagonalsdiag diag,dual-method diag.dual diag<-,dual,dual-method diag<-,dual,numericOrArray-method
Normal distributiondnorm dnorm.dual
Dual objectsdual
dual classdual-class
Defining in-house derivativesdualFun1
Extract or replace parts of an objectExtract [,dual,index,index-method [,dual,index,missing-method [,dual,missing,index-method [,dual,missing,missing-method [<-,dual,index,index,dual-method [<-,dual,index,index,logicalOrNumericOrArray-method [<-,dual,index,missing,dual-method [<-,dual,index,missing,logicalOrNumericOrArray-method [<-,dual,missing,index,dual-method [<-,dual,missing,index,logicalOrNumericOrArray-method [<-,dual,missing,missing,dual-method [<-,dual,missing,missing,logicalOrNumericOrArray-method
Gradient descentgradient.descent
Conditionnal Element Selectionifelse ifelse,ANY,dual,numericOrArrayOrDual-method ifelse,ANY,numericOrArray,dual-method
Determinant and matrix inversion for dual matricesdet det,dual-method det.dual determinant determinant.dual inversion solve solve,dual,dual-method solve,dual,missing-method solve,dual,numericOrArray-method solve,numericOrArray,dual-method
Mathematical functionsabs.dual acos.dual acosh.dual asin.dual asinh.dual atan.dual atan2,dual,dual-method atan2,dual,numericOrArray-method atan2,numericOrArray,dual-method atanh.dual beta,dual,dual-method beta,dual,numericOrArray-method beta,numericOrArray,dual-method ceiling.dual choose,dual,numeric-method cos.dual cosh.dual cospi.dual digamma.dual exp.dual expm1.dual factorial.dual floor.dual gamma.dual lbeta,dual,dual-method lbeta,dual,numericOrArray-method lbeta,numericOrArray,dual-method lchoose,dual,numeric-method lfactorial.dual lgamma.dual log.dual log10.dual log1p.dual log2.dual logNeper MathFun psigamma,dual-method psigamma.dual sign.dual sin.dual sinh.dual sinpi.dual sqrt.dual tan.dual tanh.dual tanpi.dual trigamma.dual trunc.dual
Matrix Arithmetic%*%,dual,dual-method %*%,dual,numericOrArray-method %*%,numericOrArray,dual-method crossprod,dual,dual-method crossprod,dual,missing-method crossprod,dual,numericOrArray-method crossprod,numericOrArray,dual-method matmult matrixprod_dd matrixprod_dn matrixprod_nd tcrossprod,dual,dual-method tcrossprod,dual,missing-method tcrossprod,dual,numericOrArray-method tcrossprod,numericOrArray,dual-method
Methods for `matrix`, `array`, `as.matrix` and `as.vector`array,dual-method as as.matrix,dual-method as.matrix.dual as.vector,dual-method as.vector.dual matrix matrix,dual-method
Wrapper for optimisation with automatically computed gradientoptiWrap
Outer product for dual objects%o%,dual,dual-method %o%,dual,numericOrArray-method %o%,numericOrArray,dual-method outer outer,dual,dual-method outer,dual,numericOrArray-method outer,numericOrArray,dual-method outer.dual
Replicate elements of a dual vectorrep rep.dual
Salad optionssalad
Dual objects length, dim, names and dimnamesdim.dual dim<-.dual dimnames.dual dimnames<-.dual length.dual names.dual names<-.dual shape
Summary methods for objects of class dualmax max,numericOrArray-method max.dual min min,numericOrArray-method min.dual prod prod,numericOrArray-method prod.dual range range,numericOrArray-method range.dual sum sum,numericOrArray-method sum.dual Summary which.max which.max,dual-method which.min which.min,dual-method
Transposition of matrices and arraysaperm aperm.dual t t.dual