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": "ols",
  "method": "statsmodels",
  "dataset": "prostate",
  "formula": "lcavol ~ lweight + age + lbph + svi + lcp + gleason + pgg45 + lpsa",
  "n": 97,
  "k": 8,
  "df_residual": 88,
  "variable_names": [
    "Intercept",
    "lweight",
    "age",
    "lbph",
    "svi",
    "lcp",
    "gleason",
    "pgg45",
    "lpsa"
  ],
  "coefficients": [
    -2.420612677468017,
    -0.02592501595313611,
    0.02211318860609609,
    -0.09313839276613638,
    -0.15296648397562806,
    0.3671799273581572,
    0.19724921786369295,
    -0.0071173479101549674,
    0.5658259787397043
  ],
  "std_errors": [
    1.2970274399030135,
    0.2118165727554283,
    0.011080045227358202,
    0.05805766826315426,
    0.25428873545773506,
    0.08181430071005688,
    0.1542066506012278,
    0.0043309299976101645,
    0.08806453056693662
  ],
  "t_stats": [
    -1.8662771526630313,
    -0.1223937089335788,
    1.995766998450105,
    -1.6042392943508164,
    -0.6015464416867667,
    4.487967557889574,
    1.2791226389695183,
    -1.6433763450534566,
    6.42512910813313
  ],
  "p_values": [
    0.06533334737744978,
    0.9028663006438177,
    0.04905161605048833,
    0.11224448077435399,
    0.5490226664749707,
    2.1671829385215447e-05,
    0.20421651738247687,
    0.10387352009159394,
    6.548216391611521e-09
  ],
  "r_squared": 0.6762746554982422,
  "adj_r_squared": 0.6468450787253551,
  "f_statistic": 22.979421712964676,
  "f_p_value": 1.4520660426755573e-18,
  "mse": 0.49058749077511726,
  "std_error": 0.7004195105614329,
  "log_likelihood": -98.37503596899981,
  "aic": 214.75007193799962,
  "bic": 237.92247074453007,
  "conf_int_lower": [
    -4.998182163195194,
    -0.44686594419327275,
    9.392702389616689e-05,
    -0.20851580848123308,
    -0.6583119106915193,
    0.20459119675881163,
    -0.10920409596568834,
    -0.015724161199698928,
    0.39081622969291646
  ],
  "conf_int_upper": [
    0.15695680825916014,
    0.3950159122870005,
    0.04413245018829601,
    0.022239022948960324,
    0.35237894274026316,
    0.5297686579575027,
    0.5037025316930742,
    0.0014894653793889922,
    0.7408357277864921
  ],
  "residuals": [
    0.2470881035651027,
    -0.48177883539240507,
    -0.4233563030502156,
    -0.6924543662050707,
    0.8761619866666308,
    -0.8878761517771094,
    0.7822836720947168,
    0.90817187121846,
    -0.6996675203264133,
    -0.06145317035456738,
    -0.18912996793433856,
    -1.499642237760129,
    0.9255800130508142,
    0.7657765666111547,
    0.3478355996707716,
    0.9593616906954856,
    -1.115368719440675,
    1.050470948469323,
    -0.6486644468868817,
    -0.27082226078058635,
    0.6210041095828029,
    0.7095303414028025,
    -1.0495438074418089,
    0.5832979172529973,
    -0.13018465614258812,
    0.7988160433299721,
    -0.1444600944443919,
    -0.9492154233802461,
    0.20603188305013942,
    0.5011764720471883,
    -0.4217950841491129,
    -0.38779091408203803,
    0.5119085036743187,
    -0.626272105792046,
    -1.0772253501574416,
    0.6064776438838974,
    -1.0306386332716875,
    -0.6098136296635954,
    0.9075698647313726,
    -0.42893937990859476,
    -0.3301250396687776,
    0.2192362312110998,
    -0.45049809244533046,
    -0.1644060016587403,
    0.19151307414050467,
    0.6711777195241663,
    0.3406193991068309,
    -0.04706508124680986,
    1.0362069977388169,
    -0.042677908373180085,
    -0.03586359420442653,
    0.7788532033798132,
    -0.6679301361067488,
    0.16522368696328193,
    1.865026130609531,
    0.23383621459297976,
    -0.8127133669229741,
    -0.2245766658535298,
    -0.7531515646457957,
    0.1750302885241405,
    -0.6848117211427545,
    0.013292160398927111,
    0.2805864158655753,
    0.07816073014798808,
    0.7381615254609433,
    0.03878728058616865,
    0.18610845946504684,
    0.5189772801719734,
    -1.9171541883536405,
    -0.371163379763354,
    -0.06900095375794879,
    -0.2849514843562153,
    -0.8169599627089579,
    -0.09689891299140618,
    0.2248973319434504,
    0.4887920271457942,
    0.09463904500636033,
    0.8185043827316112,
    -0.1280688578889908,
    0.627845724485669,
    -0.606698155193262,
    -0.001344155493073096,
    0.14550120534669464,
    -0.07561154810106396,
    -0.5847082034311895,
    0.560557498437317,
    0.6548718006162173,
    -0.4855199302874238,
    -0.17581219998482212,
    -0.7660799081207943,
    1.1859845179627007,
    0.8769038610556459,
    -0.04872727400163068,
    0.8504493088798353,
    -0.8342923189810234,
    -0.28738533781028286,
    -0.7779977306608283
  ],
  "vif": [
    {
      "variable": "lweight",
      "vif": 1.611373915499693,
      "rsquared": 0.3794115751899234
    },
    {
      "variable": "age",
      "vif": 1.3316217814105702,
      "rsquared": 0.24903601461016012
    },
    {
      "variable": "lbph",
      "vif": 1.3883309400165056,
      "rsquared": 0.2797106430631653
    },
    {
      "variable": "svi",
      "vif": 2.1686972403068627,
      "rsquared": 0.5388936816932068
    },
    {
      "variable": "lcp",
      "vif": 2.5608410842512384,
      "rsquared": 0.6095032971199035
    },
    {
      "variable": "gleason",
      "vif": 2.426591557254666,
      "rsquared": 0.5878993327037889
    },
    {
      "variable": "pgg45",
      "vif": 2.9197090045322436,
      "rsquared": 0.6575001144128723
    },
    {
      "variable": "lpsa",
      "vif": 2.022162633919932,
      "rsquared": 0.5054799335988545
    }
  ]
}