Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
115 changes: 115 additions & 0 deletions tests/testthat/_snaps/fit-gq.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
# print() method works after gq

Code
expect_s3_class(fit_gq$print(), "CmdStanGQ")
Output
variable mean median sd mad q5 q95
y_rep[1]
y_rep[2]
y_rep[3]
y_rep[4]
y_rep[5]
y_rep[6]
y_rep[7]
y_rep[8]
y_rep[9]
y_rep[10]

# showing 10 of 11 rows (change via 'max_rows' argument or 'cmdstanr_max_rows' option)

---

Code
fit_gq$print(max_rows = 1)
Output
variable mean median sd mad q5 q95
y_rep[1]

# showing 1 of 11 rows (change via 'max_rows' argument or 'cmdstanr_max_rows' option)

---

Code
fit_gq$print(NULL, c("mad"))
Output
variable mad
y_rep[1]
y_rep[2]
y_rep[3]
y_rep[4]
y_rep[5]
y_rep[6]
y_rep[7]
y_rep[8]
y_rep[9]
y_rep[10]

# showing 10 of 11 rows (change via 'max_rows' argument or 'cmdstanr_max_rows' option)

---

Code
fit_gq$print(max_rows = 2)
Output
variable mean median sd mad q5 q95
y_rep[1]
y_rep[2]

# showing 2 of 11 rows (change via 'max_rows' argument or 'cmdstanr_max_rows' option)

---

Code
fit_gq$print(max_rows = 11)
Output
variable mean median sd mad q5 q95
y_rep[1]
y_rep[2]
y_rep[3]
y_rep[4]
y_rep[5]
y_rep[6]
y_rep[7]
y_rep[8]
y_rep[9]
y_rep[10]
sum_y

---

Code
fit_gq$print("y_rep", max_rows = 2)
Output
variable mean median sd mad q5 q95
y_rep[1]
y_rep[2]

# showing 2 of 10 rows (change via 'max_rows' argument or 'cmdstanr_max_rows' option)

---

Code
fit_gq$print("y_rep")
Output
variable mean median sd mad q5 q95
y_rep[1]
y_rep[2]
y_rep[3]
y_rep[4]
y_rep[5]
y_rep[6]
y_rep[7]
y_rep[8]
y_rep[9]
y_rep[10]

---

Code
fit_gq$print(c("y_rep[1]", "sum_y", "y_rep[3]"))
Output
variable mean median sd mad q5 q95
y_rep[1]
sum_y
y_rep[3]

23 changes: 23 additions & 0 deletions tests/testthat/_snaps/fit-laplace.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# summary() and print() methods works after laplace

Code
expect_s3_class(fit_laplace$print(), "CmdStanLaplace")
Output
variable mean median sd mad q5 q95
lp__
lp_approx__
alpha
beta[1]
beta[2]
beta[3]

---

Code
fit_laplace$print(max_rows = 1)
Output
variable mean median sd mad q5 q95
lp__

# showing 1 of 6 rows (change via 'max_rows' argument or 'cmdstanr_max_rows' option)

127 changes: 127 additions & 0 deletions tests/testthat/_snaps/fit-mcmc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
# print() method works after mcmc

Code
expect_s3_class(fit_mcmc$print(), "CmdStanMCMC")
Output
variable mean median sd mad q5 q95 rhat ess_bulk ess_tail
lp__
alpha
beta[1]
beta[2]
beta[3]

---

Code
fit_mcmc$print(max_rows = 1)
Output
variable mean median sd mad q5 q95 rhat ess_bulk ess_tail
lp__

# showing 1 of 5 rows (change via 'max_rows' argument or 'cmdstanr_max_rows' option)

---

Code
fit_mcmc$print(NULL, c("ess_sd"))
Output
variable ess_sd
lp__
alpha
beta[1]
beta[2]
beta[3]

---

