-
Notifications
You must be signed in to change notification settings - Fork 25
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
Added functions to extract expected probabilities #102
Open
Kaladani
wants to merge
16
commits into
stocnet:sienaMargins
Choose a base branch
from
Kaladani:sienaMargins
base: sienaMargins
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… calculate expected probabilities for ministeps as well as marginal effects. Currently only impelements a reduced expectedRelativeImportance function to calculate expected probabilities for observed networks RSiena::expectedChangeProbabilities
… calculate expected probabilities for ministeps as well as marginal effects. Currently only impelements a reduced expectedRelativeImportance function to calculate expected probabilities for observed networks RSiena::expectedChangeProbabilities
…into sienaMargins
…into sienaMargins
…into sienaMargins
…into sienaMargins
…tional simulation runs?)
testthat::test_dir("tests/testthat") and devtools::test() run succesfully.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Added invisible functions (not exported to namespace and only accessible via RSiena:::functionName()) that extract expected change probabilities for the observed data (RSiena:::expectedChangeProbabilities), as well as a first version of RSiena:::expectedChangeDynamics() to extract the change probabilities for each ministep. Both are provisionally stored in a single sienaMargins.r together with helper functions softmax() and calculateChoiceProbability(). All functions are based on code from sienaRI.r and sienaRIDynamics.r. They are meant to provide a starting point and could potentially have similar memory leakage problems as the original sienaRI-functions.
Currently, only expectedChangeProbabilities() does actually calculate all possible choices (for the first potential mini-steps in the observed network), while expectedChangeDynamics() does only calculate the choice probabilities for the focal actor in each simulated mini-step. Being able to use the mini-steps actually done in the original fit of the model might also be preferable in the future.
The rate function is ignored for now, the probabilities are all conditional on choosing the respective focal actor.
Update 2024-06-10: I have also set up a testthat infrastructure in the branch and the corresponding test file for sienaMargins.R runs succesfully.
Checklist:
Checks
Documentation