bdynsys: Bayesian Dynamic System Modeling

Description Usage Arguments Author(s) References Examples

View source: R/bdynsys.R

Description

bdynsys is a package for panel/longitudinal data that combines methods to model changes in up to four indicators over time as a function of the indicators itself and up to four predictors using ordinary differential equations (ODEs) with polynomial terms that allow to model complex and nonlinear effects. A Bayesian model selection approach is implemented. The package provides also visualisation tools to plot phase portraits of the dynamic system, showing the complex co-evolution of two indicators over time with the possibility to highlight trajectories for specified entities (e.g. countries, individuals). bdynsys is also the name of the main function in the bdynsys package, that performs the bayesian dynamic systems modeling.

Usage

1
bdynsys(dataset, indnr, paramnr, x, y, z, v)

Arguments

dataset

a plm pdata.frame panel data frame.

indnr

an integer number indicating number of indicators, to be included in the modeling procedure

paramnr

an integer number indicating number of modelparameters, this is the maximum number of polynomial terms included.

x

a reference to variable from the paneldata to be included as indicator 1 in the modeling procedure.

y

a reference to variable from the paneldata to be included as indicator 2 in the modeling procedure.

z

a reference to variable from the paneldata to be included as indicator 3 in the modeling procedure.

v

a reference to variable from the paneldata to be included as indicator 4 in the modeling procedure.

Author(s)

Viktoria Spaiser: viktoria.sp@web.de

References

Ranganathan, S./Spaiser, V./Mann, R.P./Sumpter, D.J.T. (2014) Bayesian Dynamical Systems Modelling in the Social Sciences. PLoS ONE, 9(1):e86468.

Examples

1
2
3
## Bayesian Dynamic System Modeling with two variables and one modelparameter

bdynsys(datap, 2, 1, datap$logGDP, datap$EmanzV)

Example output

[1] LL:  -454
[1] Rsqr:               0.00110011001100119
[1] LL:               -450.425438884535
[1] Rsqr:              0.0089649309471167
[1] LL:              -452.32195797317
[1] Rsqr:               0.00479217167619417
[1] LL:               -459.940642682879
[1] Rsqr:               -0.0119706109634308
[1] LL:               -469.952288147614
[1] Rsqr:               -0.0339984337681283
[1] LL:              -455.01343411466
[1] Rsqr:                -0.00112966801905334
[1] LL:               -453.156500519134
[1] Rsqr:               0.00295599445734995
[1] LL:               -462.050079826679
[1] Rsqr:              -0.016611836802374
[1] LL:               -478.656573688743
[1] Rsqr:               -0.0531497770929439
[1] LL:               -467.248232619012
[1] Rsqr:               -0.0280489166534907
[1] LL:               -450.354014551511
[1] Rsqr:               0.00912208019469529
[1] LL:              -494.15653635833
[1] Rsqr:               -0.0872531052988559
[1] LL:               -468.356849208515
[1] Rsqr:               -0.0304881170704399
[1] LL:               -475.175394107963
[1] Rsqr:               -0.0454904160791259
[1] LL:               -520.102451729285
[1] Rsqr:              -0.144339827787206
[1] LL:               -454.760530483233
[1] Rsqr:                 -0.000573224385552074
[1] LL:               -500.236684847312
[1] Rsqr:             -0.10063076974106
[1] LL:  -454
[1] Rsqr:               0.00110011001100108
[1] LL:               -467.423799369204
[1] Rsqr:               -0.0284352021324628
[1] LL:               -479.965124675431
[1] Rsqr:               -0.0560288771736657
[1] LL:               -443.015862627404
[1] Rsqr:              0.0252676289826095
[1] LL:               -437.575465587556
[1] Rsqr:              0.0372376994773238
[1] LL:               -494.850093455008
[1] Rsqr:               -0.0887790835093696
[1] LL:               -466.451265902831
[1] Rsqr:               -0.0262954145276817
[1] LL:               -447.124199780585
[1] Rsqr:              0.0162283833210446
[1] LL:               -430.647519972321
[1] Rsqr:              0.0524807041313061
[1] LL:               -434.431453653934
[1] Rsqr:              0.0441552174830946
[1] LL:               -482.968046319188
[1] Rsqr:               -0.0626359654987625
[1] LL:               -433.319991480538
[1] Rsqr:              0.0466006788106968
[1] LL:               -509.920462344633
[1] Rsqr:             -0.12193721087928
[1] LL:               -428.010589481729
[1] Rsqr:              0.0582825313933363
[1] LL:               -439.827086820882
[1] Rsqr:              0.0322836373577956
[1] LL:               -499.817296857252
[1] Rsqr:               -0.0997080238883437
[1] LL:               -537.002341813794
[1] Rsqr:              -0.181523304320779
[1] LL:               -450.354014551511
[1] Rsqr:               0.00912208019469529
[1] Model # 1       of size 1       is:    
dx     =      +      0.0012 /x^2  
[1] LL:               -450.425438884535
[1] Rsqr:              0.0089649309471167
[1] Model # 2       of size 1       is:    
dx     =      +      0.0016 /x    
[1] LL:              -452.32195797317
[1] Rsqr:               0.00479217167619417
[1] Model # 3       of size 1       is:    
dx      =       +       0.00089 /y     
[1] "--------------------------------------------"
[1] LL:               -428.010589481729
[1] Rsqr:              0.0582825313933363
[1] Model # 1       of size 1       is:    
dy     =      +      0.0071 x^3   
[1] LL:               -430.647519972321
[1] Rsqr:              0.0524807041313061
[1] Model # 2       of size 1       is:    
dy     =      +      0.0096 x*y   
[1] LL:               -433.319991480538
[1] Rsqr:              0.0466006788106968
[1] Model # 3       of size 1       is:    
dy    =     +     0.015 y^2  
[1] "--------------------------------------------"
[1] Selected model terms (dx):
[1] 11
[1] Selected model terms (dy):
[1] 14
[1] Bayes factors of the best models per number of modelterms for dx:
[2] -486.153082283061                                                
[1] Bayes factors of the best models per number of modelterms for dy:
[2] -434.748088879215                                                

bdynsys documentation built on May 2, 2019, 9:42 a.m.

Related to bdynsys in bdynsys...