linreg-core 0.8.1

Lightweight regression library (OLS, Ridge, Lasso, Elastic Net, WLS, LOESS, Polynomial) with 14 diagnostic tests, cross validation, and prediction intervals. Pure Rust - no external math dependencies. WASM, Python, FFI, and Excel XLL bindings.
Documentation
{
  "test": "polynomial",
  "method": "statsmodels",
  "dataset": "prostate",
  "formula": "lcavol ~ poly(lweight, 2, raw=True)",
  "degree": 2,
  "n": 97,
  "k": 2,
  "df_residual": 94,
  "df_model": 2,
  "variable_names": [
    "Intercept",
    "x^1",
    "x^2"
  ],
  "coefficients": [
    -8.783691519041808,
    4.854339365118506,
    -0.5604442805055297
  ],
  "std_errors": [
    5.403327472743411,
    2.9700709467120134,
    0.4060383806746729
  ],
  "t_stats": [
    -1.6256078431948338,
    1.6344186560568368,
    -1.3802741493902526
  ],
  "p_values": [
    0.10738132093683538,
    0.10551577394405383,
    0.1707759847555313
  ],
  "r_squared": 0.09699403381731342,
  "adj_r_squared": 0.07778114091980948,
  "f_statistic": 5.0483825801118325,
  "f_p_value": 0.008269116807601368,
  "mse": 1.281106417514122,
  "rmse": 1.1318597163580486,
  "mae": 0.9179331159941739,
  "residual_std_error": 1.1318597163580486,
  "log_likelihood": -148.12797072594975,
  "aic": 302.2559414518995,
  "bic": 309.9800743874097,
  "conf_int_lower": [
    -19.512124880255683,
    -1.042806123585133,
    -1.3666430036326487
  ],
  "conf_int_upper": [
    1.944741842172066,
    10.751484853822145,
    0.24575444262158908
  ],
  "fitted_values": [
    0.361648970788527,
    1.1548503193006572,
    0.2213357114230791,
    1.1123384453328649,
    1.2755144298299368,
    1.0473161611843986,
    1.3159999681538608,
    1.376970933397299,
    1.376970933397299,
    1.0665923418719647,
    1.4319523270982637,
    1.4274908986145582,
    0.7691363014380911,
    0.7326845398725484,
    1.2851761112044777,
    0.824308743260896,
    1.3558218921123728,
    1.4676388617186396,
    1.094445300005914,
    1.5847189749850024,
    1.2623201293645545,
    1.3420244852673189,
    1.216835551206899,
    1.2946438224205534,
    1.4812364289387012,
    0.9124422843554366,
    1.5185597823511987,
    1.60679796870392,
    0.9183615952616014,
    1.216835551206899,
    1.695434113531928,
    1.5726119434434396,
    0.7902660306335376,
    1.094445300005914,
    1.0324731676052106,
    1.7029458158493103,
    1.4735413757768592,
    -0.4160976210930212,
    1.6940624376471216,
    0.7547447361431652,
    0.9358382535964012,
    1.4924168177658845,
    1.60679796870392,
    1.6223765803256662,
    1.2521832523806076,
    1.2348159846300533,
    1.6648568990053034,
    1.6788898238334575,
    1.3392096581946176,
    1.4018910852600988,
    1.6641626066425141,
    1.7227232588021628,
    1.4554869484871085,
    1.703328092442462,
    1.3558218921123728,
    1.7264459614824867,
    0.5238267276923966,
    1.5482706841553338,
    1.7148387660184987,
    1.5989814971566447,
    1.7068554534249494,
    1.5185597823511987,
    1.3638840171413478,
    1.6319264895859467,
    1.4471216310480663,
    1.5907975257431837,
    1.613216404820687,
    1.6839831172123436,
    1.7244964823777287,
    1.6146026217637457,
    1.4229712887846597,
    1.178922930039791,
    1.5847189749850024,
    1.057026883864807,
    1.5978350294222006,
    1.0898886068572657,
    1.7219395366280708,
    1.7275620148750108,
    1.4137544687748993,
    1.58347959040952,
    0.8375303208196052,
    1.3159999681538608,
    1.6183732168857072,
    1.5919895755683022,
    1.5118316860136543,
    1.3585266620504204,
    1.5267316139561105,
    1.2094643917783836,
    1.6438361228272715,
    1.5014110476152231,
    1.6984997234589398,
    1.4887378713376773,
    1.6121644902066934,
    1.6223765803256662,
    1.238338023731977,
    1.5540785898360254,
    1.6569367500246528
  ],
  "residuals": [
    -0.941467465788527,
    -2.149102592300657,
    -0.732161335423079,
    -2.316311249332865,
    -0.5240983408299368,
    -2.097138285184399,
    -0.5788359021538608,
    -0.6838237523972991,
    -2.153499722397299,
    -0.8434487908719648,
    -1.1773101090982636,
    -2.7745645466145583,
    0.8442936325619089,
    0.7443641841274516,
    -0.0792053042044778,
    0.7168503287391039,
    -1.7713373361123728,
    0.8208473072813605,
    -1.6565642180059141,
    -1.4023974179850023,
    -0.11491767636455452,
    0.717214348732681,
    -1.761562726206899,
    0.48706531057944646,
    -1.0959740279387011,
    0.5344766986445634,
    -1.0057361563511988,
    -2.00727553570392,
    0.12191511673839861,
    1.192808613793101,
    -1.410255171531928,
    -1.3902903864434395,
    0.4850967693664623,
    -1.084494969005914,
    -1.0425235036052105,
    -0.3946129958493103,
    -0.050433041776859255,
    0.8735224680930211,
    0.9668961563528782,
    0.0427624598568348,
    -0.3152617655964012,
    -0.05021482476588446,
    -1.02458234870392,
    0.14918018167433367,
    0.23395644361939238,
    0.42911011336994664,
    1.0629959289946966,
    -0.5157390138334574,
    0.40650587280538253,
    -0.18106116426009877,
    -0.5722393056425141,
    -0.06259223180216278,
    -0.9426633224871085,
    0.4237124275575379,
    1.7977684658876274,
    -0.45949835848248677,
    0.4507329123076034,
    -1.0845366681553337,
    -1.1725144750184988,
    -0.5377249951566447,
    -1.2494306064249494,
    0.4788579236488013,
    1.4118248328586522,
    0.40277915841405343,
    0.6260502979519336,
    -0.13218250274318377,
    0.4096547851793131,
    0.5143519547876563,
    -2.1707835853777286,
    -0.4206801537637457,
    0.4411088422153402,
    -0.018902013039791,
    -0.3698062309850023,
    0.781934187135193,
    1.4013911335777993,
    2.051241869142734,
    0.28895546237192926,
    0.810095200124989,
    1.234545728225101,
    1.19596060659048,
    0.6303440271803948,
    1.1976560948461392,
    0.9946334351142929,
    1.0856014184316978,
    0.05051461898634568,
    1.9443225969495794,
    0.49746145304388967,
    0.5221911532216164,
    1.1637577081727286,
    0.060935257384776786,
    1.5479912685410602,
    1.0441649766623227,
    1.2181033437933064,
    2.198627026674334,
    1.6691093352680229,
    1.3284849851639744,
    1.815029702975347
  ]
}