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

Stat.smooth() confidence bands #1231

Merged
merged 1 commit into from
Dec 30, 2018
Merged

Conversation

Mattriks
Copy link
Member

  • I've updated the documentation to reflect these changes
  • I've added an entry to NEWS.md
  • I've added and/or updated the unit tests
  • I've run the regression tests
  • I've built the docs and confirmed these changes don't cause new errors

This PR:

Examples

salaries = dataset("car","Salaries")
salaries.Salary /= 1000.0
salaries.Discipline = ["Discipline $(x)" for x in salaries.Discipline] 

p = plot(salaries[salaries.Rank.=="Prof",:], x=:YrsService, y=:Salary, 
    color=:Sex, xgroup = :Discipline,
    Geom.subplot_grid(Geom.point,
     layer(Stat.smooth(method=:lm, levels=[0.95, 0.99]), Geom.line, Geom.ribbon)), 
    Scale.xgroup(levels=["Discipline A", "Discipline B"]),
    Guide.colorkey(title="", pos=[0.43w, -0.4h]), 
    Theme(point_size=2pt,
        lowlight_color=c->RGBA{Float32}(c.r, c.g, c.b, 0.2) )
)

stat_smooth1

x = range(0.1, stop=4.9, length=30)
D = DataFrame(x=x, y=x.+randn(length(x)))

p = plot(D, x=:x, y=:y, Geom.point,
     layer(Stat.smooth(method=:lm, levels=[0.90,0.99]), Geom.line, Geom.ribbon(fill=false)),
     Theme(lowlight_color=c->"gray", line_style=[:solid, :dot])
)

stat_smooth2

@codecov-io
Copy link

codecov-io commented Dec 28, 2018

Codecov Report

Merging #1231 into master will increase coverage by 1.57%.
The diff coverage is 95.65%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #1231      +/-   ##
=========================================
+ Coverage   83.53%   85.1%   +1.57%     
=========================================
  Files          35      35              
  Lines        4033    4103      +70     
=========================================
+ Hits         3369    3492     +123     
+ Misses        664     611      -53
Impacted Files Coverage Δ
src/geom/ribbon.jl 100% <100%> (ø) ⬆️
src/misc.jl 62.82% <100%> (+12.82%) ⬆️
src/statistics.jl 89.45% <92.68%> (+1.79%) ⬆️
src/varset.jl 97.77% <0%> (-2.23%) ⬇️
src/Gadfly.jl 75.3% <0%> (-0.43%) ⬇️
src/guide.jl 83.65% <0%> (+0.28%) ⬆️
src/shapes.jl 98.03% <0%> (+0.98%) ⬆️
src/theme.jl 70.17% <0%> (+3.5%) ⬆️
src/geometry.jl 75% <0%> (+3.57%) ⬆️
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8e155b8...754d116. Read the comment docs.

src/misc.jl Show resolved Hide resolved
@Mattriks
Copy link
Member Author

Added a unit test (in testscripts/nan_skipping.jl), rebased and squashed commits - done!

@bjarthur bjarthur merged commit 6b52046 into GiovineItalia:master Dec 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants