@@ -137,6 +137,24 @@ public suspend fun XYColumnarData<Double, Double, Double>.fitWith(
137
137
return optimizer.optimize(problem)
138
138
}
139
139
140
+ public suspend fun XYColumnarData <Double , Double , Double >.fitWith (
141
+ optimizer : Optimizer <Double , XYFit >,
142
+ modelExpression : DifferentiableExpression <Float64 >,
143
+ startingPoint : Map <Symbol , Double >,
144
+ attributesBuilder : AttributesBuilder <XYFit >.() -> Unit ,
145
+ xSymbol : Symbol = Symbol .x,
146
+ pointToCurveDistance : PointToCurveDistance = PointToCurveDistance .byY,
147
+ pointWeight : PointWeight = PointWeight .byYSigma,
148
+ ): XYFit = fitWith(
149
+ optimizer = optimizer,
150
+ modelExpression = modelExpression,
151
+ startingPoint = startingPoint,
152
+ attributes = Attributes <XYFit >(attributesBuilder),
153
+ xSymbol = xSymbol,
154
+ pointToCurveDistance = pointToCurveDistance,
155
+ pointWeight = pointWeight
156
+ )
157
+
140
158
/* *
141
159
* Fit given data with a model provided as an expression
142
160
*/
@@ -166,6 +184,26 @@ public suspend fun <I : Any, A> XYColumnarData<Double, Double, Double>.fitWith(
166
184
)
167
185
}
168
186
187
+ public suspend fun <I : Any , A > XYColumnarData <Double , Double , Double >.fitWith (
188
+ optimizer : Optimizer <Double , XYFit >,
189
+ processor : AutoDiffProcessor <Double , I , A >,
190
+ startingPoint : Map <Symbol , Double >,
191
+ attributesBuilder : AttributesBuilder <XYFit >.() -> Unit ,
192
+ xSymbol : Symbol = Symbol .x,
193
+ pointToCurveDistance : PointToCurveDistance = PointToCurveDistance .byY,
194
+ pointWeight : PointWeight = PointWeight .byYSigma,
195
+ model : A .(I ) -> I ,
196
+ ): XYFit where A : ExtendedField <I >, A : ExpressionAlgebra<Double, I> = fitWith(
197
+ optimizer = optimizer,
198
+ processor = processor,
199
+ startingPoint = startingPoint,
200
+ attributes = Attributes <XYFit >(attributesBuilder),
201
+ xSymbol = xSymbol,
202
+ pointToCurveDistance = pointToCurveDistance,
203
+ pointWeight = pointWeight,
204
+ model = model
205
+ )
206
+
169
207
/* *
170
208
* Compute chi squared value for completed fit. Return null for incomplete fit
171
209
*/
0 commit comments