tidyverts / tidyverts/fabletools

Reconciliation interface design

Open
#366 11 comments 0 reactions 1 assignee View on GitHub

@mitchelloharawild is already working on this.

Since Oct 6, 2022.

enhancement help wanted reconciliation
Dominant language
R
Stars
98
Forks
37
PR merge metrics
No merged PRs in 30d

Description

User-defined control parameters.

  1. Construction
  • Projection
  • Structural
  • ERM (low-priority)
  1. Weight matrix (typically requires access to model object and varies with data structure)
  • OLS
  • WLS
  • Structural
  • Sample
  • Shrinkage
  • More common types...
  • Time varying (maybe?)
  • Custom matrix
  1. Optimisation technique
  • Regular minimisation
  • Non-negative (LP, Heuristic)
  • Constraint matrix LP
  1. Data structure
  • Cross-sectional (Hierarchical & Grouped)
  • Temporal (Hierarchical & Grouped)
  • Cross-temporal
  • Arbitrary acyclical graphs (maybe?)
  • Disjoint
  1. Combination method/type
  • Additive
  • Linear combination

Are there more things that can be customised here?


User interface

Data structure and value combination method/type

Data structure and combination method are passed in via data attributes created at the aggregate_*() step.
Allow the user to directly impose data structure constraints, for example defining a pre-existing aggregation structure from the data.
This can also be used to remove aggregation structure to create disjoint hierarchies
For example, you may have a cross-temporal structure but only want to make it temporally coherent. To achieve this, you can remove the key aggregation constraints.

Hold onto aggregation structure in <tsibble>, and <mdl_lst>

Code

Allow reconciliation of mables, fitted models, and model definitions.

Option A - reconcile() on model with all params as args

reconcile(<mbl_df>, lm = min_trace(lm, ...), ...) # as before, maybe soft-deprecated?

mutate(<mbl_df>,  lm = reconcile(lm, ...), ...)
mutate(<mbl_df>,  lm_ols = reconcile(lm,weights = weight_ols), lm_shr = reconcile(lm,weights = weight_shr), ...)

reconcile(<mdl_lst>, ???) 
reconcile(<mdl_def>, ???)

reconcile(object, weights = weight_fn, construction = constr_fn, opt_method = opt_fn)

Option B - reconcile() on mable with opt function as reconcile input fn

reconcile(<mbl_df>, lm = gls(lm, weights = weight_fn,, ...), ...)
reconcile(<mbl_df>, lm = nn(lm, weights = weight_fn, ...), ...)
reconcile(<mbl_df>, lm = lp_constrained(lm, weights = weight_fn,, ...), ...)

reconcile(<mdl_lst>, opt_fn = gls, weights = weight_fn, ... ) #??? 
reconcile(<mdl_def>, ???)

Option C - reconcile() on mable with construction function as reconcile input fn

reconcile(<mbl_df>, lm = proj(lm, weights = weight_fn, ...), ...)
reconcile(<mbl_df>, lm = struc(lm, weights = weight_fn, ...), ...)

reconcile(<mdl_lst>, opt_fn = gls, weights = weight_fn, ... ) #??? 

Option D - reconcile() on mable with node utilisation function as reconcile input fn

reconcile(<mbl_df>, lm = top_down(lm, weights = weight_fn, optimiser = opt_fn, ...), ...)
reconcile(<mbl_df>, lm = middle_out(lm, weights = weight_fn, optimiser = opt_fn, ...), ...)
reconcile(<mbl_df>, lm = bottom_up(lm, weights = weight_fn, optimiser = opt_fn, ...), ...)
reconcile(<mbl_df>, lm = all_nodes(lm, weights = weight_fn, optimiser = opt_fn, ...), ...)

Attention: @danigiro, @robjhyndman, @GeorgeAthana

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.