{"slug":"hubvibe-io-com-work-stats-probability-5fb5dc","title":"Deterministic statistics over (x, y) points","host":"hubvibe-io.com","method":"POST","resource":"https://hubvibe-io.com/work/stats/probability","category":"other","description":"Deterministic statistics over (x, y) points: ordinary least squares linear regression with standard errors and confidence intervals, a fitted normal distribution with quantiles and probability queries, exact Student t and Jarque-Bera p-values validated at your alpha, and predictions with prediction ","price_listed":0.5,"price_asked":0.5,"state":"answering","state_label":"Answering","checks_7d":1,"answered_7d":1,"latency_ms_median":1057,"reported_calls_30d":1,"reported_payers_30d":1,"networks":["eip155:8453","solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp"],"badge":"unverified","paid_checks_7d":0,"paid_ok_7d":0,"example_input":{"body":{"points":[[1,2.1],[2,3.9],[3,6.2],[4,7.8],[5,10.1]],"predict_x":[6],"probability_queries":[{"below":8}]},"bodyType":"json","method":"POST","type":"http"},"output_schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"input":{"additionalProperties":false,"properties":{"body":{"additionalProperties":false,"oneOf":[{"required":["points"]},{"required":["table","x_column","y_column"]}],"properties":{"alpha":{"description":"Significance level for p-value validation and intervals. Default 0.05.","exclusiveMaximum":1,"exclusiveMinimum":0,"type":"number"},"distribution_of":{"description":"Which values the normal model fits. Default y.","enum":["y","x","residuals"],"type":"string"},"max_rows":{"description":"Rows to read from `table`, default 10000. A larger table is reduced to this many rows by FARM_FINGERPRINT order, so the same table always yields the same rows.","maximum":100000,"minimum":3,"type":"integer"},"metrics":{"description":"Which results to compute. Default: linear_regression, normal_distribution and p_values, plus prediction when predict_x is given.","items":{"enum":["linear_regression","normal_distribution","p_values","prediction"],"type":"string"},"minItems":1,"type":"array","uniqueItems":true},"points":{"description":"The data: [x, y] pairs (or {x, y} objects), 2 to 100000 of them; at least 3 for a regression. Use this OR `table`.","items":{"oneOf":[{"description":"[x, y]","items":{"type":"number"},"maxItems":2,"minItems":2,"type":"array"},{"additionalProperties":false,"properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"],"type":"object"}]},"maxItems":100000,"minItems":2,"type":"array"},"predict_x":{"description":"x values to predict y at, with mean and prediction intervals.","items":{"type":"number"},"maxItems":100,"minItems":1,"type":"array"},"probability_queries":{"description":"Probabilities to read off the fitted normal model: {\"below\": v}, {\"above\": v} or {\"between\": [a, b]}.","items":{"additionalProperties":false,"maxProperties":1,"minProperties":1,"properties":{"above":{"type":"number"},"below":{"type":"number"},"between":{"items":{"type":"number"},"maxItems":2,"minItems":2,"type":"array"}},"type":"object"},"maxItems":50,"type":"array"},"table":{"description":"BigQuery table to read instead of `points`: project.dataset.table, readable by the node's service account (public datasets are). Needs x_column and y_column.","type":"string"},"x_column":{"description":"Numeric column for x, with `table`.","type":"string"},"y_column":{"description":"Numeric column for y, with `table`.","type":"string"}},"required":[],"type":"object"},"bodyType":{"enum":["json","form-data","text"],"type":"string"},"method":{"enum":["POST","PUT","PATCH"],"type":"string"},"type":{"const":"http","type":"string"}},"required":["type","method","bodyType","body"],"type":"object"},"output":{"properties":{"example":{"$schema":"https://json-schema.org/draft/2020-12/schema","description":"The 200 body of every paid /work call. `result` is the worker's own output (its schema is per route); everything else is the same on all 38 routes. A receipt for the job is at `receipt_url`.","properties":{"billing_warning":{"description":"Present only when the charge was recorded with a caveat.","examples":["settlement pending"],"type":"string"},"price_usd":{"description":"What this call cost, in USD.","examples":[0.02],"type":"number"},"provenance":{"description":"How the result was produced: which providers ran and how long each took.","properties":{"attempts":{"description":"Provider attempts made, including retries and failovers.","examples":[1],"type":"integer"},"elapsed_ms":{"description":"Wall-clock milliseconds for the whole job.","examples":[340],"type":"integer"},"providers_used":{"description":"Providers that served the job.","examples":[["coinbase-advanced-trade-public"]],"items":{"description":"Provider name.","examples":["coinbase-advanced-trade-public"],"type":"string"},"type":"array"},"steps":{"description":"Every step the job ran, in order.","items":{"description":"One step of the job.","properties":{"ms":{"description":"Milliseconds the step took.","examples":[312],"type":"integer"},"ok":{"description":"Whether the step succeeded.","examples":[true],"type":"boolean"},"provider":{"description":"Provider that served the step.","examples":["coinbase-advanced-trade-public"],"type":"string"},"reason":{"description":"Failure reason, on a failed step.","examples":["provider_timeout"],"type":"string"},"step":{"description":"Step name inside the worker.","examples":["quote"],"type":"string"}},"required":["step","ok","ms"],"type":"object"},"type":"array"}},"required":["steps","providers_used","attempts","elapsed_ms"],"type":"object"},"receipt_id":{"description":"Receipt id for this job.","examples":["rcpt_9f1c2b3a4d5e6f70"],"type":"string"},"receipt_url":{"description":"Where to fetch the machine-readable receipt (free, no payment).","examples":["/work/receipts/rcpt_9f1c2b3a4d5e6f70"],"type":"string"},"result":{"properties":{"alpha":{"description":"Significance level used.","examples":[0.05],"type":"number"},"confidence_level":{"description":"1 - alpha: the level of every interval.","examples":[0.95],"type":"number"},"linear_regression":{"description":"Ordinary least squares fit of y on x; null when not requested.","properties":{"adjusted_r_squared":{"description":"R^2 adjusted for degrees of freedom.","examples":[0.995],"type":["number","null"]},"degrees_of_freedom":{"description":"n - 2.","examples":[3],"type":"integer"},"f_statistic":{"description":"F statistic of the regression (t^2); null when undefined.","examples":[773],"type":["number","null"]},"intercept":{"description":"OLS intercept.","examples":[0.08],"type":"number"},"intercept_ci":{"description":"Lower and upper bound at the confidence level.","examples":[[1.43,2.53]],"items":{"description":"Bound.","examples":[0],"type":"number"},"type":"array"},"intercept_std_error":{"description":"Standard error of the intercept.","examples":[0.236],"type":"number"},"intercept_t":{"description":"t statistic of the intercept; null when undefined.","examples":[0.34],"type":["number","null"]},"r":{"description":"Pearson correlation; null when y is constant.","examples":[0.998],"type":["number","null"]},"r_squared":{"description":"Coefficient of determination; null when y is constant.","examples":[0.996],"type":["number","null"]},"residual_std_error":{"description":"Standard error of the residuals, sqrt(SSE / df).","examples":[0.225],"type":"number"},"slope":{"description":"OLS slope.","examples":[1.98],"type":"number"},"slope_ci":{"description":"Lower and upper bound at the confidence level.","examples":[[1.43,2.53]],"items":{"description":"Bound.","examples":[0],"type":"number"},"type":"array"},"slope_std_error":{"description":"Standard error of the slope.","examples":[0.071],"type":"number"},"slope_t":{"description":"t statistic of the slope; null when undefined.","examples":[27.8],"type":["number","null"]},"sse":{"description":"Sum of squared residuals.","examples":[0.152],"type":"number"},"sst":{"description":"Total sum of squares of y.","examples":[39.4],"type":"number"},"t_critical":{"description":"Two-sided t critical value at alpha with df degrees of freedom.","examples":[3.18],"type":"number"},"x_mean":{"description":"Mean of x.","examples":[3],"type":"number"},"y_mean":{"description":"Mean of y.","examples":[6.02],"type":"number"}},"required":["slope","intercept","r","r_squared","adjusted_r_squared","slope_std_error","intercept_std_error","residual_std_error","degrees_of_freedom","slope_t","intercept_t","t_critical","slope_ci","intercept_ci","f_statistic","sse","sst","x_mean","y_mean"],"type":["object","null"]},"method":{"description":"How the numbers were produced.","examples":["Ordinary least squares (closed form). Student t p-values from the regularised incomplete beta function..."],"type":"string"},"metrics":{"description":"Metrics computed, in canonical order.","examples":[["linear_regression","normal_distribution","p_values","prediction"]],"items":{"description":"Metric name.","enum":["linear_regression","normal_distribution","p_values","prediction"],"examples":["linear_regression"],"type":"string"},"type":"array"},"n":{"description":"Number of points.","examples":[5],"type":"integer"},"normal_distribution":{"description":"Normal model of the chosen values; null when not requested.","properties":{"excess_kurtosis":{"description":"Excess kurtosis; null when the values are constant.","examples":[-1.3],"type":["number","null"]},"max":{"description":"Largest value.","examples":[10.1],"type":"number"},"mean":{"description":"Sample mean.","examples":[6.02],"type":"number"},"median":{"description":"Median of the values.","examples":[6.2],"type":"number"},"min":{"description":"Smallest value.","examples":[2.1],"type":"number"},"normality":{"description":"Jarque-Bera normality test; null when the values are constant.","properties":{"null_hypothesis":{"description":"What the test rejects.","examples":["the values are normally distributed"],"type":"string"},"p_value":{"description":"Chi-square(2) p-value, exp(-JB/2).","examples":[0.81],"type":"number"},"reject_at_alpha":{"description":"p_value < alpha: not normal at this alpha.","examples":[false],"type":"boolean"},"statistic":{"description":"Jarque-Bera statistic.","examples":[0.42],"type":"number"},"test":{"const":"jarque_bera","description":"The test.","type":"string"}},"required":["test","statistic","p_value","null_hypothesis","reject_at_alpha"],"type":["object","null"]},"of":{"description":"Which values the model fits.","enum":["y","x","residuals"],"examples":["y"],"type":"string"},"probabilities":{"description":"Answers to probability_queries, in order.","examples":[[{"probability":0.736,"query":{"below":8}}]],"items":{"properties":{"probability":{"description":"Probability under the fitted normal.","examples":[0.736],"type":"number"},"query":{"description":"The query as sent.","examples":[{"below":8}],"type":["object"]}},"required":["query","probability"],"type":"object"},"type":"array"},"quantiles":{"description":"Quantiles of the fitted normal; null when degenerate.","items":{"properties":{"p":{"description":"Probability.","examples":[0.95],"type":"number"},"value":{"description":"Value at that quantile.","examples":[11.19],"type":"number"}},"required":["p","value"],"type":"object"},"type":["array","null"]},"skewness":{"description":"Sample skewness; null when the values are constant.","examples":[0.05],"type":["number","null"]},"std_dev":{"description":"Sample standard deviation (n - 1).","examples":[3.14],"type":"number"},"variance":{"description":"Sample variance (n - 1).","examples":[9.86],"type":"number"}},"required":["of","mean","std_dev","variance","min","max","median","skewness","excess_kurtosis","quantiles","probabilities","normality"],"type":["object","null"]},"notes":{"description":"Caveats about the input; empty when there are none.","examples":[[]],"items":{"description":"A caveat about a degenerate input.","examples":["The points lie exactly on a line."],"type":"string"},"type":"array"},"p_values":{"description":"Hypothesis tests validated at alpha; null when not requested.","properties":{"intercept":{"description":"One two-sided Student t test.","properties":{"null_hypothesis":{"description":"What the test rejects.","examples":["slope = 0 (no linear relationship)"],"type":"string"},"p_value":{"description":"Two-sided p-value; null when undefined.","examples":[0.0015],"type":["number","null"]},"significant_at_alpha":{"description":"p_value < alpha.","examples":[true],"type":["boolean","null"]},"t":{"description":"Student t statistic; null when undefined (a perfect fit).","examples":[11.4],"type":["number","null"]}},"required":["null_hypothesis","t","p_value","significant_at_alpha"],"type":"object"},"normality_of_residuals":{"description":"Jarque-Bera normality test; null when the values are constant.","properties":{"null_hypothesis":{"description":"What the test rejects.","examples":["the values are normally distributed"],"type":"string"},"p_value":{"description":"Chi-square(2) p-value, exp(-JB/2).","examples":[0.81],"type":"number"},"reject_at_alpha":{"description":"p_value < alpha: not normal at this alpha.","examples":[false],"type":"boolean"},"statistic":{"description":"Jarque-Bera statistic.","examples":[0.42],"type":"number"},"test":{"const":"jarque_bera","description":"The test.","type":"string"}},"required":["test","statistic","p_value","null_hypothesis","reject_at_alpha"],"type":["object","null"]},"slope":{"description":"One two-sided Student t test.","properties":{"null_hypothesis":{"description":"What the test rejects.","examples":["slope = 0 (no linear relationship)"],"type":"string"},"p_value":{"description":"Two-sided p-value; null when undefined.","examples":[0.0015],"type":["number","null"]},"significant_at_alpha":{"description":"p_value < alpha.","examples":[true],"type":["boolean","null"]},"t":{"description":"Student t statistic; null when undefined (a perfect fit).","examples":[11.4],"type":["number","null"]}},"required":["null_hypothesis","t","p_value","significant_at_alpha"],"type":"object"}},"required":["slope","intercept","normality_of_residuals"],"type":["object","null"]},"prediction":{"description":"One entry per predict_x; null when not requested.","items":{"properties":{"mean_ci":{"description":"Lower and upper bound at the confidence level.","examples":[[1.43,2.53]],"items":{"description":"Bound.","examples":[0],"type":"number"},"type":"array"},"prediction_interval":{"description":"Lower and upper bound at the confidence level.","examples":[[1.43,2.53]],"items":{"description":"Bound.","examples":[0],"type":"number"},"type":"array"},"x":{"description":"The x asked for.","examples":[6],"type":"number"},"y_hat":{"description":"Predicted y.","examples":[11.96],"type":"number"}},"required":["x","y_hat","mean_ci","prediction_interval"],"type":"object"},"type":["array","null"]},"source":{"description":"Where the data came from and how much of it was used.","properties":{"gib_processed":{"description":"Gibibytes BigQuery scanned; null for inline points.","examples":[null],"type":["number","null"]},"rows_available":{"description":"Rows with finite x and y in the table; null for inline points.","examples":[null],"type":["integer","null"]},"rows_used":{"description":"Points the statistics were computed from.","examples":[5],"type":"integer"},"sampled":{"description":"True when the table had more usable rows than were read.","examples":[false],"type":"boolean"},"sql":{"description":"The read-only SQL that ran, when source is bigquery.","examples":[null],"type":["string","null"]},"table":{"description":"BigQuery table read, when source is bigquery.","examples":[null],"type":["string","null"]},"type":{"description":"Where the points came from.","enum":["points","bigquery"],"examples":["points"],"type":"string"},"x_column":{"description":"Column used for x, when source is bigquery.","examples":[null],"type":["string","null"]},"y_column":{"description":"Column used for y, when source is bigquery.","examples":[null],"type":["string","null"]}},"required":["type","table","x_column","y_column","sql","rows_available","rows_used","sampled","gib_processed"],"type":"object"}},"required":["source","n","alpha","confidence_level","metrics","linear_regression","normal_distribution","p_values","prediction","notes","method"],"type":"object"},"status":{"const":"ok","description":"Present only on a delivered result.","type":"string"},"worker":{"description":"Catalog name of the worker that ran.","examples":["market.quote"],"type":"string"}},"required":["status","worker","price_usd","result","provenance","receipt_id","receipt_url"],"title":"stats.probability response","type":"object"},"type":{"type":"string"}},"required":["type"],"type":"object"}},"required":["input"],"type":"object"},"history":[{"day":"2026-09-24","reachable":true,"status":402,"valid_402":true,"asked_usdc":0.5,"price_match":true,"latency_ms":1057,"error":null}],"description_full":"Deterministic statistics over (x, y) points: ordinary least squares linear regression with standard errors and confidence intervals, a fitted normal distribution with quantiles and probability queries, exact Student t and Jarque-Bera p-values validated at your alpha, and predictions with prediction intervals. Points come inline or from a BigQuery table (two numeric columns; above max_rows the rows are chosen by fingerprint, never at random).","last_updated":"2026-09-23T15:49:50.432Z","schemes":["exact"]}