Calculate Sample Variance
statistics.sample_variance
Overview
Calculate bounded exact-decimal sample variance with an explicit denominator and audit trace. Observation order is preserved, null and non-decimal members are rejected, and no missing-value or business policy is inferred.
You receive the exact formula result, denominator, bounds, and trace fields needed to reproduce sample variance.
Reliability
Exact BigDecimal accumulation uses a fixed 100-digit HALF_EVEN context. DECIMAL_INVALID means a malformed or over-limit decimal; correct that value. SERIES_INVALID means too few observations; add the required observations. LENGTH_MISMATCH means x and y counts differ; align the paired rows. ZERO_VARIANCE means Pearson correlation has a constant series; provide varying observations. ITEM_LIMIT_EXCEEDED means more than 10,000 observations; split them. This guidance applies specifically to statistics.sample_variance.
Context footprint
One bounded request replaces repeated prompt arithmetic and returns its denominator trace. This guidance applies specifically to statistics.sample_variance. A successful call costs 1 execution credit.
When to use it
Use when one decimal series needs sample variance with denominator n-1.
When you want population variance (n) or the standard deviation instead of sample variance.
Scope
Non-goals
- Does not infer sampling, missing-value, weighting, unit, or materiality policy This guidance applies specifically to statistics.sample_variance.
- Does not accept binary floating point, null observations, files, or unbounded series This guidance applies specifically to statistics.sample_variance.
Properties
Capabilities
Cost & billing
Flat rate per invocation
File handling
How we handle your data
What this means
This skill may receive sensitive content, but it does not target sensitive data and returns only a structured non-sensitive result.
Squillify guarantees
- Runs inside Squillify
- This skill runs inside Squillify.
- Payloads are not sent to an external service by this skill.
- Squillify does not permanently store submitted payloads.
- Telemetry records metadata only, not submitted content.
- Submitted payloads are not used for training.
- Submitted payloads are not reviewed by humans.
- This skill does not target sensitive data.
- The response does not contain submitted content.
Your responsibility
Squillify does not determine whether submitted content is sensitive. Your application is responsible for deciding what data it is allowed to submit. Your application is responsible for securing the response.
Input schema
| Field | Type | Required | Description |
|---|---|---|---|
| values | array | Yes | Required 1 to 10,000 plain-decimal strings; sample variance requires at least 2. |
Output schema
| Field | Type | Required | Description |
|---|---|---|---|
| variance | string | Yes | Variance under the declared n or n-1 denominator. |
| mean | string | Yes | Arithmetic mean used for centered differences. |
| count | integer | Yes | Number of observations. |
| denominator | string | Yes | Exactly n for population or n-1 for sample. |
API contract
POST /v1/executecurl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"statistics.sample_variance","input":{"values":["2","4","6"]}}'import { Squillify } from "@squillify/sdk";
const sq = new Squillify({ apiKey: process.env.SQUILLIFY_API_KEY });
const { output } = await sq.execute("statistics.sample_variance", {"values":["2","4","6"]});Errors
| Code | HTTP | Retryable | Description |
|---|---|---|---|
| VALIDATION_ERROR | 400 | No | The request payload failed schema validation. |
| UNAUTHORIZED | 401 | No | Missing or invalid API key. |
| SKILL_NOT_ACCESSIBLE | 403 | No | The API key is not granted access to this skill. |
| SKILL_NOT_AVAILABLE_FOR_PLAN | 403 | No | This skill is not included in your current plan. |
| PLAN_ELIGIBILITY_UNAVAILABLE | 503 | Yes | Plan eligibility could not be decided. Retry after backoff. |
| SKILL_NOT_FOUND | 404 | No | The requested skill or version does not exist. |
| TENANT_RATE_LIMITED | 429 | Yes | Request rate limit exceeded. Retry after backoff. |
| QUOTA_EXCEEDED | 429 | Yes | Plan quota exhausted. Retryable once the quota period resets. |
| EXECUTION_TIMEOUT | 504 | Yes | Execution exceeded the allowed time budget. |
| DECIMAL_INVALID | 400 | No | The request payload failed this skill's input validation. |
| SERIES_INVALID | 400 | No | The request payload failed this skill's input validation. |
| ITEM_LIMIT_EXCEEDED | 429 | No | A size, quota, rate, or time limit was exceeded. |
Other limits
| Limit | Value |
|---|---|
| Recommended inline bytes | 32 KiB |
Limitations
- Does not infer sampling, missing-value, weighting, unit, or materiality policy This guidance applies specifically to statistics.sample_variance.
- Does not accept binary floating point, null observations, files, or unbounded series This guidance applies specifically to statistics.sample_variance.
- Datasets requiring missing-value imputation or statistical inference
- Inputs above 10,000 observations or requiring streaming This guidance applies specifically to statistics.sample_variance.
How to call
POST /v1/execute (requires authentication)
{
"skillKey": "statistics.sample_variance",
"input": {
"values": [
"2",
"4",
"6"
]
}
}Examples
Primary decimal series
{
"values": [
"2",
"4",
"6"
]
}{
"mean": "4",
"denominator": "n-1",
"count": 3,
"variance": "4"
}Signed or alternative denominator series
{
"values": [
"-1.5",
"0",
"1.5"
]
}{
"mean": "0",
"denominator": "n-1",
"count": 3,
"variance": "2.25"
}Recommended use cases
- Auditable exact-decimal sample variance
- Bounded fund-accounting controls and reconciliations This guidance applies specifically to statistics.sample_variance.
Avoid for
- Datasets requiring missing-value imputation or statistical inference
- Inputs above 10,000 observations or requiring streaming This guidance applies specifically to statistics.sample_variance.
Related skills
Composable with
Safety & privacy
- Runs without calling any external service.
- Your payloads are never stored permanently.
- Telemetry captures metadata only — never your payload contents.
- We never train models on your payloads.
- No human reviews your payloads.