Minimum multiplier curve fit

zhaozj2021-02-08  228

// Minimum multiplier curve fitting TypedEf Carray cdoubleArray; Bool CalculateCurveParameter (CDOUBLARRAY * X, CDOUBLARRAY * Y, Long M, long N, cdoublearray * a) {// x, y - x, y Coordinate // m - Result Variable Group // N - Sample Number // A - Result Parameters

Register Long i, J, K; Double Z, D1, D2, C, P, G, Q; CDoubleArray B, T, S; B.setsize (n); T.setSize (n); s.setsize (n) ; If (m> n) m = n; for (i = 0; I 1) {t [1] = 1; T [0] = - p; d2 = 0; c = 0 ; G = 0; for (i = 0; i = 3) {for (k = j-2; k > = 1; k - p * t [k] t [k-1] -q * b [k];} s [0] = - p * t [0] -q * B [0]; D2 = 0; c = 0; g = 0; for (i = 0; i = 0 ; k - q = q * ((* x) [i] -z) s [k]; d2 = D2 q * q; c = (* y) [i] * q C; g = ((* X) [i] -z) * q * q g;} C = C / D2; P = g / d2; q = D2 / d1; D1 = D2; (* a) [j] = c * S [j]; t [j] = s [j]; for (k = j-1; k> = 0; k -) {(* a) [k] = c * s [k] ( * A) [k]; b [k] = t [k]; t [k] = s [k];}} return true;

转载请注明原文地址:https://www.9cbs.com/read-2279.html

New Post(0)