Code
fit$print()
Output
variable mean median sd mad q5 q95 rhat ess_bulk ess_tail
lp__
mu
tau
theta_raw[1]
theta_raw[2]
theta_raw[3]
theta_raw[4]
theta_raw[5]
theta_raw[6]
theta_raw[7]

# showing 10 of 19 rows (change via 'max_rows' argument or 'cmdstanr_max_rows' option)

---

Code
fit$print(max_rows = 2)
Output
variable mean median sd mad q5 q95 rhat ess_bulk ess_tail
lp__
mu

# showing 2 of 19 rows (change via 'max_rows' argument or 'cmdstanr_max_rows' option)

---

Code
fit$print(max_rows = 19)
Output
variable mean median sd mad q5 q95 rhat ess_bulk ess_tail
lp__
mu
tau
theta_raw[1]
theta_raw[2]
theta_raw[3]
theta_raw[4]
theta_raw[5]
theta_raw[6]
theta_raw[7]
theta_raw[8]
theta[1]
theta[2]
theta[3]
theta[4]
theta[5]
theta[6]
theta[7]
theta[8]

---

Code
fit$print("theta", max_rows = 2)
Output
variable mean median sd mad q5 q95 rhat ess_bulk ess_tail
theta[1]
theta[2]

# showing 2 of 8 rows (change via 'max_rows' argument or 'cmdstanr_max_rows' option)

---

Code
fit$print("theta")
Output
variable mean median sd mad q5 q95 rhat ess_bulk ess_tail
theta[1]
theta[2]
theta[3]
theta[4]
theta[5]
theta[6]
theta[7]
theta[8]

---

Code
fit$print(c("theta[1]", "tau", "mu", "theta_raw[3]"))
Output
variable mean median sd mad q5 q95 rhat ess_bulk ess_tail
theta[1]
tau
mu
theta_raw[3]

22 changes: 22 additions & 0 deletions tests/testthat/_snaps/fit-mle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# print() method works after optimization

Code
expect_s3_class(fit_mle$print(), "CmdStanMLE")
Output
variable estimate
lp__
alpha
beta[1]
beta[2]
beta[3]

---

Code
fit_mle$print(max_rows = 1)
Output
variable estimate
lp__

# showing 1 of 5 rows (change via 'max_rows' argument or 'cmdstanr_max_rows' option)

88 changes: 88 additions & 0 deletions tests/testthat/_snaps/fit-vb.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# print() method works after vb

Code
expect_s3_class(fit_vb$print(), "CmdStanVB")
Output
variable mean median sd mad q5 q95
lp__
lp_approx__
alpha
beta[1]
beta[2]
beta[3]

---

Code
fit_vb$print(max_rows = 1)
Output
variable mean median sd mad q5 q95
lp__

# showing 1 of 6 rows (change via 'max_rows' argument or 'cmdstanr_max_rows' option)

---

Code
fit$print()
Output
variable mean median sd mad q5 q95
lp__
lp_approx__
mu
tau
theta_raw[1]
theta_raw[2]
theta_raw[3]
theta_raw[4]
theta_raw[5]
theta_raw[6]

# showing 10 of 20 rows (change via 'max_rows' argument or 'cmdstanr_max_rows' option)

---

Code
fit$print(max_rows = 20)
Output
variable mean median sd mad q5 q95
lp__
lp_approx__
mu
tau
theta_raw[1]
theta_raw[2]
theta_raw[3]
theta_raw[4]
theta_raw[5]
theta_raw[6]
theta_raw[7]
theta_raw[8]
theta[1]
theta[2]
theta[3]
theta[4]
theta[5]
theta[6]
theta[7]
theta[8]

---

Code
fit$print(c("theta", "tau", "lp__", "lp_approx__"))
Output
variable mean median sd mad q5 q95
theta[1]
theta[2]
theta[3]
theta[4]
theta[5]
theta[6]
theta[7]
theta[8]
tau
lp__

# showing 10 of 11 rows (change via 'max_rows' argument or 'cmdstanr_max_rows' option)

Loading
Loading