epiverse-trace / epiverse-trace/finalsize

Provide a helper function to scale the matrix to have a dominant eigenvalue of 1.0

Open
#225 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
R
Stars
15
Forks
6
PR merge metrics
No merged PRs in 30d

Description

Scaling the contact matrix to have a dominant eigenvalue of 1 is a bit tricky to do by hand, but all the code to do it is already part of the package, so instead of throwing an error:

```
Error in finalsize::final_size(r0 = 1.5, combine_m, demo, susceptibility, :
Error: contact matrix must have a maximum real eigenvalue of 1.0
```

it would be nice if the package could provide a helper function to do that for you. The helper function should only need the current contact matrix and the population vector.

Contributor guide

Open the contributing guide

Research direction

Start by tracing final_size's contact-matrix validation and locate the existing code that calculates the matrix's dominant eigenvalue and scaling. Add the requested helper using only the contact matrix and population vector, then verify that its result has a maximum real eigenvalue of 1.0 and works with final_size.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
backend-api-design
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.