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": "wls",
  "method": "statsmodels",
  "dataset": "synthetic_interaction",
  "formula": "x1 ~ x2 + y",
  "n": 100,
  "k": 2,
  "df_residual": 97,
  "df_model": 2,
  "variable_names": [
    "Intercept",
    "x2",
    "y"
  ],
  "coefficients": [
    2.721514863793808,
    -0.7696172405071738,
    0.1924250941157753
  ],
  "std_errors": [
    0.1836719626465872,
    0.04322201188534242,
    0.00602965921020192
  ],
  "t_stats": [
    14.81725803208417,
    -17.806141059531953,
    31.913096148153855
  ],
  "p_values": [
    1.1799746135719382e-26,
    2.4830887805998555e-32,
    3.0475673352243404e-53
  ],
  "r_squared": 0.9176697072164618,
  "adj_r_squared": 0.9159721754064919,
  "f_statistic": 540.5905808815186,
  "f_p_value": 2.538887766520692e-53,
  "mse": 0.7120941247658426,
  "rmse": 0.8438566968187445,
  "mae": 0.6404972214262366,
  "residual_std_error": 0.8438566968187445,
  "log_likelihood": -123.3936340160982,
  "aic": 252.7872680321964,
  "bic": 260.6027785901607,
  "conf_int_lower": [
    2.356976860908432,
    -0.8554009696421849,
    0.18045788967752477
  ],
  "conf_int_upper": [
    3.086052866679184,
    -0.6838335113721628,
    0.20439229855402583
  ],
  "fitted_values": [
    2.5869397043819347,
    6.895173745886006,
    10.381904504739538,
    5.341128919601022,
    10.551118896683562,
    1.3138855357153003,
    3.7284198932584287,
    2.4513966128735145,
    6.980993997300235,
    7.3577084859877475,
    1.7332898704085782,
    6.157437212643019,
    3.3698003547767152,
    5.087500233177737,
    4.48936412780686,
    9.056953855633214,
    6.119370041374146,
    2.8814949636805505,
    3.081210565196216,
    1.1359532034234032,
    3.3341484450212246,
    1.8425356789747047,
    9.047532922411225,
    5.132720819867743,
    5.153861526004915,
    2.127849829407989,
    7.681045795932718,
    7.506946042743405,
    1.3965597523777658,
    6.340583571492953,
    5.304858944005123,
    0.051124258208180784,
    4.6700152681314595,
    4.911639337356608,
    1.334316604741912,
    10.10334485202792,
    6.369892967899461,
    5.855283756656459,
    4.560570093167164,
    4.41240503281038,
    6.056823750613871,
    5.352832594980931,
    0.4649029796484818,
    4.96571090654053,
    7.219560772780582,
    4.2921333218517255,
    1.101414041914723,
    8.566115134998835,
    1.7403611812299005,
    3.557254334799486,
    1.363499397026926,
    3.612667526218578,
    7.455665155030056,
    4.790539136265275,
    3.1980149912006506,
    9.258984696615247,
    7.202000114062049,
    9.25740133635909,
    2.9910940410263542,
    4.319719319878612,
    9.871936370159146,
    7.257835649189502,
    1.7587834450706736,
    2.095091206529514,
    4.69895772978334,
    7.594622903285345,
    5.295480795578891,
    4.83131663659861,
    -0.058720007522910844,
    6.567047752381124,
    8.445300461201487,
    3.7169938095332835,
    6.591361408043235,
    10.863519652302784,
    1.781176963567198,
    4.986080022478458,
    3.6461384606636775,
    7.051764436522367,
    5.328456495615967,
    6.502032960298151,
    7.600976466823115,
    3.90527808461891,
    10.423626838064358,
    4.9541027667083775,
    2.1457377942575944,
    5.8264677255372135,
    8.14138074165517,
    2.4893721367780284,
    7.0896366932260815,
    9.54897847599021,
    3.2834243867782016,
    10.916446605160072,
    0.7548163373370622,
    1.3717840691887693,
    3.575632008369206,
    9.983329003185752,
    6.448786125897896,
    2.495732806192349,
    4.175527003218625,
    5.489534288069093
  ],
  "residuals": [
    -2.3687057366270396,
    -0.25727688413011496,
    -0.7479601626040342,
    0.2605529150173975,
    -1.1828942763526413,
    -0.7913067428550626,
    0.45951329748318503,
    0.15018129674699754,
    0.3272156525070624,
    2.455262418984721,
    0.8320107540338997,
    0.3843088020977259,
    -1.388824027179314,
    0.565802312538362,
    0.14996073907650143,
    0.6630994406821564,
    -0.03409731440947983,
    0.6135687571876374,
    -1.9402527163168826,
    0.37651508392594235,
    -1.080979145508874,
    0.6671309344282754,
    -0.5413723439998464,
    0.4795070629575058,
    0.08004758773874876,
    -0.9801611107158141,
    0.9203511375616316,
    -0.27880301065856816,
    -0.7198761333777499,
    0.7377674008047332,
    0.1305232294213372,
    0.7661291992596018,
    -0.08700885284489512,
    -0.06467646605613808,
    0.3234287968908456,
    -0.6463633820250969,
    2.129860746907158,
    0.8349396166346237,
    0.062385516838907584,
    -0.29474961696529434,
    0.4529109208956701,
    0.10148609908812478,
    0.15782807917037434,
    0.15931558116278666,
    0.8444753995478127,
    0.3002654541178549,
    -0.5818482663720388,
    -0.7033331411585042,
    0.27327664012984343,
    -0.9710459859190976,
    0.2835641372960329,
    -0.3105168775036029,
    0.11184990185629395,
    0.4033194587740976,
    -1.1492022496935248,
    -0.4806839150948381,
    1.5938184354532439,
    -0.5516170858990197,
    -0.6031319272109616,
    0.19267412193126887,
    -0.02203980875039413,
    0.4622891139104004,
    -1.4871092328150755,
    -1.4430452939245935,
    -0.05964396166001151,
    1.4975791553302562,
    0.09153718394825106,
    0.14680844374429292,
    1.1134570070892167,
    0.0007532948618163005,
    -0.22426885519923268,
    0.08720626554233979,
    1.1647571012100402,
    -1.2187531132946692,
    0.256487627709693,
    0.24721628946895535,
    -0.7747588798179215,
    0.8767797538160265,
    0.44747716319560826,
    -0.1562087847951137,
    0.3781651293358266,
    0.05442664200563874,
    -1.2727261539939256,
    0.37618590575302235,
    -0.5661895659041143,
    1.1325234561508113,
    -0.20876723727262547,
    0.6782446338972381,
    1.482155876761448,
    -0.4875459283325476,
    -0.5143795130001125,
    -1.081231878007852,
    0.652298943150522,
    0.6483726148361306,
    -1.7333836159889446,
    -1.043431903107047,
    0.09413939735172239,
    -0.9746899739696204,
    0.22770718046486493,
    0.6634459626289271
  ],
  "weights": [
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0,
    1.0
  ]
}