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

feat: Support fit_power_law(implementation = "plfit.p") to compute the P-value #1386

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

krlmlr
Copy link
Contributor

@krlmlr krlmlr commented Jun 1, 2024

Closes #1158.

Copy link
Contributor

aviator-app bot commented Jun 1, 2024

Current Aviator status

Aviator will automatically update this comment as the status of the PR changes.
Comment /aviator refresh to force Aviator to re-examine your PR (or learn about other /aviator commands).

This pull request is currently open (not queued).

How to merge

To merge this PR, comment /aviator merge or add the mergequeue label.


See the real-time status of this PR on the Aviator webapp.
Use the Aviator Chrome Extension to see the status of your PR within GitHub.

@krlmlr krlmlr marked this pull request as draft June 1, 2024 17:21
@krlmlr krlmlr removed the mergequeue label Jun 1, 2024
@aviator-app aviator-app bot added the blocked label Jun 1, 2024
Copy link
Contributor

aviator-app bot commented Jun 1, 2024

This pull request failed to merge: this PR is in draft state. Once the issues are resolved, remove the blocked label and re-queue the pull request. Note that the pull request will be automatically re-queued if it has the mergequeue label.

Additional debug info: PR was marked as draft after queueing

@szhorvat szhorvat added this to the 2.0.4 milestone Jun 20, 2024
@maelle
Copy link
Contributor

maelle commented Jul 2, 2024

I see I was tasked with refining the interface as needed, but I'd need some more pointers/context.

@Antonov548 Antonov548 marked this pull request as ready for review July 10, 2024 10:12
@Antonov548
Copy link
Contributor

@krlmlr I have added R_igraph_power_law_fit_new() and seems R_igraph_power_law_fit() not used anymore.

I have created R_igraph_power_law_fit_new() which doesn't use R_igraph_power_law_fit() to create result list with correct amount of fields.

I assume there is no tests for this function right now? I think we might need to add it using snapshot?

Copy link
Contributor Author

@krlmlr krlmlr left a comment

Choose a reason for hiding this comment

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

Thanks, looks good!

src/rinterface_extra.c Outdated Show resolved Hide resolved
IGRAPH_R_CHECK_BOOL(pvalue);
c_compute_pvalue = LOGICAL(pvalue)[0];

IGRAPH_R_CHECK(igraph_power_law_fit(&c_data, &c_res, c_xmin, c_force_continuous));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could also call the generated function and use lengthgets() to add an element to the returned list. This is better because we then would still rely on autogeneration for the better part of the code here.

Copy link
Contributor

@Antonov548 Antonov548 Jul 22, 2024

Choose a reason for hiding this comment

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

we can't use generated function. To compute p-value we need return value from igraph_power_law_fit C function, but we lose this data if use generated function. I think using generated function give to much overhead.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks @Antonov548!

@krlmlr do you have further thoughts on this?

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

Successfully merging this pull request may close these issues.

p-value missing for fit_power_law()
4 participants