-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deterministic nodes with factor parents #65
Comments
This is another one I'll spend some time thinking about. I'll come up with something. |
Consider this example:
Given the current structure, the only thing I can think that would make it feasible to give the factor level would be to use a utility function here. So if I wanted the equivalent of
the The upside is that you don't have to remember all of the variable codings. The downside is that it has the potential to be much more typing. But the only other place this gets processed is in writing the JAGS code, and there's no good way to tie the numeric coding to a factor variable at that point. I'll write up the function. You can tell me if you want to use it at all. :) |
Is there maybe an escape character that we could use instead of quotation #Bust# which would tell HydeNet to call such a function? On Fri, Oct 30, 2015 at 11:08 AM, Benjamin [email protected] wrote:
|
It's possible we could use something like However, as I think about it, we could create our own handy dandy little intermediary function with a weird syntax. for example: jagsFunc(formula, ...) where the
returns a formula object Alternatively, we might have I'm rambling. that might work actually. |
This is now implemented into the |
Beautiful. Now on to the beggar->chooser transition: is it possible to build logic into the formula evaluation such that if it sees any quoted elements it knows to pass it through factorFormula() without the user explicitly calling it?
|
Truthfully, yes. It just means passing every formula through |
I like that. All under the hood. Thanks! On Fri, Oct 30, 2015 at 2:36 PM, Benjamin [email protected] wrote:
|
I seem to be unable to pass node formulas through
|
I think I got it...
|
Do we want to alert the user to unconverted factor levels? In the below example, we try to use a factor level for node It is generally a good idea to proceed through the network in topological order (basically starting from the root nodes and populating children only when all parent nodes have been populated). Doing so will avoid issues like this. Do we want to go so far as disallowing
|
I added an error in circumstances where there is no accompanying |
This can be difficult, since we have to write formulas which reference factor levels. Currently, we have to do so by referencing the integer index of the factor level we want.
Rather than fumble around trying to give you a closed-form example of R code that tries to describe what I'm talking about, I will invite you to go into the Decision Networks vignette and attempt defining the
payoff
utility node usingsetNode()
. Or, if that's actually not possible, modifying the network structure (e.g., by adding nodes) in such a way that the payoff can be calculated.In the meantime, I'll switch to working on the Setting Nodes and Getting Started vignettes.
The text was updated successfully, but these errors were encountered: