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

Some improvements of plot.AccurateGLM() #40

Merged
merged 32 commits into from
Jan 5, 2020

Conversation

kkondo1981
Copy link
Owner

Fixed to use plot.AccurateGLM() with non-Gaussian models.

@kkondo1981
Copy link
Owner Author

todo

  • fix resids
  • restore par
  • draw setting

@kkondo1981
Copy link
Owner Author

Fixed the last two issues in my comment before this.

@kkondo1981
Copy link
Owner Author

Modify the last issue (partial residual plot for non-Gaussian models) as below.

  1. plot.AccurateGLM(resid=TRUE) uses working residuals for partial residuals as default like residuals.glm(type="partial")
  2. However, in some cases (e.g., Poisson regression with small mu), distributions of working residuals could have large variances and skewness. So it provides several options as below.
    a. Showing smoothed partial residuals as dotted lines with smooth_resid=TRUE, smooth_resid="both", or smooth_resid="smooth_only".
    b. Adding options to use other kinds of residuals (Pearson residuals, deviance residuals) with resid="pearson" or resid="deviance".
    c. Adding an option to use user-calculated residuals with resid=r (here, r is asuumed as a numeric vector).

Moreover, I added an example markdown file as below.
https://github.com/kkondo1981/aglm/blob/fix/plot-smallfix-20190706/examples/freMTPL2freq.rmd

@kkondo1981
Copy link
Owner Author

Further improvement to select smoother and to get clearer partial residual plots in the example.

@kkondo1981
Copy link
Owner Author

Further improvement to add rug plots with add_rug=TRUE in plot.AccurateGLM().

@kkondo1981 kkondo1981 changed the title Fix/plot smallfix 20190706 Some improvements of plot.AccurateGLM() Jan 5, 2020
@kkondo1981
Copy link
Owner Author

Finished tests and debugs.

@kkondo1981 kkondo1981 merged commit 5fba919 into master Jan 5, 2020
@kkondo1981 kkondo1981 mentioned this pull request Jan 5, 2020
@kkondo1981 kkondo1981 deleted the fix/plot-smallfix-20190706 branch January 5, 2020 07:47
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 this pull request may close these issues.

1 participant