Skip to content

Commit

Permalink
update summary method with return
Browse files Browse the repository at this point in the history
  • Loading branch information
dan9401 committed Nov 25, 2024
1 parent b8bceb8 commit 8fe5a3a
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions R/robustGARCH-summary.R
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,14 @@ summary.robustGARCH <- function(object, digits = 3, ...){
else if (p < 0.1) "."
else ""
})
res <- rbind(round(fitted_pars, digits),
coefficients <- rbind(round(fitted_pars, digits),
round(fit$standard_error, digits),
round(fit$t_value, digits),
round(fit$p_value, digits),
significance)
colnames(res) <- names(fitted_pars)
rownames(res) <- c("Estimate", "Std.Error", "t-statistic", "p-value", "")
res = t(res)
round(fit$p_value, digits))
colnames(coefficients) <- names(fitted_pars)
rownames(coefficients) <- c("Estimate", "Std.Error", "t-statistic", "p-value")
coefficients = t(coefficients)
res = cbind(coefficients, significance)
cat("\n")
cat("Result:")
cat("\n")
Expand Down Expand Up @@ -119,6 +119,16 @@ summary.robustGARCH <- function(object, digits = 3, ...){
cat("\n")
cat(conv_str)
cat("\n")

# summary object
converged = ifelse(fit$message == 0, TRUE, FALSE) # I'm not sure if this is true
summary_list = list(
method = method,
coefficients = coefficients,
loglikelihood = fit$objective,
converged = converged
)
invisible(summary_list)
}

#' @rdname robustGARCH-summary
Expand Down

0 comments on commit 8fe5a3a

Please sign in to comment.