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

16 improve print and summary #44

Merged
merged 8 commits into from
Dec 7, 2024
Merged

Conversation

dan9401
Copy link
Collaborator

@dan9401 dan9401 commented Nov 25, 2024

@EchoRLiu @martinrd3D

This achieves mostly what summary.lm and print.lm are doing. Please take a look.

One remaining item to achieve the following behavior of summary.lm, we need a summary.lm class. I'm not sure if we want to do that.

a = summary(lmfit) # this does not print the output
a                  # this prints the output
``

@dan9401 dan9401 linked an issue Nov 25, 2024 that may be closed by this pull request
@dan9401
Copy link
Collaborator Author

dan9401 commented Nov 25, 2024

The GitHub action failure seems to be due to a current update issue
https://forum.posit.co/t/r-cmd-check-fails-on-macos-latest-release-r-lib-actions-setup-r-v2/195084/3

Likely will be resolved in a few days when brew recipes are updated.

@dan9401
Copy link
Collaborator Author

dan9401 commented Nov 30, 2024

Current print.robustGARCH and summary.robustGARCH output:

> data("gspc")
> fit <- robGarch(gspc[1:604], methods="BM", fixed_pars = c(0.8, 3.0))
fit
> fit

Model:  BM

Coefficients:
   gamma     alpha      beta  
7.30e-06  4.13e-02  8.12e-01

> summary(fit)

Model: BM, div = 0.8, k = 3
Data: gspc[1:604]
Observations: 604

Result:
       Estimate  Std.Error  t-statistic  p-value  significance
gamma  0         0          0.022        0.982                
alpha  0.041     5.711      0.007        0.994                
beta   0.812     11.715     0.069        0.945                
---
Signif. codes:  0 '***'' 0.001 '**'' 0.01 '*' 0.05 '.' 0.1 '' 1

Initial parameter estimates:
gamma  alpha   beta  
 0.64   0.00   0.40  

Log-likelihood: 2.0533
Optimizer: Rsolnp
Time elapsed: 3.10632 secs
Convergence Message: 0

@martinrd3D
Copy link
Collaborator

martinrd3D commented Nov 30, 2024 via email

@dan9401
Copy link
Collaborator Author

dan9401 commented Nov 30, 2024

The rest of the comment in the issue should be addressed, with the exception of:

  1. Improve print.robustGARCH() and summary.robustGARCH() to follow lm #16 (comment), we'll need a custom algo to determine frequency, for the date we would need the input to be enforced to xts.
  2. The digits of the loglikelihood is fixed to 6 digits. Otherwise, when we set the display to a smaller number it looks weird.

@martinrd3D
Copy link
Collaborator

martinrd3D commented Nov 30, 2024 via email

@dan9401 dan9401 force-pushed the 16-improve-print-and-summary branch from 120bfa4 to 9eba516 Compare December 7, 2024 17:49
@dan9401 dan9401 merged commit 3f65aac into master Dec 7, 2024
5 checks passed
@dan9401 dan9401 deleted the 16-improve-print-and-summary branch December 7, 2024 18:02
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.

Improve print.robustGARCH() and summary.robustGARCH() to follow lm
2 participants