Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hierarchical optimization in D2D #147

Open
wants to merge 24 commits into
base: master
Choose a base branch
from

Commits on Jan 30, 2020

  1. Configuration menu
    Copy the full SHA
    dc82ca3 View commit details
    Browse the repository at this point in the history
  2. Minor cleanup in hierarchical optimization

     - Improve the docstring in arCalcHierarchical
     - Remove a redundant line in arInitHierarchical
    gdudziuk committed Jan 30, 2020
    Configuration menu
    Copy the full SHA
    ae655ee View commit details
    Browse the repository at this point in the history

Commits on Jan 31, 2020

  1. Use argument sensi in arCalcHierarchical

    Previously, this argument was accepet but unused by arCalcHierarchical.
    Now it is used to avoid computing scale gradients and sensitivities of
    observables when not necessary.
    gdudziuk committed Jan 31, 2020
    Configuration menu
    Copy the full SHA
    ec877ff View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    539a55c View commit details
    Browse the repository at this point in the history
  3. Support hierarchical optimization with Matlab <R2019a

    Previously, arInitHierarchical was using isSymType, the latter being a
    function introduced in R2019a. This commit removes this dependence and
    instead implements a small custom function which does the trick.
    gdudziuk committed Jan 31, 2020
    Configuration menu
    Copy the full SHA
    ff37968 View commit details
    Browse the repository at this point in the history

Commits on Feb 4, 2020

  1. Fix bug in arInitHierarchical

    The scale parameters suitable for hierarchical optimization are those
    which appear _only_ in observables of form `s*xz` where `s` is the
    subject scale parameter and `xz` is a model species or a derived
    variable. Until now, arInitHierarchical has been detecting parameters
    which appear _at least in one_ observable of form `s*xz` (meaning that
    they were allowed to appear also in obervables of other form).
    Consequently, parameters not suitable for the hierarchical optimization
    could be detected by arInitHierarchical and the results of the
    hierarchical optimization could be not correct. This commit fixes it by
    adding extra checks in arInitHierarchical to make the latter function
    detect only the right parameters.
    gdudziuk committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    22b64d0 View commit details
    Browse the repository at this point in the history
  2. Add necessary assertion checks in arCalcHierarchical

    The implementation of hierarchical optimization depends on the specific
    form of the merit function. We currently assume the following one:
    
        J(s,p) = \sum_j (data_j - s*x(p,t_j))^2/std_j^2
    
    Each feature that modifies this expression also breaks the method of
    hierarchical optimization, making its results incorrect. To avoid this,
    in arCalcHierarchical we try to check if d2d features affecting the form
    of the merit function are enabled. This commit adds extra checks of this
    kind in arCalcHierarchical, hopefully making the checklist complete (or
    close to complete).
    gdudziuk committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    3211892 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    2c16a0e View commit details
    Browse the repository at this point in the history
  4. Remove some settings changes from arInitHierarchical

    The removed settings changes are redundant since these settings are
    tested anyway in arCalcHierarchical.
    gdudziuk committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    c3bbe5a View commit details
    Browse the repository at this point in the history

Commits on Feb 5, 2020

  1. Improve error fitting check in arCalcHierarchical

    Currently arCalcHierarchical requires no error fitting, meaning that
    there can be no dependence of errors on any fittable parameters. Until
    now, arCalcHierarchical has detected error fitting incorrectly,
    excluding some possible settings which actually had no error fitting. In
    other words, the test for error fitting has been to strict. This commit
    fixes the issue by implementing a better test for error fitting in
    arCalcHierarchical.
    gdudziuk committed Feb 5, 2020
    Configuration menu
    Copy the full SHA
    35b4c30 View commit details
    Browse the repository at this point in the history

Commits on Feb 7, 2020

  1. Update the help text of arInitHierarchical

    This commit updates the help text of arInitHierarchical to reflect the
    changes in its functionality introduced in commit c3bbe5a. This should
    had been done in that commit. Additionally, the present commit fixes a
    typo in the subject help text.
    gdudziuk committed Feb 7, 2020
    Configuration menu
    Copy the full SHA
    f619f6a View commit details
    Browse the repository at this point in the history

Commits on Feb 9, 2020

  1. Test feasibility of hierarchical optimization

    Hierarchical optimization is not feasible if the solution of the model
    is zero for all measurement times. This commit adds the respective
    assertion in arCalchierarchical.
    
    This extra assertion is not strictly necessary. Degeneration of the
    solution to zero would result in NaN scales, subsequently resulting in
    NaN residuals, which would trigger an error anyway. Nevertheless, with
    the extra assertion we get a more specific error message which may make
    it easier to debug.
    gdudziuk committed Feb 9, 2020
    Configuration menu
    Copy the full SHA
    70ef579 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b0cc36b View commit details
    Browse the repository at this point in the history

