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

A GMT version of linearfitxy #9

Open
joa-quim opened this issue Jan 30, 2023 · 1 comment
Open

A GMT version of linearfitxy #9

joa-quim opened this issue Jan 30, 2023 · 1 comment

Comments

@joa-quim
Copy link

Hi Rafael,

I've ported your linearfitxy function to work in GMT.jl and in the migration process the Distributions and Plots dependencies were dropped (replaced by GMT.jl functions alone).

Taking one of your examples I can now do

D = Misc.linearfitxy([0.0, 0.9, 1.8, 2.6, 3.3, 4.4, 5.2, 6.1, 6.5, 7.4], [5.9, 5.4, 4.4, 4.6, 3.5, 3.7, 2.8, 2.8, 2.4, 1.5], sx=1 ./ sqrt.([1000., 1000, 500, 800, 200, 80,  60, 20, 1.8, 1]), sy=1 ./ sqrt.([1., 1.8, 4, 8, 20, 20, 70, 70, 100, 500]));

>>> [± σ]  Y = (5.4799 ± 0.3592) + (-0.4805 ± 0.0706)*X
>>> [± 95% CI]  Y = (5.4799 ± 0.8284) + (-0.4805 ± 0.1629)*X
>>> Pearson ρ = -0.943;  Goodness of fit = 1.218

# This one was entirely re-written in *GMT.jl* and allows tuning all plotting parameters
plot_linfitxy(D, band_ab=true, band_CI=true, ellipses=true, show=true)

and get the figure bellow.

What I would like to ask you is if you would like to make a PR to GMT.jl with the contents of the ported function (in the zip attached to this post) so that the credits for this work are more openly visible.

Cheers

Joaquim

GMTjl_tmp
linearfitxy.zip

@rafael-guerra-www
Copy link
Owner

Hi Joaquim,

Thanks for your message and interest.
And I am happy to see that everything (and more) can be done in GMT.
I will be glad to make the PR to GMT, with a disclaimer (as per the package notes) :)

Regards,
Rafael

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

No branches or pull requests

2 participants