nutterb / dbn Goto Github PK
View Code? Open in Web Editor NEWSimulation of Discrete-Time Dynamic Bayesian Networks
Simulation of Discrete-Time Dynamic Bayesian Networks
In the expanded plot view, the time propagates vertically. It is more customary to propagate horizontally.
Change the dbn
object to so that every dynamic node references an object-wide value for max_t
.
set_node_maxt
will not longer be relevant. Replace with set_maxt
.
Making nodes dynamic will no longer need to check for a max_t
value.
Assume the model:
g <- dbn(map[t] | map[t-1]*map[t-2]*map[t-3], maxt=3)
Wouldn't we require at least 3 initial time steps worth of data to even be able to do the simulations?
In general, we need to figure out the largest time lag specified in the model - call this quantity L (L=3 in the above network).
In order to be able to run the simulations, our predict.dbn()
function would need to require that the values for times 0:(L-1)
have all been provided as inputs by the user. Then the function would simulate the system over times L:maxt
. Obviously this would require some logic to ensure that maxt>=L
.
grep_extract
expand_node
get_dynamic_time
I won't open a new issue for this each time. I'll just keep adding checkboxes to make sure I do things in the right order (and write the appropriate documentation and tests before I move on to the next task)
model_form_to_node_form
model_form_to_node_form
dbn.formula
dbn.formula
dbn.list
dbn.list
dbn
dbn
I've left this section largely blank. It will need detail added when we've finalized its structure.
If I'm going to skip building the models at the time the network is built, I'll need some sort of validation that the model the user passes has the same variables as the parents. so
See dag_structure
for hints on getting the variable names from the formula. Compare these to the node_attrs
node_name
and parent
columns.
As of 28 October, 2016 it reads
Generate a Dynamic Bayesian Network. This section needs more detail as well. As the crux of the package, perhaps a brief introduction to the topic and its application. Maybe wait until the first vignette is written, and copy content from there?
I suspect the initial setup will be similar to HydeNet
.
We will need an object on which to act, so let's call that dbn
. It will need the following attributes
tbl_df
) objects, which allow and models to be stored in the table)The node attributes need to include
Rather than gathering all of the information to build a model, let's instead have them directly insert the model. If we aren't pushing the simulation out to JAGS, we don't need as diverse an object to accommodate direct JAGS coding.
The only immediate downside I see to this is it won't let use simulate from models for which we don't have an object; such as a published model. I'm not quite sure how to handle that yet.
Need a formula
and a list
method.
We will have to restrict the use of xtabs
to a single variable. Unless I can be given a reasonable interpretation of what a multivariable xtabs
should look like in a network.
Model types
xtabs
lm
glm
ols
lrm
multinom
cph
survreg
The node_attr
object needs a new column for predict_fn
. when a node model is set, if a valid predict
method is available, the predict.object_type
could be given as a default.
The user can define his or her own prediction function. We will need a set_node_predict_fn
. This is how we can define deterministic nodes without a model.
Return the object in a list. First element is data for non-dynamic nodes.
Additional elements at each time point of the dynamic nodes(?).
Provide a tidy
method to bring all the elements together into a two dimensional tidy data frame.
In particular, the Description
field needs some content.
I think the graph handles it okay, though I need to explore more.
How do the models handle it?
node_*
notation.perhaps look into these for the plotting methods.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.