-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Hi, I have a function to fit such as
func (b Model) Find(dst, params []float64) {
n := len(b.Data)
fittedCurve := make([]float64, n)
invtrig := 0.0
for i := 0; i < n; i++ {
invtrig = math.Asinh(math.Sinh(params[2]) * math.Exp(params[0]*float64(i + 1)*2*math.Pi))
fittedCurve[i] = (1 / (params[0] * params[1])) * (params[2] - invtrig)
dst[i] = b.Data[i] - fittedCurve[i]
}
}
However I am not sure if I am constructing the dst value correctly for a least squares algorithm. I cant tell whether I need to do something like dst[i] = math.Sqrt(math.Pow(dst[i])) each loop. Or is the least squares part of the error handled by the algorithm itself?
thanks
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels