Code Monkey home page Code Monkey logo

Comments (2)

Dashadower avatar Dashadower commented on July 23, 2024 1

I don't know whether times in data vs transformed data is better.

I would rephrase that question into, "Do you expect the integration times to be able to vary, without any changes to the existing model?". If the answer is yes, then I would believe that moving times into data would be the correct option.

However, since we also handle the input data automatically within pysd, it would't hurt to just move it into data regardless, since that would remove the need for recompilation in the event that times changes.

from dataindm.

hyunjimoon avatar hyunjimoon commented on July 23, 2024

Some default choices, with the help of @hazhirr and @jandraor 's precious prior knowledge on SD modeler's default decisions. Let me know (as comment below) if you have additional knowledge that we can quantify! I am not sure whether 2 should be user or developer's duty. If it doesn't complicate the coding too much, we can supply. However, as users may find this measurement error concept new, I feel it is important to deliver this concept well; especially since this appears again in SOPS policy optimization of the second workflow 3.b. The state_init as est_param would be the famous latent data concept. Bob's prior knowledge and unexplained variation explains this better.

I will make 2 and 3 as new issue after getting @Dashadower 's confirmation.

Implementation duty are

  • on user: 1
  • on developer: 2,3
  1. penalize only the states (=stock)
    all comparison between simulated and observed state is done with stock variable. Users should change the structure within vensim, by adding artificial stock ([var_name]_state) that ensures its value is close to the value of the original type (observed data of flow or auxiliary variable).

  2. state_init as ass_param
    state_init is ass_param by default; when user selects to it as est_param, we need two machines under the hood:

  • add two est_param: initial (latent) value z_init and measurement error scale z_sigma

  • add times's length by one
    times is the index variable along which integration happens. Let's say we have length 20 observed state data series vector[20] y. Then,times is 1:19 for state_init is ass_param and 0:19 state_init is est_param. When state_init is ass_param, the length of times should be 19 (y[0] becomes y_init). However, when state_init is est_param, then the penalizing (between z_init and y_init happens from time 0.

The need for 1:19 for state_init as ass_param is bc we don't want to simulated what's already known as explained here.

  1. separate implementation of data2draws vs draws2data

a. data block
@Dashadower I don't know whether times in data vs transformed data is better.

data2draws has the following components

    int n_obs_state;
    int n_t;
    real initial_time;
    array[n_t] real times;
    array[n_t] vector[n_obs_state] y; //observed states

draws2data has the following components

    int n_obs_state;
    int n_t;
    real initial_time;
    array[n_t] real times;

b. function, transformed parameter block are the same

c. parameter and model block
only for data2draws

d. generated quantities block

  • y_ppc for both
  • log_lik for data2draws
  • _tilde for draws2data on generator logics (~ parameter and model block for data2draws)

Will commit the current fixes by today which includes some minor fixes (but not d.)

from dataindm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.