Skip to content

Fix package metadata and clarify installation instructions - #12

Open
meibujun wants to merge 20 commits into
masterfrom
codex/fix-installation-instructions-for-animalbreeding.jl
Open

Fix package metadata and clarify installation instructions#12
meibujun wants to merge 20 commits into
masterfrom
codex/fix-installation-instructions-for-animalbreeding.jl

Conversation

@meibujun

@meibujun meibujun commented Oct 2, 2025

Copy link
Copy Markdown
Owner

Summary

  • correct the Project.toml structure by adding a UUID and removing the invalid [name] section
  • update the README installation instructions to reference the real repository URL and subdirectory

Testing

  • not run (Julia is not available in the execution environment)

https://chatgpt.com/codex/tasks/task_e_68de39b3e1848321b88a1648ac49e777

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting

Comment thread AnimalBreeding.jl/src/blup/reml.jl Outdated
Comment on lines +79 to +82
# 更新残差方差
residuals = y - X * solutions[1:n_fixed] - sum(Z * solutions[n_fixed+1:end] for (name, Z) in Z_dict)
s_y = dot(residuals, residuals)
tr_term = tr(C_inv[1:n_fixed, 1:n_fixed] * (X' * X)) # 简化

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Slice random-effect coefficients per effect when forming residuals

In estimate_variances_reml the residual vector is built with sum(Z * solutions[n_fixed+1:end] for (name, Z) in Z_dict). This multiplies every random-effect design matrix by the entire concatenated random-effect solution vector. As soon as the model contains more than one random effect, the column count of each Z no longer matches the length of solutions[n_fixed+1:end], producing a DimensionMismatch before REML can iterate. Even if it did not error, each effect would be double-counted. Slice solutions for each effect instead of passing the whole tail on every multiplication.

Useful? React with 👍 / 👎.

Comment thread AnimalBreeding.jl/src/blup/reml.jl Outdated
Comment on lines +92 to +96
if effect.type == :additive && !isnothing(dm.A_inv_matrix)
u_Ainv_u = dot(u, dm.A_inv_matrix * u)
tr_term_u = tr(C_inv[current_pos+1:end, current_pos+1:end] * dm.A_inv_matrix) # 简化
variances_new[name] = (u_Ainv_u + tr_term_u) / dim
end

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Use block of C⁻¹ matching each random effect when computing traces

Within the same REML loop the trace term for additive effects uses C_inv[current_pos+1:end, current_pos+1:end] together with dm.A_inv_matrix. When more than one random effect is present, that slice spans all remaining random-effect coefficients, so its dimensions exceed A_inv and the matrix product triggers a DimensionMismatch. The trace and u_Ainv_u calculations need to use the submatrix current_pos+1:current_pos+dim that corresponds to the current effect only.

Useful? React with 👍 / 👎.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant