This guide explains the equations actually used in WeatherPred. Examples are illustrations, not trading recommendations. Where a model relies on an assumption, that assumption is part of the explanation. The system has not established a profitable strategy or a validated probability of reaching a bankroll target.
Start with contracts and fees, then the forecast distributions, then execution and validation. A probability is a belief about an outcome; an executable price is what an order can actually pay or receive. Every trade calculation needs both. The final worked example connects these steps. The project brief also defines the main modeling and trading terms.
1. Contracts, prices and profit
Let be a YES contract's final payout, its estimated probability, the purchase ask and the entry fee for one contract. The cost is . Holding to settlement gives
If a later sale receives bid and costs exit fee , profit is instead
These are different strategies. The second can profit from a price movement without waiting for the event to resolve. Both lose money if the spread and fees exceed the available edge.
YES and NO payouts sum to one, but their executable prices do not have to sum to one because bid and ask differ. If are YES quotes, the complementary NO ask is and the NO bid is . The midpoint is used as a benchmark probability or signal, not a fill price.
Implementation: books.py, quote_screen.py.
2. Fees, precision and a worked trade
The implemented quadratic taker fee model is
where is quantity and is the applicable fee multiplier. For a maker, the coefficient is either zero or 0.0175, depending on the verified schedule. The code first rounds trade fees upward to six decimal places, aligns cash changes to the supported balance precision, and carries rounding amounts across partial fills with the documented rebate treatment. A separate accumulator belongs to each order. Historical experiments explicitly state their assumed schedule; a current fee formula is not evidence of past fees.
For a single contract on a cent-balance account, buying at $0.40 costs $0.42: the model fee is $0.0168, which yields a two-cent debit after alignment. Selling at $0.60 receives $0.58 after its separate fee. Profit is $0.16, not $0.20. At 0.0001-dollar balance precision the analogous isolated cash changes are −$0.4168 and +$0.5832, giving $0.1664. Partial fills must follow the accumulator, not independently rounded copies of a whole-order fee.
Implementation: fees.py. Primary specification: Kalshi fee rounding.
3. Basket consistency
For mutually exclusive, exhaustive brackets, exactly one YES wins:
Buying one of each YES has conditional net surplus ; buying one of each NO has surplus . For uncertain coverage, the scanner evaluates numeric predicates across boundary points and uses the minimum possible aggregate payout rather than assuming the partition is correct. Integer and continuous settlement domains are checked separately.
Positive displayed surplus would still be conditional: prices can move while the legs are filled, and multi-leg execution is not atomic.
Implementation: contracts.py, basket.py.
4. Probability calibration from market prices
Market-only logistic calibration transforms a quoted probability using
Probabilities are clipped to when taking logarithms. The fit minimizes weighted binary negative log likelihood plus a slope penalty:
The intercept shifts the overall probability level; the slope changes how extreme the probabilities are. This regularizer shrinks the slope toward zero; it differs from the market-centered regularizer in the combination model below. Fits use chronological earlier outcomes, not a random split of contracts.
Implementation: calibration.py.
5. Turning temperature forecasts into bracket probabilities
Let denote the temperature before reporting-rounding, with Gaussian distribution , and let be the standard-normal cumulative distribution function: the probability mass below a given standardized value. Here is the mean and the standard deviation, which describes spread. For an inclusive integer bracket , the model's rounding-cell approximation gives
Thus an integer 77–78°F bracket corresponds to the latent interval . Strict greater/less predicates use the corresponding first/last allowed integer. Upper-tail subtraction uses survival functions where possible to avoid numerical cancellation.
Hourly index contracts have a different 0.01°F lattice. A strict threshold uses latent boundary . This is a modeling discretization, not permission to substitute one contract's rounding rules for another's.
Implementation: daily_forecasts.py, forecasts.py.
6. Bias correction and empirical errors
For a base forecast and observed label , residuals are . The daily model uses weighted bias and variance
The corrected mean is . Daily Gaussian spread is floored at 0.5°F. Station models estimate these quantities by station; the global version pools stations. Training day weights prevent a day with more station rows from automatically receiving more influence.
The daily empirical model uses samples . Its bracket probability adds one unit of Gaussian smoothing mass:
The hourly empirical exceedance model instead uses Jeffreys smoothing:
Hourly Gaussian errors use the ordinary sample mean and standard deviation, with a 0.05°F spread floor. Empirical and Gaussian models are alternatives; the implementation does not pretend their uncertainty assumptions are identical.
Implementation: daily_forecasts.py, forecasts.py.
7. Daily mean and spread regression
The regression combines the daily grid maximum , the native extrema proxy , the native spread and station indicators :
The exponentials keep variance positive; the 0.25 term is a 0.5°F standard- deviation floor. The fit minimizes Gaussian negative log likelihood with an L2 penalty on mean coefficients:
An analytic gradient is supplied to L-BFGS-B and checked against numerical derivatives in tests. The model's 18-hour extrema proxy is retained as a feature; it is not relabeled as the contract's 24-hour daily maximum.
Implementation: daily_forecasts.py.
8. Hourly persistence, trend and information timing
Persistence uses the latest eligible value: . The trend model fits a least-squares slope to recent points:
Time is measured in minutes in this calculation. Residual distributions turn these point forecasts into probabilities. Five- and ten-minute input limits test freshness; they do not give permission to use later-received records.
For every decision , a forward feature must satisfy . Model initialization, valid time, object modification time, document issue time and our receipt time are separate fields. Retrospective object/document timestamps support explicitly limited historical assumptions, not an assertion of independently observed historical public access.
Implementation: forecasts.py, freshness.py, updated_forecasts.py.
9. Logarithmic forecast combination
For a complete event, let be normalized market probabilities and weather probabilities. The combined probability is
The sum is one by construction. Parameters minimize categorical negative log likelihood with penalty , favoring the original market distribution . Softmax and log-sum-exp provide numerically stable evaluation. A zero fitted weather weight is a meaningful result, not a failed optimization to hide.
Earlier-month weather fits produce the forecasts used to train the combination stage. This prevents the second stage from learning from artificially good in-sample predictions of its first stage.
Implementation: forecast_pool.py.
10. Momentum, reversal, favorites and longshots
Let the current midpoint be and the earlier midpoint be . Define the price move . For threshold :
- Momentum follows the sign of when .
- Reversal trades against that sign under the same trigger.
- Favorite rules require and buy the registered YES or NO side.
- Longshot rules require and buy the registered YES or NO side.
Momentum/reversal select the largest absolute eligible move; favorite/longshot rules select the highest midpoint satisfying the threshold. Ticker ordering breaks ties. At most one contract is selected per event and policy. Signal functions reject outcome and future-quote fields.
The entry limit is fixed at the signal-side ask plus scenario slippage, capped at $0.99. At the exact later entry hour, the later ask plus slippage must still fit the limit. Exits use the scheduled later bid less slippage and an exit fee, or the preregistered settlement fallback if there is no valid exit quote. Only endpoint prices are used; candle highs/lows are not assumed tradable.
Implementation: trading_research.py.
11. Preliminary observation bounds and error allowance
Let be a preliminary daily high and a fixed safety margin. The candidate lower bound on the final high is . An inclusive bracket with upper boundary , or a strict-less contract with threshold , cannot win if the bound holds.
It sometimes does not hold. Training counts a day as a failure when any station's preliminary bound exceeds its final exchange value. For failed days in observed training days, the one-sided 95% Clopper–Pearson upper failure rate is
If every day fails, the lower probability is zero. At least 100 training days are required. With zero failures, the lower probability simplifies to ; for it is approximately 0.983495. Zero observed failures therefore does not imply certainty.
This interval assumes a binomial sampling model; serial weather dependence and conditioning on unusually cheap contracts can invalidate interpreting it as a universal trade-level confidence bound. It is an exploratory conservative feature. A two-degree preliminary/final discrepancy in validation demonstrates the practical issue. No margins were changed after viewing that result.
Implementation: intraday_bounds.py.
12. Taker depth and maker queue mechanics
For a taker with contracts remaining, displayed quantity at level and retained-depth fraction , the next hypothetical fill is
provided the worsened purchase price does not exceed the earlier limit. The simulator walks levels, applies fees to actual partial quantities and cancels the remainder. It obtains the book only after the registered arrival delay, rather than selecting a convenient old snapshot.
For a maker, let be queue volume ahead, qualifying opposite-side trade volume strictly through the quote, remaining quantity and :
Only deduplicated, eligible, non-block trades count. Touches and cancellations do not advance this queue model. It is deliberately conservative, but is still a model of hypothetical execution rather than actual exchange queue priority. Post-fill quotes at 0/30/60/300 seconds diagnose adverse selection: the risk that getting filled is itself associated with a subsequent unfavorable move.
Implementation: paper.py, execution diagnostics.
13. Fractional Kelly sizing and cash limits
Spend fraction of bankroll on a binary contract with total unit cost and win probability . On a win, bankroll is multiplied by ; on a loss it is multiplied by . Expected log growth is
Setting its derivative to zero gives the full-Kelly cost allocation
The paper experiment uses quarter Kelly after subtracting a fixed three percentage points from the relevant side's model probability:
That haircut is a heuristic, not a confidence interval. The dollar budget is then bounded by available unreserved cash, Kelly allocation, remaining 5% event exposure and remaining 10% Miami-cluster exposure. The global 25% limit is looser than the single-cluster limit in this experiment. Whole intended quantity is ; actual partial fills can have hundredth-contract precision.
For illustration, if and total cost , quarter Kelly allocates about 5.56%; the 5% event cap limits a $100 account to $5 before quantity rounding. This is only useful if the probability estimate is trustworthy.
In the original E009 cohort, position cash is not recycled before exit or settlement. The separate E016 cohort also returns cash through a same-contract offset, as explained below. Open positions use provisional liquidating bid marks without exit fees; closed but unfinalized positions are carried at cost. Consequently reported interim equity and drawdown are limited measures, not a validated liquidation or ruin-risk distribution.
Implementation: paper runner, paper.py.
14. Scores and trading performance
Binary probability forecasts use Brier score and log loss:
For continuous distributions, CRPS measures both location and spread:
where are independent draws from the forecast distribution. Gaussian CRPS has a closed form; the empirical version uses sorted samples to avoid an pairwise matrix. Coverage measures how often a nominal prediction interval contains the outcome. Better coverage alone need not improve trading.
Trading research tracks net profit, cash, locked capital and daily log growth . Realized drawdown is
E013's carries unresolved positions at cost. Its drawdown is therefore realized-only and can understate economic drawdown. No Sharpe ratio or target- hit probability is presented as validated performance.
Implementation: calibration.py, forecasts.py, autoresearch runner.
15. Chronological selection and multiple experiments
Contracts from the same weather event are dependent. The research aggregates within events/days and resamples whole day blocks, preserving cross-city and cross-strategy dependence. E013 uses 10,000 shared circular seven-day bootstrap samples over all 1,728 policy/scenario combinations.
For candidate , let be mean daily log growth, its mean in bootstrap sample , and the standard deviation of those bootstrap means. The centered maximum statistic is
The observed statistic is compared with this maximum distribution, with finite-sample p-value
Zero-variance candidates receive p-value one. This is an approximate familywise development diagnostic, relying on bootstrap assumptions; it does not replace final holdout or forward evidence. Earlier experiments separately use Holm's step-down adjustment for their declared families.
The monthly selector uses only returns released before the month starts. It ranks candidates by , where is estimated from nonoverlapping seven-day training block sums, requires 30 traded days and positive stressed training growth, and selects cash if none qualify. The two-SE criterion is a selection heuristic, not a corrected confidence bound. Evaluating its subsequent months exposes the cost of choosing strategies from earlier noisy results.
January–June 2025 is training and July–September is repeatedly examined development validation. October–December remains sealed. The global promotion protocol additionally requires substantial untouched and prospective samples, cost/depth stress, parameter robustness and source audits. Tests of code correctness are not evidence that those statistical gates have been met.
Implementation: autoresearch runner, validation protocol.
16. Reproducibility and hash-chain evidence
Each response body has digest . The archive record hash commits to its kind, key, actual availability timestamp, metadata, body digest and previous record hash:
SQLite triggers reject record updates/deletes. Replays check the chain and reconstruct selected outputs from original sources. This detects accidental modification; it is not an independently notarized timestamp or protection against an operator rewriting the whole archive. Published evidence identifies the snapshot and local source records; the large raw archive is not bundled in the Git repository.
Implementation: archive.py, raw-quote audit.
17. Paired maker inventory and payout bounds
The later E015 experiment adds an explicit inventory calculation. If a contract has YES quantity , NO quantity and total acquisition cost , its terminal profit under normal binary settlement is
Thus the minimum and maximum payouts on already filled positions are and . Within one account, cash already includes acquisition costs. Summing over its contracts , bounds relative to initial capital are
These bounds exclude future fills from outstanding orders and assume normal binary settlement. Related contracts may make the individual extremes impossible to reach together, so the bounds can be loose. They are not an expected return. E015 holds the matched cash until settlement as a capital stress assumption; E016 corrects same-contract cash return below. Averaging each leg's cost allows a decomposition into matched-pair profit and unmatched cost at risk, but only their combined result is portfolio profit.
For the inventory-skew benchmark, let and . If current own-side bids are , candidate buy quotes before valid-tick rounding are
The quotes must leave at least one cent per matched pair after current maker fees. A larger YES inventory lowers the YES bid and raises the NO bid, encouraging rebalancing. The shift is a fixed benchmark inspired by inventory-sensitive market-making literature, not a fitted optimal-control solution or a fair-value estimate. E015 keeps one-contract quotes under the same cash/exposure checks.
Implementation: market_making.py.
18. Same-contract netting and realized round trips
Kalshi offsets opposite positions in the same contract. If both sides have filled, let . The cash and quantities become
With each side's total acquisition cost denoted by , average allocated cost and realized profit of the matched part are
This is applied only when both quantities are positive. Matched costs are removed from the remaining positions. A losing offset produces negative realized profit; it is not discarded. Unmatched positions still have outcome risk.
For the same fills, netting does not improve the eventual economic result:
and the analogous equality holds for the maximum payout. It moves cash earlier, which may allow new orders. Those extra opportunities need their own future execution evidence; an accounting replay cannot fabricate them.
E016 performs a fill and its offset in a single immutable journal update. Its same-contract rule does not assume optional collateral return across different contracts. Earlier E015 results remain an overcollateralized stress comparator.
Implementation: netted_paper.py, identical-fill replay and future cohort.
19. Worked example: forecast to an order decision
This numerical illustration joins the methods above. It is not an observed trade or a claim that the assumed forecast probabilities are calibrated.
Suppose an earlier fitted weather model gives a final temperature mean of 78°F and standard deviation of 2°F. Consider a contract for a reported integer high of 77–78°F. Under the rounding-cell model,
The model assigns about 37.21% probability to YES. An ask of 30¢ is below that probability, but the gap is not the net edge. For one contract under the illustrated cent-balance taker schedule, the model fee is dollars, and the isolated cash debit rounds to 32¢.
| Step | Calculation | Meaning |
|---|---|---|
| Cost | 30¢ ask + 2¢ rounded fee = 32¢ | Cash spent if that isolated fill occurs. |
| Expected settlement profit | 37.21¢ − 32¢ = about 5.21¢ | An average under the assumed model, not a certain payout. |
| Probability haircut | 37.21% − 3 percentage points = 34.21% | The paper rule's fixed allowance for model uncertainty. |
| Adjusted edge | 34.21¢ − 32¢ = about 2.21¢ | Still conditional on the model and the fill. |
| Quarter-Kelly allocation | 0.25 × (0.342079 − 0.32) / (1 − 0.32) ≈ 0.00812 | About 0.81% of bankroll, or 81¢ for a $100 account, before further limits. |
The system then applies available-cash and exposure limits, rounds the intended quantity and fixes the order limit. A later eligible book must support the purchase. If the ask moves above the limit or there is no eligible depth, the unfilled quantity is cancelled. Multiple partial fills use the fee accumulator, so their fees are not computed by simply multiplying this isolated example.
Even if the one-contract purchase fills at 30¢ with a 2¢ fee, its realized settlement result is either +68¢ or −32¢. The expected 5.21¢ is neither of those outcomes. Validation asks whether many independent future decisions support the probability and execution assumptions behind that expectation.
For a maker, there is another distinction. Buying one YES for 42¢ and one NO for 55¢ would lock in 3¢ before any applicable fees if both fill. Receiving only the YES fill leaves 42¢ at risk. The paired-maker experiments track that unmatched risk and the queue evidence required for each side separately.
20. Conditional hourly regression and Student t errors
E018 predicts the remaining temperature change rather than assuming all hours share one residual distribution. For the known target's Miami local hour , define . Features contain the trend forecast minus persistence, plus for or . The second pair permits a more flexible daily shape. Target time is known at the decision and is not a future observation.
Let . Training-only means and standard deviations standardize each feature into a row of . Weights in diagonal matrix give each training day equal total influence and are normalized to sum to the number of rows. With weighted mean residual , the ridge solution is
The forecast mean is
The intercept is unpenalized. The registered penalties are ; larger penalties shrink the fitted trend and daily-pattern effects more strongly. Parameters are fitted separately for 30-, 15- and 5-minute horizons.
The error distribution is either Gaussian or a Student t with fixed five degrees of freedom. For the latter,
where is the earlier 0.01°F rounding-cell boundary and SF is the survival function, the probability above a threshold. The t distribution has heavier tails. Its scale is not its standard deviation: the latter is . The scale is chosen by minimizing negative log density, with a 0.05°F floor and a 20°F upper search bound for the t case.
There are twelve candidates. Expanding August fits predict the following two days; the candidate with the lowest equal-day average negative log density is selected. This is a probability-density score, distinct from the binary log loss of a YES contract. The mean is then refitted on all twelve August days, and its scale is calibrated using the selected candidate's earlier-fold errors. Those same eight days were used for selection, so their apparent improvement is not an unbiased estimate of future performance. The frozen forward cohort uses new receipts, orders and outcomes to test the result.
Implementation: conditional_forecasts.py, forward runner, model replay.
21. Conditional rain-calendar pairs and unequal fills
Let indicate Saturday rain and indicate Sunday rain, each taking value zero or one. Under identical normal source and reporting conventions, the weekend indicator is
If Saturday has officially finalized dry and the source still confirms that value, implies . One Sunday YES plus one weekend NO then pays
Let the executable costs including fees be and . A fully matched one-contract pair has conditional settlement profit
At the exploratory 16:30 UTC snapshot, NYC's asks were for daily YES and for weekend NO. The fee accumulator produces a total cost of , leaving conditional surplus. With quarter depth and two cents extra slippage per leg, total cost is and the surplus is . Neither calculation proves that later orders can fill at those prices.
If the two actual fills are unequal, let be their quantities and their combined cash cost, including fees. Then
For example, if only 0.50 daily YES fills at 11 cents and the weekend leg fails, its actual fee-inclusive cash cost is . Possible profit is between −$0.0585 and +$0.4415, despite a positive matched-pair price screen. The missing leg is never inserted retrospectively. Different contracts also do not release matched cash through the same-contract netting mechanism.
Source consistency is another condition. If the relation breaks and both held sides lose, the payoff is zero and profit is . For a hypothetical complete one-contract pair with normal payout one and failure payout zero, an assumed failure probability would give
The project has not estimated reliably. Two observed weekends cannot establish a rare-failure rate, and exchange review can affect settlement. E019 therefore reports the source-break loss separately. Its fixed one-cent source allowance is a stress deduction, not a measured probability or confidence bound. It requires two cents additional conditional surplus after that deduction, reserves at most 5% of equity per pair and retains the existing aggregate exposure caps.
Implementation: rain_relations.py, prospective pair runner.
22. Position capacity, early exit and geometric growth
E020 measures the cost of increasing a matched rain-pair position. Let include both legs' ask depth, slippage and accumulated entry fees for quantity . When both legs have enough displayed size, conditional surplus is
The diagnostic chooses the largest surplus among quantities 1–100 subject to and , where is an illustrative cash-cost cap. Costs need not increase linearly: the next contracts may be offered at worse prices. This calculation is a quote screen, not a fill or a recommendation to increase E019's registered limits. Under quarter depth and two cents additional slippage per leg, the September 6 snapshot supports six pairs for $5.8108, leaving $0.1892 conditional surplus. A larger cap does not improve that row.
Selling early requires a separate calculation. If eligible bid slices for the held positions have prices and quantities , then
The implementation also applies the exit slippage and depth scenario. It reports profit only for a fully quoted exit; quantities without bids remain unfilled. At the observed full-depth bids, the fastest E019 account could receive $2.4384 after exit fees against its $4.5887 cost: a $2.1503 loss if those sales execute. Its conditional $5 normal settlement payout cannot be used as immediate cash.
Now let be initial bankroll, with and . Suppose the pair pays normally and zero on source failure. For an assumed failure probability ,
The second expression is expected logarithmic growth. It penalizes losses more strongly as they consume the bankroll. Define and . The break-even failure assumptions are
They are sensitivity thresholds, not estimates of the actual failure frequency. For example, gives expected profit of , but negative expected log growth. Positive average dollars alone can conceal poor compounding. No source-failure estimate or reliable bankroll-target probability is available from the single current weekend.
Implementation: capital and exit functions, execution study.
23. Transformer quantiles and supervised adaptation
E021 uses a pretrained Chronos-2-small transformer through its official library. The project implements data alignment, adaptation and evaluation; it does not claim to have invented or reimplemented the pretrained architecture. A sequence of 512 minute values produces forecasts for the next 40 minutes. Missing values remain masked. The model's median forecast is used for the temperature-error comparison, while its quantiles describe possible outcomes.
A quantile is a value below which the model assigns probability . For error , the pinball loss is
Underprediction receives weight , and overprediction receives weight . At , this equals half the absolute error. For forecasts and quantile levels, the reported score in Fahrenheit is
The library's training loss uses its internally normalized targets, twice the pinball loss, masks missing targets and known future covariates, averages over the output horizon, sums across quantile levels and averages over the batch. Consequently, its training-log loss is not numerically interchangeable with the evaluation score above. E021 trains all model parameters for 100 AdamW optimizer steps with batch size eight and initial learning rate , which follows the library's linear schedule. There is no validation-based checkpoint selection. The short pilot is supervised learning, not RL.
The point-forecast comparisons are
Across the 93 reused development forecasts, fine-tuned RMSE is 0.8010°F versus 0.7504°F for persistence. At the five-minute horizon it is 0.4512°F versus 0.5375°F. These 31 hourly targets span eight days and overlap the earlier model comparison. Neither the lower subgroup error nor an unadjusted resampling interval establishes independent skill after selecting among models/horizons.
Dropout randomly masks model activations during training. The initial evaluation accidentally retained that mode and failed saved-checkpoint replay. Explicit evaluation mode removes that randomness. The corrected scores use the same saved weights and reproduce exactly; no training retry occurred.
For a binary event with true probability , expected Brier loss satisfies
This explains why direct supervised probability learning already has a useful optimization target. RL can instead address sequential actions such as posting, cancelling or reducing an order. A proposed execution objective is expected change in log wealth after fees, fills and final inventory outcomes. It remains unimplemented and would require a reliable simulator and new validation days.
Implementation and sources: model study, probe.
24. Consecutive-day states and contract implications
The weekly heat contracts depend on consecutive hot days, not the mean of the whole week. For day , let be its number of eligible hourly observations and their temperatures. Under the exact contract rounding rule, define
The streak ending on a day follows with initial . The longest streak is , so a contract for at least consecutive days pays . Enumerating unresolved days as both zero and one bounds the possible final result. Earlier source revisions can still change the completed-day inputs; observed data is not an unconditional payout guarantee.
Similarly, a monthly rainfall total is , where is accumulated reported rain. When additional amounts are nonnegative and past reports remain valid, implies a strictly-greater-than- threshold has already been exceeded. Equality alone does not suffice.
More generally, if event implies event under compatible source rules,
Examples include a higher rainfall threshold implying a lower one, or major hurricanes being included in a compatible hurricane count. Buying NO(A) and YES(B) has a conditional minimum payout of one dollar per matched pair. Profit still requires both fills and total cost below that payout. The new 541-relation screen finds no positive quoted floor after fees; theoretical relationships do not guarantee a discounted purchase.
Implementation and precise source gates: expanded market study.
25. Integer bankroll sizing and selection before trading
Let be available cash, cancellable order reservations and the purchase principal of held positions. The simulation's bookkeeping equity is
Entry fees are expensed immediately. This cost-based value is not a liquidation price. A deliberately conservative alternative assigns zero to every held contract, giving . Neither convention estimates the missing historical bid prices.
For an order limit and a predeclared risk fraction , the integer quantity is
Here each is its remaining permitted exposure after held positions and pending orders. The full limit-price debit is reserved before observing the later entry price or depth. Actual fills can reduce quantity, never increase the previously decided quantity. The conditional candle study additionally assumes a fixed 100-contract capacity ceiling; that ceiling is not observed liquidity.
For cent prices and cent account precision, its historical fee assumption is
The implementation also handles subcent prices by rounding the aggregate debit against the account, after the model fee is rounded to six decimals. Fees for one -contract order generally differ from separately rounded one-contract orders. Sale fees are charged again; settlement payouts have no assumed fee. Historical applicability of this fee schedule remains unverified.
Strategy choice uses earlier daily log returns . Every candidate uses the same dates. A circular seven-day bootstrap resamples all cities and candidates together, preserving their shared weather days. If is the bootstrap standard error, compute
The selector ranks positive values from the earlier period, subject to stressed profit, release-day and unresolved-cash gates. Zero-variance candidates cannot establish a positive bound. A 20% decline from the running peak of cost-based equity stops new orders and cancels pending reservations; already held positions continue to their release events. This stop cannot guarantee a 20% liquidation-loss bound when positions overlap or market bids are missing.
This is a within-batch development calculation. It does not erase prior searches, replace the untouched holdout or establish forward profitability. The maximizer within a finite earlier-data search is not an omniscient optimal trading strategy.
Implementation: bankroll account, shared bootstrap, E023 specification.
26. Station residual regression and forecast calibration
E022 predicts an individual station's temperature one, three or six hours after the decision. A 15-minute assumed publication lag limits the final context hour:
At an exact hourly decision this makes the required neural forecast steps two, four and seven. It does not backdate the actual September receipt. A case needs at least 120 finite observations in 168 context hours and a last input no more than two hours old; missing observations remain missing.
The simple regression predicts the residual from the last eligible temperature . Its feature vector includes temperature changes over one, three and 24 hours, the previous day's target-hour value, local-clock harmonics, input age, missing-data indicators and station indicators. Weighted training means and scales produce standardized features . The fit solves
The intercept is unpenalized. Weights are proportional to , where is the number of training cases on day , and normalized to sum to the number of cases. Thus each training day has the same total weight. The three penalties are separate registered candidates, all retained in the result table.
For each model, forecast horizon and quantile level , the separate earlier calibration panel provides an additive correction:
Here is the linearly interpolated empirical quantile. Sorting makes the corrected quantiles nondecreasing. Baselines begin with their point forecast repeated at each quantile level; neural candidates supply their own quantiles. Calibration uses July 6–19 only. This empirical correction does not guarantee future or trade-conditional coverage under changing weather conditions.
The primary development score uses raw point forecasts or neural medians, before that quantile correction:
The same day weighting applies to calibrated quantile loss, coverage and width. There are 6,599 cases but only 28 development UTC days. The fitted transformer has MAE 1.8872°F versus 2.1501°F for the strongest ridge candidate:
Its gain over the pretrained checkpoint is only 1.05%. Neither percentage is a trading return or an independent validation result. See the complete study and all eight candidates.
27. Fixed physical and transformer combinations
This forecast experiment asks whether operational physical guidance and learned station patterns supply complementary information. Let be the original NBH temperature forecast for case , the saved pretrained transformer's point forecast, and its raw quantile at level . Three fixed neural weights define three distinct candidates:
This averages corresponding quantiles. It does not assume a normal distribution for NBH's reported temperature spread, and it is not a mixture of the two forecast distribution functions. The additive calibration and monotonic rearrangement in Section 26 are then estimated separately for each candidate using only July 6–19. No blending weight is fitted or selected from the July 20–August 16 development scores.
Each combination is compared with NBH, pretrained Chronos, adapted Chronos and ridge-100: twelve paired mean-error contrasts. Shared seven-day blocks preserve the same sampled days across all contrasts; a maximum standardized statistic gives a simultaneous descriptive interval. All candidates, missing cases, negative contrasts and interval-width changes must remain visible. Design 124922 precedes the first NBH error score. Implementation registration 129863 acknowledges that the NBH benchmark was known by then; the weights and comparison family remain unchanged. Report 131549 retains all three combinations on the full original case grid. Their mean absolute errors are 1.6608°F, 1.6023°F and 1.6866°F in increasing neural-weight order, versus 1.8345°F for NBH. All twelve descriptive intervals are below zero. The 50/50 candidate has the lowest observed error among these three; it is not selected as a production strategy. These are retrospective station forecasts, not settlement probabilities or validated trading returns. Design, all results.
28. Learning trading returns through a common historical simulator
E032 compares two statistical targets using the same fifteen quote/calendar features, monthly training cutoffs and execution rules. Its feature vector contains market log-odds, spread, one-hour and three-hour price changes, the sum and fraction of currently observable panel quotes, bracket rank, seasonal sine/cosine and six city indicators. Only contracts open at the decision can affect another contract's panel features. Missing quotes are recorded; their prices are never invented.
For an individual binary contract, the probability model starts from market log-odds and learns a correction:
Here is the decision-time midpoint and contains features centered and scaled using training data only. The midpoint is a feature, not a fill price. Minimize weighted binary log loss plus ; the intercept is not penalized. Weights give each day equal total weight, then divide it equally across events and eligible contracts. The two outcomes of one contract are complements; fitted probabilities across different brackets are not forced to sum to one.
The second model learns net dollars from attempting one contract, separately for YES and NO. Under the fixed execution scenario its target is:
is the exact aggregate purchase debit, including the assumed quadratic fee and account rounding from earlier sections. A missing entry quote or unreleased settlement is an unknown target, not zero. Each side's ridge regression minimizes weighted squared error plus a fixed coefficient penalty of one. Unknown labels have zero weight and an explicit mask. Return estimates are raw linear predictions, not calibrated profit guarantees. The account sizes whole contracts and recalculates aggregate fees; it does not multiply rounded single-contract fees by quantity.
The probability model's order score is predicted payout minus the maximum single-contract debit at the original limit. The return model's score already includes its modeled costs. For example, a YES probability of .70 and a decision ask of .60 imply a .61 limit and a .63 one-contract debit under the assumed .07 fee coefficient. The predicted edge is .07. If the later ask plus slippage exceeds .61, the order does not fill.
Both models require a score above .03, select at most one side/contract per event, and reserve at most 1% of current cost-basis equity per order, subject to cash and correlated-exposure caps. This score threshold is fixed, not a confidence bound or an optimized parameter.
Models refit on March 1 through August 1, 2026. Training decisions stop five days before each fit, and every training label must independently be released strictly before that fit. Each head needs at least 45 distinct training days. A failed fit remains a failed candidate. Each month's predictions enter the archive before the next month's training accesses newly released outcomes.
All candidates share one continuous account per scenario, starting with 200 dollars; monthly refits never reset money or release pending positions. The costed scenario enters at the exact next hourly endpoint plus .01; the stress scenario uses two hours plus .02. Both retain the original .01 limit allowance. Missing endpoints never trigger a search for a better fill.
Shared one-, seven- and fourteen-day block resamples compare the entire candidate/cost family. Incomplete campaigns cannot pass the research gate. These are reused-development diagnostics on conditional historical execution. Actual September receipts remain recorded separately from assumed historical times. An account requiring contemporaneous verified receipts must stay in cash. No annual-optimality or future-profit claim follows.
Executable campaign, fixed first batch, statistical families.
Further reading used in the project
- Gneiting et al., calibrated probabilistic forecasting: distributional calibration.
- Gneiting and Ranjan, combining predictive distributions: coherent forecast combination.
- Snowberg and Wolfers, favorite–longshot bias: motivation for selective price-based hypotheses, not proof of a weather-market effect.
- Bailey et al., backtest overfitting: why trying more configurations demands stronger validation.
- Kalshi historical candle schema: units and endpoint semantics.
- NWS observation and climate-product FAQ: why preliminary and final temperature values can differ.
- Avellaneda and Stoikov, market making: inventory-sensitive quotes and the distinction between subjective valuation and execution prices.
- Kalshi netting and current settlement documentation: offsetting opposite positions and settling only remaining net positions.