Package space.kscience.kmath.optimization

Types

Link copied to clipboard
class FunctionOptimization<T>(features: FeatureSet<OptimizationFeature>, expression: DifferentiableExpression<T>) : OptimizationProblem<T>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract class OptimizationBuilder<T, R : OptimizationProblem<T>>
Link copied to clipboard
class OptimizationCovariance<T>(covariance: Matrix<T>) : OptimizationFeature
Link copied to clipboard
interface OptimizationFeature : Feature<OptimizationFeature>
Link copied to clipboard
class OptimizationLog(loggable: Loggable) : Loggable, OptimizationFeature
Link copied to clipboard
class OptimizationParameters(symbols: List<Symbol>) : OptimizationFeature
Link copied to clipboard
interface OptimizationPrior<T> : OptimizationFeature, DifferentiableExpression<T>
Link copied to clipboard
interface OptimizationProblem<T> : Featured<OptimizationFeature>
Link copied to clipboard
open class OptimizationResult<T>(point: Map<Symbol, T>) : OptimizationFeature
Link copied to clipboard
open class OptimizationStartPoint<T>(point: Map<Symbol, T>) : OptimizationFeature
Link copied to clipboard
class OptimizationValue<T>(value: T) : OptimizationFeature
Link copied to clipboard
interface Optimizer<T, P : OptimizationProblem<T>>
Link copied to clipboard
interface PointToCurveDistance : OptimizationFeature

Specify the way to compute distance from point to the curve as DifferentiableExpression

Link copied to clipboard
interface PointWeight : OptimizationFeature

Compute a wight of the point. The more the weight, the more impact this point will have on the fit. By default, uses Dispersion^-1

Link copied to clipboard
object QowOptimizer : Optimizer<Double, XYFit>

An optimizer based onf Fyodor Tkachev's quasi-optimal weights method. See the article.

Link copied to clipboard
class QowRuns(runs: Int) : OptimizationFeature
Link copied to clipboard
class XYFit(data: XYColumnarData<Double, Double, Double>, model: DifferentiableExpression<Double>, features: FeatureSet<OptimizationFeature>, pointToCurveDistance: PointToCurveDistance, pointWeight: PointWeight, xSymbol: Symbol) : OptimizationProblem<Double>

A fit problem for X-Y-Yerr data. Also known as "least-squares" problem.

Link copied to clipboard

Functions

Link copied to clipboard
suspend fun <I : Any, A : ExtendedField<I>, ExpressionAlgebra<Double, I>> XYColumnarData<Double, Double, Double>.fitWith(optimizer: Optimizer<Double, XYFit>, processor: AutoDiffProcessor<Double, I, A>, startingPoint: Map<Symbol, Double>, vararg features: OptimizationFeature = emptyArray(), xSymbol: Symbol = Symbol.x, pointToCurveDistance: PointToCurveDistance = PointToCurveDistance.byY, pointWeight: PointWeight = PointWeight.byYSigma, model: A.(I) -> I): XYFit

Fit given dta with

Link copied to clipboard
fun <T> FunctionOptimization(expression: DifferentiableExpression<T>, builder: FunctionOptimizationBuilder<T>.() -> Unit): FunctionOptimization<T>
Link copied to clipboard
inline fun <F : OptimizationFeature> OptimizationProblem<*>.getFeature(): F?
Link copied to clipboard
suspend fun Optimizer<Double, FunctionOptimization<Double>>.maximumLogLikelihood(problem: XYFit): XYFit

Optimize given XY (least squares) problem using this function Optimizer. The problem is treated as maximum likelihood problem and is done via maximizing logarithmic likelihood, respecting possible weight dependency on the model and parameters.

Link copied to clipboard
suspend fun <T> DifferentiableExpression<T>.optimizeWith(optimizer: Optimizer<T, FunctionOptimization<T>>, vararg startingPoint: Pair<Symbol, T>, builder: FunctionOptimizationBuilder<T>.() -> Unit = {}): FunctionOptimization<T>
suspend fun <T> DifferentiableExpression<T>.optimizeWith(optimizer: Optimizer<T, FunctionOptimization<T>>, startingPoint: Map<Symbol, T>, builder: FunctionOptimizationBuilder<T>.() -> Unit = {}): FunctionOptimization<T>

suspend fun <T : Any> DifferentiableExpression<T>.optimizeWith(optimizer: Optimizer<T, FunctionOptimization<T>>, startingPoint: Map<Symbol, T>, vararg features: OptimizationFeature): FunctionOptimization<T>

Optimizes differentiable expression using specific optimizer form given startingPoint.

Link copied to clipboard
fun <T> OptimizationBuilder<T, *>.startAt(startingPoint: Map<Symbol, T>)
Link copied to clipboard
fun XYFit.withFeature(vararg features: OptimizationFeature): XYFit
Link copied to clipboard
fun <T> FunctionOptimization<T>.withFeatures(vararg newFeature: OptimizationFeature): FunctionOptimization<T>
Link copied to clipboard
fun XYOptimization(data: XYColumnarData<Double, Double, Double>, model: DifferentiableExpression<Double>, builder: XYOptimizationBuilder.() -> Unit): XYFit

Properties

Link copied to clipboard
val XYFit.chiSquaredOrNull: Double?

Compute chi squared value for completed fit. Return null for incomplete fit

Link copied to clipboard
val <T> OptimizationProblem<T>.resultPoint: Map<Symbol, T>
Link copied to clipboard
val <T> OptimizationProblem<T>.resultPointOrNull: Map<Symbol, T>?
Link copied to clipboard
val <T> FunctionOptimization<T>.resultValue: T
Link copied to clipboard
val <T> FunctionOptimization<T>.resultValueOrNull: T?
Link copied to clipboard
val <T> OptimizationProblem<T>.startPoint: Map<Symbol, T>

Get the starting point for optimization. Throws error if not defined.