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

add variance module #145

Merged
merged 10 commits into from
Feb 8, 2024
Merged

add variance module #145

merged 10 commits into from
Feb 8, 2024

Conversation

zhaotianjing
Copy link
Collaborator

@zhaotianjing zhaotianjing commented Feb 6, 2024

wiki page: https://github.com/reworkhow/JWAS.jl/wiki/Constraint-on-variance-components

  1. change estimateScale to estimate_scale;
  2. delete mega_trait because it equals adding constraint on variances
  3. move constraint argument in runMCMC() to build_model(). This is to put all residual variance related argument together.
  4. add variance structural, and modify related code. add printed info if constraint; add error if constraint in ST
    mutable struct Variance
        val::Union{AbstractFloat, AbstractArray, Bool}   #value of the variance, e.g., single-trait: 1.5, two-trait: [1.3 0.4; 0.4 0.8]
        df::Union{AbstractFloat,Bool}                    #degrees of freedom, e.g., 4.0
        scale::Union{AbstractFloat, AbstractArray, Bool} #scale, e.g., single-trait: 1.0, two-trait: [1.0 0; 0 1.0]
    
        estimate_variance::Bool  #estimate_variance=true means estimate variance at each MCMC iteration
        estimate_scale::Bool     #estimate_scale=true means estimate scale at each MCMC iteration
        constraint::Bool        #constraint=true means in multi-trait analysis, covariance is zero
    end
    
  5. make scale in MT be a diagonal matrix everywhere
  6. organize arguments in build_model(), get_genotypes(), set_random ()
  7. relocate some comments in NNMM
  8. relocate initialization of scale_R, df_R to build_model()
  9. add R_constraint!() and G_constraint!() functions to change scale and df if constraint

@zhaotianjing zhaotianjing merged commit cd2e059 into master Feb 8, 2024
1 check passed
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.

2 participants