HEX
Server: Apache
System: Linux webm010.cluster127.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64
User: alloesb (202139)
PHP: 8.3.31
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/a/l/l/alloesb/www/wp-content/plugins/customify/js/vendor/regression.min.js
/**
 * regression-js v2.0.1
 * https://github.com/Tom-Alexander/regression-js
 *
 * @license MIT
 * https://github.com/Tom-Alexander/regression-js/blob/master/LICENSE
 */
!function(n,t){if("function"==typeof define&&define.amd)define(["module"],t);else if("undefined"!=typeof exports)t(module);else{const e={exports:{}};t(e),n.regression=e.exports}}(this,function(n){"use strict";const t=Object.assign||function(n){for(let t=1;t<arguments.length;t++){const e=arguments[t];for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t])}return n};function e(n){if(Array.isArray(n)){let t=Array(n.length);for(let e=0;e<n.length;e++)t[e]=n[e];return t}return Array.from(n)}const r={order:2,precision:2,period:null};function o(n,t){const e=[],r=[];n.forEach(function(n,o){null!==n[1]&&(r.push(n),e.push(t[o]))});const o=r.reduce(function(n,t){return n+t[1]},0)/r.length,i=r.reduce(function(n,t){const e=t[1]-o;return n+e*e},0);return 1-r.reduce(function(n,t,r){const o=e[r],i=t[1]-o[1];return n+i*i},0)/i}function i(n,t){const e=Math.pow(10,t);return Math.round(n*e)/e}const c={linear:function(n,t){const e=[0,0,0,0,0];let r=0;for(let t=0;t<n.length;t++)null!==n[t][1]&&(r++,e[0]+=n[t][0],e[1]+=n[t][1],e[2]+=n[t][0]*n[t][0],e[3]+=n[t][0]*n[t][1],e[4]+=n[t][1]*n[t][1]);const c=r*e[2]-e[0]*e[0],u=r*e[3]-e[0]*e[1],s=0===c?0:i(u/c,t.precision),l=i(e[1]/r-s*e[0]/r,t.precision),p=function(n){return[i(n,t.precision),i(s*n+l,t.precision)]},f=n.map(function(n){return p(n[0])});return{points:f,predict:p,equation:[s,l],r2:i(o(n,f),t.precision),string:0===l?"y = "+s+"x":"y = "+s+"x + "+l}},exponential:function(n,t){const e=[0,0,0,0,0,0];for(var r=0;r<n.length;r++)null!==n[r][1]&&(e[0]+=n[r][0],e[1]+=n[r][1],e[2]+=n[r][0]*n[r][0]*n[r][1],e[3]+=n[r][1]*Math.log(n[r][1]),e[4]+=n[r][0]*n[r][1]*Math.log(n[r][1]),e[5]+=n[r][0]*n[r][1]);const c=e[1]*e[2]-e[5]*e[5],u=Math.exp((e[2]*e[3]-e[5]*e[4])/c),s=(e[1]*e[4]-e[5]*e[3])/c,l=i(u,t.precision),p=i(s,t.precision),f=function(n){return[i(n,t.precision),i(l*Math.exp(p*n),t.precision)]},a=n.map(function(n){return f(n[0])});return{points:a,predict:f,equation:[l,p],string:"y = "+l+"e^("+p+"x)",r2:i(o(n,a),t.precision)}},logarithmic:function(n,t){const e=[0,0,0,0],r=n.length;for(let t=0;t<r;t++)null!==n[t][1]&&(e[0]+=Math.log(n[t][0]),e[1]+=n[t][1]*Math.log(n[t][0]),e[2]+=n[t][1],e[3]+=Math.pow(Math.log(n[t][0]),2));const c=i((r*e[1]-e[2]*e[0])/(r*e[3]-e[0]*e[0]),t.precision),u=i((e[2]-c*e[0])/r,t.precision),s=function(n){return[i(n,t.precision),i(i(u+c*Math.log(n),t.precision),t.precision)]},l=n.map(function(n){return s(n[0])});return{points:l,predict:s,equation:[u,c],string:"y = "+u+" + "+c+" ln(x)",r2:i(o(n,l),t.precision)}},power:function(n,t){const e=[0,0,0,0,0],r=n.length;for(let t=0;t<r;t++)null!==n[t][1]&&(e[0]+=Math.log(n[t][0]),e[1]+=Math.log(n[t][1])*Math.log(n[t][0]),e[2]+=Math.log(n[t][1]),e[3]+=Math.pow(Math.log(n[t][0]),2));const c=(r*e[1]-e[0]*e[2])/(r*e[3]-Math.pow(e[0],2)),u=(e[2]-c*e[0])/r,s=i(Math.exp(u),t.precision),l=i(c,t.precision),p=function(n){return[i(n,t.precision),i(i(s*Math.pow(n,l),t.precision),t.precision)]},f=n.map(function(n){return p(n[0])});return{points:f,predict:p,equation:[s,l],string:"y = "+s+"x^"+l,r2:i(o(n,f),t.precision)}},polynomial:function(n,t){const r=[],c=[];let u=0,s=0;const l=n.length,p=t.order+1;for(let t=0;t<p;t++){for(let e=0;e<l;e++)null!==n[e][1]&&(u+=Math.pow(n[e][0],t)*n[e][1]);r.push(u),u=0;const e=[];for(let r=0;r<p;r++){for(let e=0;e<l;e++)null!==n[e][1]&&(s+=Math.pow(n[e][0],t+r));e.push(s),s=0}c.push(e)}c.push(r);const f=function(n,t){const e=n,r=n.length-1,o=[t];for(let n=0;n<r;n++){let t=n;for(let o=n+1;o<r;o++)Math.abs(e[n][o])>Math.abs(e[n][t])&&(t=o);for(let o=n;o<r+1;o++){const r=e[o][n];e[o][n]=e[o][t],e[o][t]=r}for(let t=n+1;t<r;t++)for(let o=r;o>=n;o--)e[o][t]-=e[o][n]*e[n][t]/e[n][n]}for(let n=r-1;n>=0;n--){let t=0;for(let i=n+1;i<r;i++)t+=e[i][n]*o[i];o[n]=(e[r][n]-t)/e[n][n]}return o}(c,p).map(function(n){return i(n,t.precision)}),a=function(n){return[i(n,t.precision),i(f.reduce(function(t,e,r){return t+e*Math.pow(n,r)},0),t.precision)]},h=n.map(function(n){return a(n[0])});let g="y = ";for(let n=f.length-1;n>=0;n--)g+=n>1?f[n]+"x^"+n+" + ":1===n?f[n]+"x + ":f[n];return{string:g,points:h,predict:a,equation:[].concat(e(f)).reverse(),r2:i(o(n,h),t.precision)}}};n.exports=Object.keys(c).reduce(function(n,e){return t({_round:i},n,(s=function(n,o){return c[e](n,t({},r,o))},(u=e)in(o={})?Object.defineProperty(o,u,{value:s,enumerable:!0,configurable:!0,writable:!0}):o[u]=s,o));var o,u,s},{})});