Skip to content

Small improvements to mlVARsim() #23

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

bsiepe
Copy link

@bsiepe bsiepe commented Jul 31, 2024

Description

  • Fixed small error where the random effects SD wasn't indexed correctly
  • Added the possibility to manually set the sparsity of the temporal and contemporaneous matrices (and updated the documentation accordingly)

This closes #22

Example/small test

The function now returns the same SD for all columns of the temporal matrix, as intended:

set.seed(4321)
library(mlVAR)
sim <- mlVARsim(
  nPerson = 100, 
  nNode = 4, 
  nTime = 100, 
  init_beta_SD = c(1, 1)
  )
sim$model$Beta$SD[,,1]
          [,1]      [,2]      [,3]      [,4]
[1,] 0.2287679 0.2287679 0.2287679 0.2287679
[2,] 0.2287679 0.2287679 0.2287679 0.2287679
[3,] 0.2287679 0.2287679 0.2287679 0.2287679
[4,] 0.2287679 0.2287679 0.2287679 0.2287679

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.

Potential improvements for mlVARsim()
1 participant