Data4DM / BayesSD

Data for Decision, Affordable Analytics for All
7 stars 0 forks source link

Dynamic aggregation; best cluster may be different from clustered result #34

Closed hyunjimoon closed 4 months ago

hyunjimoon commented 1 year ago

Richard's video on phylogenetic regression and gaussian process expresses generative aggregation and disaggregation. One it is generative model (whose definition is prior distribution's proper i.e. can be normalized to area 1 distribution function), aggregation and disaggregation are reversible.

image

Our estimated parameters are: a. time of disaggregation b. subgroups

For a, inferring time is natural as Hazhir's covid model running in your computer includes "Variant Intro Start Time[Rgn]". Regime change model using hidden markov model would be relevant.

For b, if we start from the entire set of disaggregated candidates, we can use clustering, but starting from one agent then disaggregate, I have no idea. I think we can always assume binary disaggregation as we have flexibility in time (a). A methodology called splitting (in rare event simulation domain) might be relevant.

Code-wise, Stan's changepoint detection from latent discrete parameter setting is relevant: https://mc-stan.org/docs/stan-users-guide/change-point.html

I have once documented the below in SystemStructure of DailyDigest folder .

SD community [1] Heterogeneity and Network Structure, 2010 by Hazhir and John which compares Agent-Based and Differential Equation Models on different network structure which I wish to connect with no-pooling (separate) VS complete-pooling (perfect mixing) or centered (similar effect with no-pooling) VS non-centered parameterization (similar effect with complete-pooling) in Hierarchical Bayesian. There are several Bayesian literature that analyzes the condition (e.g. scarce data) where one of the two outperforms other. For parameterization, it is known alternating the two is optimal.

[2] last Twinkie, 2017 and aggregate cats, 2010 post from Tom's blog. The first is related to hierarchy hidden in order fullfillment ratio lookup function (M:1 mapping of SupplyLine SKU to Shipment item). The second extends the above paper, introducing disaggregate representation of the population using approximation from this paper on obesity diffusion.

Bayes community [3] Gaining Efficiency by Combining Analytical and Numerical Methods to Solve ODEs: Implementation in Stan and Application to Bayesian PK/PD Modeling, 2017

[4] Stan discourse on hierarchical prey-predator starting from Hierarchical Lotka Volterra and ending with Estimating Parameters for Chaotic Systems which includes Charles' CStem package for hierarchical SDE (2018)

hyunjimoon commented 1 year ago

Dynamic aggregation of time i.e. changing time_step may be implemented with making time_step as data type and creating a cum_time function which is time-time interpolated.

The following is the version with equal time_step, but by changing "0 * time_step" parts etc, we may be able to model varying time_step.

real dataFunc__process_noise_std_norm_data(real time, real time_step){
    // DataStructure for variable process_noise_std_norm_data
    real slope;
    real intercept;

    if(time <= 1 * time_step){
        intercept = 0.7395293231104392;
        slope = (1.4114852518882715 - 0.7395293231104392)/ time_step;
        return intercept + slope * (time - 0 * time_step);
    }
    else if(time <= 2 * time_step){
        intercept = 1.4114852518882715;
        slope = (1.049332920968392 - 1.4114852518882715)/ time_step;
        return intercept + slope * (time - 1 * time_step);
    }
    else if(time <= 3 * time_step){
        intercept = 1.049332920968392;
        slope = (0.44919441937611876 - 1.049332920968392)/ time_step;
        return intercept + slope * (time - 2 * time_step);
    }