function update [math]\Longrightarrow[/math] edit js.script [br]loading x2, y2 from AlgebraView.[br][size=85](a version with transfer of the function as ggb-text to js doubles the runtime in this case!)[/size][br][br][color=#0000ff]depending on the version the sandbox of this side prevents [color=#0000ff]alert() [/color]messages displayed and the js.code from being executed - all alert()s have been disabled - close run by writing to green message box - click to clear![br]feel free to download Applet.ggb 4 local-ggb-installations or Offline Activity (.zip) 4 stand alone run from [url=https://www.geogebra.org/material/show/id/mn8fd2bh]Details page[/url][math]\nearrow[/math] and restore alert()s.[/color][br][br][br]based on [url=https://www.theneverendingstory.it/2024/01/06/multivariate-nonlinear-regression/]Salvatore Pragliola[/url][math]\nearrow[/math] [br][size=85]with[br][code]/* Your data. Please make sure that all vectors have the same dimension */[br]const x1 = [55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55];[br]const x2 = [0.001256, 0.007716, 0.01337, 0.019026, 0.027493, 0.033133, 0.050034, 0.066534, 0.086245, 0.105553, 0.125261, 0.156229, 0.189204, 0.232631, 0.265603, 0.28812, 0.32109, 0.345216, 0.377782, 0.410752, 0.433669, 0.467039, 0.488748];[br]const y = [15.5113, 16.3797, 17.1882, 18.0416, 18.8204, 19.2249, 19.8249, 20.4399, 20.9205, 21.386, 21.8068, 22.3632, 22.8748, 23.4324, 23.8543, 24.1107, 24.4727, 24.7592, 25.0613, 25.4084, 25.6349, 25.9222, 26.0588];[br]function Ulberg(u_p, x1, x2, y) {[br] result = [];[br] if (!((x1.length == x2.length) || (x2.length == y.length))) {[br] alert("I vettori hanno grandezze diverse");[br] }[br] for (var i = 0; i < y.length; i++) {[br] //Funzione completa[br] //valore_funzione = u_p[0] * Math.exp(-(x2[i] - u_p[1]) * (x2[i] - u_p[1]) / u_p[2]) + u_p[3];[br] valore_funzione = (12) + ((u_p[0] + u_p[1] * x1[i]) / 1) * x2[i] + u_p[2] * Math.log10(1 + ((u_p[3] + (u_p[4] / x1[i]) + (u_p[5] / (x1[i] * x1[i]))) / 1) * x2[i]);[br] result.push(valore_funzione);[br] }[br] //console.log("Sono stata eseguita");[br] return result;[br]---[br]ggb[br]start: {1,1,1,1,1,1}[br]Number_ofIterations: 100000[br]h gradient: 0.01[br]f(x):=Substitute( (12) + ((r1 + r2*55)/1)*x+ s*log10(1 + ((t1 + (t2/55) + (t3/(55^2)))/1)*x) , {r1, r2, s, t1,t2,t3} = Params)[br][/code][/size][br]---[br]transfer function text form inputbox[br][i]function="(12)+((a[0]+a[1]*55))*x+a[2]*Math.log10(1+((a[3]+(a[4]/55)+(a[5]/(55*55))))*x)"[/i][br][size=85]var ggbFunction = "return (" + ggbApplet.getValueString("function") + ")"[br]valore_funzione = new Function('x', 'a', ggbFunction);[/size][br]run time ~ 30 sec (double to native js.function)[br]ggb classic 6.x alert() dont stop code - better use ggb 5.2!