Dear Community,
I am following the PDF version of the tutorial for SMILE wrappers, specifically for the Python language.
To simulate a dataset from a hybrid Bayesian network with both categorical and continuous variables, we need to:
Define the conditional probability tables (CPTs) for categorical variables.
Define conditional distributions (like linear Gaussians) for continuous variables that depend on a mix of categorical and continuous parents.
Your network structure:
* $C \rightarrow A \rightarrow D$
* $B \rightarrow D$
* $E \rightarrow D$
Variable types:
Categorical: `A`, `B`, `C`
Continuous: `D`, `E`
We'll assume:
All categorical variables have 2 categories: 0 and 1.
Continuous variables are sampled from normal distributions.
For `D`, which has both categorical and continuous parents (`A`, `B`, `E`), we'll model it using a conditional linear Gaussian distribution.
I want to do a similar thing in my previous post, "My example of simulating categorical model and parameter learning," and "Help needed for my example of simulating continuous model and parameter learning. Parameter learning wrong."
These are the things I am doing:
1. First, simulate a dataset based on a predefined network.
2. I tried structured learning from a simulated dataset and checked what the output network structure looks like.
3. Construct an predefined network without parameters, using the simulated dataset for parameter learning.
4. Double-checked if the learned parameter aligns with the predefined parameter used when the simulated dataset is defined.
I found that
1. The structured learning has failed.
2. EM learning has also failed.
3. Construct a predefined network; the state of A looks wrong?
Could you please check if the way I simulate the dataset makes sense? Why did some of the above-mentioned parts fail?
I am still new to Bayesian Networks, please correct anything I missed.
All related code is attached.
Thank you very much.
Help needed for my example of simulating hybrid model (with categorical and continuous model) and parameter learning
-
- Posts: 14
- Joined: Tue Jun 10, 2025 3:51 pm
Help needed for my example of simulating hybrid model (with categorical and continuous model) and parameter learning
- Attachments
-
- hybrid_model.zip
- (25.37 KiB) Downloaded 10 times