_LsqFit

it.grypho.scala.leonardo.optimize._LsqFit
case class _LsqFit(r: _Expression, params: Vector[_Variable], p0: _Expression, bounds: Option[(_Expression, _Expression)], cov: Boolean) extends _Expression

lsqfit(r, [[a], [b]], p0[, lb, ub][, cov]) — nonlinear least squares over a residual column (F_0063). Evaluates to the fitted parameters as an n×1 column, or with the slot word cov (not reserved, the svd(A, full) precedent) to the row [[p, C]]; stays symbolic whenever lsqfit declines, and the REPL appends why.

The parameters are binders, excluded from children. A residual over data is written cell by cell — transpose(tabulate(at(Y, k, 1) - a*exp(b*at(T, k, 1)), k, 1, N)) — since Y - a*exp(b*T) with T a column stays an unevaluated product; the curve-fit form _CurveFit builds that residual itself.

Value parameters

bounds

the lower and upper bounds

cov

whether to answer the covariance too

p0

the starting point

params

the parameters, in the order of p0

r

the residual column

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait _Expression
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

override def children: List[_Expression]

Sub-expressions subject to recursive structural traversal. Binder positions (e.g. the differentiation variable) are excluded.

Sub-expressions subject to recursive structural traversal. Binder positions (e.g. the differentiation variable) are excluded.

Attributes

Definition Classes

The solver's full answer, or why there is none; what the REPL queries — computed once per environment, so its note reads the solve eval ran (F_0212).

The solver's full answer, or why there is none; what the REPL queries — computed once per environment, so its note reads the solve eval ran (F_0212).

Attributes

override def eval(env: Environment): Either[_Expression, _Value]

Reduces this expression in the given environment.

Reduces this expression in the given environment.

Value parameters

env

variable bindings and display precision

Attributes

Returns

Right(v) when all free variables resolved to concrete values; Left(e) when reduction is partial or impossible

Definition Classes
override def rebuild(c: List[_Expression]): _Expression

Reconstructs the same node shape with replacement sub-expressions.

Reconstructs the same node shape with replacement sub-expressions.

Value parameters

newChildren

replacements in the same order and count as children

Attributes

Definition Classes
override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Any

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product

Inherited fields

lazy val freeVars: Set[String]

Cached set of free variable names; O(1) after the first access.

Cached set of free variable names; O(1) after the first access.

Attributes

Inherited from:
_Expression