Commits on Feb 11, 2020

  1. Fix a bug in assertions in arCalcHierarchical

    Currently arCalcHierarchical requires no dependence of errors on any
    fittable parameters, neither explicitly nor implicitly. Until now,
    arCalcHierarchical has been asserting that there is no fitting of error
    parameters, but at the same time has been allowing implicit dependence
    of errors on fittable parameters of the model via observables. This is
    a bug since with such implicit dependence of errors on fittable
    parameters the results of arCalcHierarchical are incorrect. This commit
    fixes it by asserting the use of experimental errors, which are
    independent of the fittable parameters by definition.
    gdudziuk committed Feb 11, 2020
    Configuration menu
    Copy the full SHA
    1b7fb04 View commit details
    Browse the repository at this point in the history

Commits on Mar 2, 2020

  1. Remove some redundant lines in arCalcHierarchical

    At the moment, arCalcHierarchical allows experimental errors only, so
    the lines which handle the case of model-based errors are redundant and
    obscure the code. This commit removes such lines.
    
    See also commit 1b7fb04.
    gdudziuk committed Mar 2, 2020
    Configuration menu
    Copy the full SHA
    03c9f23 View commit details
    Browse the repository at this point in the history
  2. Fix a bug in arInitHierarchical

    In arInitHierarchical, the cell arrays xSyms and zSyms has been
    created assuming that there is only one model loaded (i.e. the length of
    the ar.model structure is 1). This commit corrects the support for
    multiple models in arInitHierarchical.
    gdudziuk committed Mar 2, 2020
    Configuration menu
    Copy the full SHA
    a35790f View commit details
    Browse the repository at this point in the history

Commits on Mar 3, 2020

  1. Fix a bug in arCalcHierarchical

    For certain purposes, in arCalcHierarchical we have been testing if all
    elements ar.model(im).data(id).useHierarchical are NaNs. But this cannot
    happen since the array useHierarchical is constructed such that its
    elements may be either false or true (and not NaN). So we should rather
    test if the elements of useHierarchical are all false. This commit fixes
    this issue.
    gdudziuk committed Mar 3, 2020
    Configuration menu
    Copy the full SHA
    0850ee7 View commit details
    Browse the repository at this point in the history

Commits on Mar 4, 2020

  1. Fix a bug in arCalcHierarchical - support data repetitions

    Until now, arCalcHierarchical has been working correctly only for data
    series with no duplicate time points (or, more generally, predictor
    values), despite D2D allows such duplicates in the data. This commit
    fixes this issue.
    gdudziuk committed Mar 4, 2020
    Configuration menu
    Copy the full SHA
    7feb387 View commit details
    Browse the repository at this point in the history
  2. Minor improvement in arInitHierarchical

    There has been a code snippet in a loop over observables which has been
    independent of the obervables. This has resulted in unnecessary repeated
    assignments inside this snippet. So this commit moves this snippet to a
    more suitable location in the body of arInitHierarchical.
    gdudziuk committed Mar 4, 2020
    Configuration menu
    Copy the full SHA
    7217136 View commit details
    Browse the repository at this point in the history
  3. Switch off unnecessary warnings in arInitHierarchical

    Function arInitHierarchical calls function isAlways which by default
    rasises a warning when testing a condition like `sym('a')==0`. Such
    conditions appear in run of normal operation of arInitHierarchical so
    the warning in question is unnecessary. This commit switches it off.
    gdudziuk committed Mar 4, 2020
    Configuration menu
    Copy the full SHA
    050f114 View commit details
    Browse the repository at this point in the history
  4. Loosen the assertion tests in arCalcHierarchical

    Some of the assertion tests in arCalcHierarchical should be required
    only for those observables which have parameters suitable for
    hierarchical optimization. Until now, arCalcHierarchical has been
    testing such assertions for all observables, thus being overly
    restrictive. This commit fixes this issue.
    gdudziuk committed Mar 4, 2020
    Configuration menu
    Copy the full SHA
    60c4617 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    aa40219 View commit details
    Browse the repository at this point in the history

Commits on Mar 5, 2020

  1. Configuration menu
    Copy the full SHA
    855c543 View commit details
    Browse the repository at this point in the history
  2. Fix a bug in arCalcHierarchical - support missing observations

    Until now, arCalcHierarchical has been working correctly only for data
    series with no missing observations, despite D2D allows such data. This
    commit fixes this issue.
    gdudziuk committed Mar 5, 2020
    Configuration menu
    Copy the full SHA
    14319ec View commit details
    Browse the repository at this point in the history