Skip to content

Less local effects and some Code Functionality Updates - #146

Open
Kaladani wants to merge 22 commits into
developfrom
lessLocal-pr
Open

Less local effects and some Code Functionality Updates#146
Kaladani wants to merge 22 commits into
developfrom
lessLocal-pr

Conversation

@Kaladani

Copy link
Copy Markdown
Collaborator

Description

Adds a family of geometrically-weighted (GW) distance-2 and dyadwise-shared-partner
effects, on the network side, the behavior side, and as diffusion-rate exposure
effects, plus supporting group-level effect corrections and a build-system cleanup.

  • Added activity alter effect and a non-centered variant of popularity alter.
  • Added totGwdspFF/totGwdspFB (+ _nc): network-only structural controls for
    the existing totGwdspFFAlt/totGwdspFBAlt influence effects (they depend on
    ego's GW two-path/two-star count only, not on indirect alters' behavior).
  • Added totGwInAltDist2_nc: alter-wise GW version of the distance-2 family
    behavior effects (non-centered only for now).
  • Added covariate gwdspFFX/gwdspFBX (+ _nc) and gwdist2XFF_nc/gwdist2XFB_nc:
    GW building blocks for weighted indirect homophily on the network side.
  • Added diffusion-rate effects gwdspFFExposure/gwdspFBExposure and
    gwdist2FFExposure/gwdist2FBExposure, the GW counterparts of
    totInExposureDist2/anyInExposureDist2. There are currently no FF versions
    of the distance 2 exposure effects (and no BB version of any indirect influence or exposure effect).
  • Corrected and expanded group-level effects (avGroup/totGroup family,
    DegreeWeightedAverageGroupEffect).
  • Added non-centered (_nc) variants of altX, egoX, egoXaltX, totInDist2,
    gwInAltDist2 as lower-order controls; covariate effects now more consistently
    respect non-centering even when the covariate itself is user-centered.
  • Consolidated several separate non-centered effect classes
    (AverageAlterInDist2NCEffect, TotalGwdspAlterNCEffect) into an nc constructor
    flag on the corresponding main class (AverageAlterInDist2Effect,
    TotalGwdspAlterEffect); fixed a latent bug in QuadraticShapeNCEffect (currently
    not set in allEffects.csv, so not user-facing anyway).
  • Added BehaviorEffect::resolvedValue(actor, nc) and
    CovariateDependentNetworkEffect::resolvedValue(actor, nc), helpers that resolve
    a stored actor/covariate value to its centered or non-centered form depending on
    an nc flag, and switched every effect class with such a flag to use them
    instead of duplicating the centering logic inline. Could be expanded to other centering versions as well. Note that BehaviorEffect::value() returns the non-centered value while CovariateDependentNetworkEffect::value() returns the centered value (opposite conventions for the same method name).
  • Fixed: avGroupEgoX/totGroupEgoX rows in allEffects.csv for
    behaviorOneModeObjective/behaviorSymmetricObjective (pre-existing on
    develop) dispatched to AverageGroupEgoEffect, a network-side effect, so
    specifying them as behavior effects would have constructed the wrong class.
    Removed the erroneous rows; the correct network-side rows are untouched.
  • Removed unused/superseded effect classes AverageTwoInStarAlterEffect,
    DoubleMixedStarEffect, StarMixedStarEffect, and generic helpers
    MixedOnlyTwoPathFunction, SameCovariateInTiesFunction2.
  • Fixed two LaTeX bugs in the manual that prevented it from building: a
    \end{verbatim}} construct whose trailing brace was silently swallowed by
    the verbatim environment's own end-detection, leaving a {\footnotesize
    group unclosed for the rest of the document.
  • Restructured src/sources.list to a multi-line, easily diffable format with
    an automated update script (update_sources_list.sh/update_sources_unix.sh);
    updated configure/configure.ac/configure.win/Makevars accordingly, to
    avoid a build-time dependency on shell globbing for source discovery (per
    Writing R Extensions' guidance on Makevars).

Checklist:

Checks

  • If possible, I have added tests that prove my fix is effective or that my feature works
    checkEffects.R was extended to cover all new effects (see diff); tests
    confirmed behavior-preserving on tests/newparallel.R after the
    resolvedValue refactor.
  • The package builds on my OS without issues — verified via R CMD build +
    R CMD INSTALL on macOS (arm64); ./configure regenerates src/Makevars
    byte-identical to the committed version, confirming sources.list is in sync.
  • My changes generate no new warnings — R CMD check --as-cran on macOS
    (aarch64): 0 errors, 0 warnings, 4 NOTEs.

Documentation

  • I have commented my code inline, particularly in hard-to-understand areas
  • If function added/modified, I have added/modified documentation (in .R file)
    N/A: no exported R functions were added or modified in this PR.
  • If effect added/modified, I have added/modified section 12 of the manual
    also fixed two pre-existing LaTeX bugs blocking the manual build (see above).
  • I have added a description of all changes to this pull request above and to the NEWS.md file
  • I have bumped the version in the DESCRIPTION and man/RSiena-package.md files by the appropriate increment:
    • minor (1.6.10 → 1.6.11) — new functionality (new effects), backwards compatible

…or the indirect behavior and indire t homophily effects and new implementation of non centered effects (mostly via nc flag in main effect isntead of new classes) where necessary.
…d update script, that looks for all files. Writing R Extensions recommend preventing the dependency fully: https://cran.r-project.org/doc/manuals/r-devel/R-exts.html#Using-Makevars

Track makevars files again (as long as makevars(.win) is stored it should also be tracked?)

Also repairs and refresh makevar files
…a update_source_unix bash script that can be used to automatically add missing cpps to the source list and reconfigure the script. To just update the source list e.g. also on windows the update_sources_list.sh script can be used.
Also add resolvedValue as an option to handle non-centered and centered versions of behavior effects.

The manual has been adjusted accordingly.

Added testthat scripts (for the weighted variants, not the pure avGroup effects), but checkEffects has still to be updated
Add non centered variant of popularity alter effect.
…havior effects. They can only be non-centered.
Cleanup other diffusion rate effects

Update tests

Cleanup various old files and errors.
…d indirect homophily

Also more correctly handle non-cenetered effects for covariates even if they are centered by the user.
Improve diffusion effects logic to have mutable non-const changeContribution and proximityValue methods to allow some cached value updates.

Rename and document gwdspFBX effect.
…nd make local benchmark and testthat easier to use.

Also add some buildignore to handle vscode files (but those should not really surface in develop anyway).
@Kaladani

Kaladani commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator Author

I have fixed a bug in one effects contribution accumulation (invisible in the egoStatistic check - but not verified against the changeContributions). Otherwise I can also update Description etc. to the current state or do you want to do that when merging?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant