Skip to content
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
wants to merge 16 commits into
base: sienaMargins
Choose a base branch
from

Conversation

Kaladani
Copy link
Collaborator

@Kaladani Kaladani commented Jun 7, 2024

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

  • If possible, I have added tests that prove my fix is effective or that my feature works. See tests/testthat/test-sienaMargins.R
  • The package builds on my OS without issues
  • My changes generate no new warnings

Documentation

  • not made for release yet

… 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
@Kaladani Kaladani added the enhancement New feature or request label Jun 7, 2024
@Kaladani Kaladani requested a review from csteglich June 7, 2024 22:44
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
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants