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

Degrees of freedom in standard deviation computation #135

Closed
daikitag opened this issue Feb 11, 2024 · 3 comments · Fixed by #136
Closed

Degrees of freedom in standard deviation computation #135

daikitag opened this issue Feb 11, 2024 · 3 comments · Fixed by #136

Comments

@daikitag
Copy link
Collaborator

When performing validation, I realized that there is a slight discrepancy between the phenotype simulation output of tstrait and AlphaSimR, and it was due to the degrees of freedom input when computing the standard deviation https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.std.html. AlphaSimR uses $N$ as a divisor instead of $N-1$, so we should also add one more input ddof to normalise_phenotypes function, such that the user can define how the standard deviation is being computed.

@gregorgorjanc
Copy link
Member

FYI We do this because our AlphaSimR populations have all the data so we are not calculating sample variance, but population variance

@daikitag
Copy link
Collaborator Author

FYI We do this because our AlphaSimR populations have all the data so we are not calculating sample variance, but population variance

Thank you for letting me know about it. I digged inside the AlphaSimR code to find out where the discrepancy is coming from, and I'm glad to hear your explanation.

@gregorgorjanc
Copy link
Member

Feel free to reach out for any AlphaSimR questions;)

@daikitag daikitag linked a pull request Feb 11, 2024 that will close this issue
@mergify mergify bot closed this as completed in #136 Feb 12, 2024
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 a pull request may close this issue.

2 participants