Access method for bru_log
objects.
Note: Up to version 2.8.0
, bru_log()
was a deprecated alias for
bru_log_message()
. When running on 2.8.0
or earlier, use bru_log_get()
to access the global log, and cat(fit$bru_iinla$log, sep = "\n")
to print a
stored estimation object log.
After version 2.8.0
, use bru_log()
to access the global log, and
bru_log(fit)
to access a stored estimation log.
Usage
bru_log(x = NULL, verbosity = NULL)
# S3 method for class 'character'
bru_log(x, verbosity = NULL)
# S3 method for class 'bru_log'
bru_log(x, verbosity = NULL)
# S3 method for class 'iinla'
bru_log(x, verbosity = NULL)
# S3 method for class 'bru'
bru_log(x, verbosity = NULL)
# S3 method for class 'bru_log'
print(x, ..., timestamp = TRUE, verbosity = FALSE)
# S3 method for class 'bru_log'
as.character(x, ...)
# S3 method for class 'bru_log'
x[i]
# S3 method for class 'bru_log'
c(...)
# S3 method for class 'bru_log'
length(x)
Arguments
- x
An object that is, contains, or can be converted to, a
bru_log
object. IfNULL
, refers to the globalinlabru
log.- verbosity
integer value for limiting the highest verbosity level being returned.
- ...
further arguments passed to or from other methods.
- timestamp
If
TRUE
, include the timestamp of each message. DefaultTRUE
.- i
indices specifying elements to extract. If
character
, denotes the sequence between bookmarki
and the next bookmark (or the end of the log ifi
is the last bookmark)
Value
bru_log
A bru_log
object, containing a
character vector of log messages, and potentially a vector of bookmarks.
Methods (by generic)
print(bru_log)
: Print abru_log
object withcat(x, sep = "\n")
. Ifverbosity
isTRUE
, include the verbosity level of each message.as.character(bru_log)
: Convertbru_log
object to a plaincharacter
vector[
: Extract a subset of abru_log
objectc(bru_log)
: Concatenate severalbru_log
orcharacter
objects into abru_log
object.length(bru_log)
: Obtain the number of log entries into abru_log
object.
Functions
bru_log()
: Extract stored log messages. If non-NULL
, theverbosity
argument determines the maximum verbosity level of the messages to extract.
See also
Other inlabru log methods:
bru_log_bookmark()
,
bru_log_message()
,
bru_log_new()
,
bru_log_offset()
,
bru_log_reset()
Examples
bru_log(verbosity = 2L)
#> 2025-01-17 10:49:08.787405: inlabru loaded
#> 2025-01-17 10:49:08.787937: Clear override options
#> 2025-01-17 10:49:13.74769: iinla: Iteration 1 [max:1]
#> 2025-01-17 10:49:14.510574: iinla: Iteration 1 [max:10]
#> 2025-01-17 10:49:14.967932: iinla: Iteration 2 [max:10]
#> 2025-01-17 10:49:15.686527: iinla: Max deviation from previous: 0.222% of SD, and line search is inactive
#> [stop if: <10% and line search inactive]
#> 2025-01-17 10:49:15.687026: iinla: Convergence criterion met.
#> Running final INLA integration step with known theta mode.
#> 2025-01-17 10:49:15.688027: iinla: Iteration 3 [max:10]
#> 2025-01-17 10:49:16.315163: iinla: Iteration 1 [max:10]
#> 2025-01-17 10:49:16.727432: iinla: Step rescaling: 27.2% (norm0 = 208.3, norm1 = 256.3, norm01 = 395.2)
#> 2025-01-17 10:49:16.759547: iinla: Iteration 2 [max:10]
#> 2025-01-17 10:49:17.182003: iinla: Step rescaling: 99.6% (norm0 = 255.4, norm1 = 12.89, norm01 = 256.4)
#> 2025-01-17 10:49:17.218971: iinla: Max deviation from previous: 52900% of SD, and line search is active
#> [stop if: <10% and line search inactive]
#> 2025-01-17 10:49:17.220021: iinla: Iteration 3 [max:10]
#> 2025-01-17 10:49:17.63601: iinla: Step rescaling: 102% (norm0 = 12.89, norm1 = 0.01798, norm01 = 12.89)
#> 2025-01-17 10:49:17.672427: iinla: Max deviation from previous: 599% of SD, and line search is active
#> [stop if: <10% and line search inactive]
#> 2025-01-17 10:49:17.673568: iinla: Iteration 4 [max:10]
#> 2025-01-17 10:49:18.135002: iinla: Max deviation from previous: 10.1% of SD, and line search is inactive
#> [stop if: <10% and line search inactive]
#> 2025-01-17 10:49:18.136043: iinla: Iteration 5 [max:10]
#> 2025-01-17 10:49:18.592415: iinla: Max deviation from previous: 0.111% of SD, and line search is inactive
#> [stop if: <10% and line search inactive]
#> 2025-01-17 10:49:18.592969: iinla: Convergence criterion met.
#> Running final INLA integration step with known theta mode.
#> 2025-01-17 10:49:18.593982: iinla: Iteration 6 [max:10]
#> 2025-01-17 10:49:22.24262: iinla: Iteration 1 [max:1]
print(bru_log(), timestamp = TRUE, verbosity = TRUE)
#> 2025-01-17 10:49:08.787405: inlabru loaded (level 1)
#> 2025-01-17 10:49:08.787937: Clear override options (level 1)
#> 2025-01-17 10:49:13.633718: iinla: Evaluate component inputs (level 3)
#> 2025-01-17 10:49:13.658664: iinla: Evaluate component linearisations (level 3)
#> 2025-01-17 10:49:13.659371: Linearise component 'x' (level 4)
#> 2025-01-17 10:49:13.686852: Linearise component 'Intercept' (level 4)
#> 2025-01-17 10:49:13.694739: iinla: Evaluate component simplifications (level 3)
#> 2025-01-17 10:49:13.695565: Simplify component 'x' (level 4)
#> 2025-01-17 10:49:13.703829: Simplify component 'Intercept' (level 4)
#> 2025-01-17 10:49:13.711462: iinla: Evaluate predictor linearisation (level 3)
#> 2025-01-17 10:49:13.72434: iinla: Construct inla stack (level 3)
#> 2025-01-17 10:49:13.747187: iinla: Model initialisation completed (level 3)
#> 2025-01-17 10:49:13.74769: iinla: Iteration 1 [max:1] (level 1)
#> 2025-01-17 10:49:14.421715: iinla: Evaluate component inputs (level 3)
#> 2025-01-17 10:49:14.448371: iinla: Evaluate component linearisations (level 3)
#> 2025-01-17 10:49:14.448927: Linearise component 'x' (level 4)
#> 2025-01-17 10:49:14.458153: Linearise component 'Intercept' (level 4)
#> 2025-01-17 10:49:14.465566: iinla: Evaluate component simplifications (level 3)
#> 2025-01-17 10:49:14.466099: Simplify component 'x' (level 4)
#> 2025-01-17 10:49:14.474135: Simplify component 'Intercept' (level 4)
#> 2025-01-17 10:49:14.481778: iinla: Evaluate predictor linearisation (level 3)
#> 2025-01-17 10:49:14.483417: Linearise with respect to component 'x' (level 4)
#> 2025-01-17 10:49:14.488651: Linearise with respect to component 'Intercept' (level 4)
#> 2025-01-17 10:49:14.491103: iinla: Construct inla stack (level 3)
#> 2025-01-17 10:49:14.510062: iinla: Model initialisation completed (level 3)
#> 2025-01-17 10:49:14.510574: iinla: Iteration 1 [max:10] (level 1)
#> 2025-01-17 10:49:14.928625: iinla: Step rescaling: 100%, Approx Optimisation (norm0 = 343.2, norm1 = 0, norm01 = 343.2) (level 3)
#> 2025-01-17 10:49:14.929124: iinla: Optimisation did not improve on previous solution. (level 3)
#> 2025-01-17 10:49:14.929545: iinla: |lin1-lin0| = 343.2
#> <eta-lin1,delta>/|delta| = 0
#> |eta-lin0 - delta <delta,eta-lin0>/<delta,delta>| = 3.109e-14 (level 4)
#> 2025-01-17 10:49:14.930453: iinla: Evaluate component linearisations (level 3)
#> 2025-01-17 10:49:14.930922: Linearise component 'x' (level 4)
#> 2025-01-17 10:49:14.939071: Linearise component 'Intercept' (level 4)
#> 2025-01-17 10:49:14.946521: iinla: Evaluate predictor linearisation (level 3)
#> 2025-01-17 10:49:14.947728: Linearise with respect to component 'x' (level 4)
#> 2025-01-17 10:49:14.949967: Linearise with respect to component 'Intercept' (level 4)
#> 2025-01-17 10:49:14.967932: iinla: Iteration 2 [max:10] (level 1)
#> 2025-01-17 10:49:15.650698: iinla: Step rescaling: 162%, Expand (norm0 = 7.367e-07, norm1 = 2.814e-07, norm01 = 4.553e-07) (level 3)
#> 2025-01-17 10:49:15.651872: iinla: Step rescaling: 100%, Overstep (norm0 = 4.553e-07, norm1 = 3.78e-14, norm01 = 4.553e-07) (level 3)
#> 2025-01-17 10:49:15.653504: iinla: Step rescaling: 100%, Approx Optimisation (norm0 = 4.553e-07, norm1 = 3.78e-14, norm01 = 4.553e-07) (level 3)
#> 2025-01-17 10:49:15.653933: iinla: Optimisation did not improve on previous solution. (level 3)
#> 2025-01-17 10:49:15.654336: iinla: |lin1-lin0| = 4.553e-07
#> <eta-lin1,delta>/|delta| = -4.086e-15
#> |eta-lin0 - delta <delta,eta-lin0>/<delta,delta>| = 3.758e-14 (level 4)
#> 2025-01-17 10:49:15.65522: iinla: Evaluate component linearisations (level 3)
#> 2025-01-17 10:49:15.655657: Linearise component 'x' (level 4)
#> 2025-01-17 10:49:15.663651: Linearise component 'Intercept' (level 4)
#> 2025-01-17 10:49:15.671006: iinla: Evaluate predictor linearisation (level 3)
#> 2025-01-17 10:49:15.672292: Linearise with respect to component 'x' (level 4)
#> 2025-01-17 10:49:15.674531: Linearise with respect to component 'Intercept' (level 4)
#> 2025-01-17 10:49:15.686527: iinla: Max deviation from previous: 0.222% of SD, and line search is inactive
#> [stop if: <10% and line search inactive] (level 1)
#> 2025-01-17 10:49:15.687026: iinla: Convergence criterion met.
#> Running final INLA integration step with known theta mode. (level 1)
#> 2025-01-17 10:49:15.688027: iinla: Iteration 3 [max:10] (level 1)
#> 2025-01-17 10:49:16.24029: iinla: Evaluate component inputs (level 3)
#> 2025-01-17 10:49:16.266198: iinla: Evaluate component linearisations (level 3)
#> 2025-01-17 10:49:16.266726: Linearise component 'z' (level 4)
#> 2025-01-17 10:49:16.274288: Linearise component 'Intercept' (level 4)
#> 2025-01-17 10:49:16.281647: iinla: Evaluate component simplifications (level 3)
#> 2025-01-17 10:49:16.282238: Simplify component 'z' (level 4)
#> 2025-01-17 10:49:16.289598: Simplify component 'Intercept' (level 4)
#> 2025-01-17 10:49:16.296988: iinla: Evaluate predictor linearisation (level 3)
#> 2025-01-17 10:49:16.298253: Linearise with respect to component 'z' (level 4)
#> 2025-01-17 10:49:16.300664: Linearise with respect to component 'Intercept' (level 4)
#> 2025-01-17 10:49:16.3028: iinla: Construct inla stack (level 3)
#> 2025-01-17 10:49:16.314641: iinla: Model initialisation completed (level 3)
#> 2025-01-17 10:49:16.315163: iinla: Iteration 1 [max:10] (level 1)
#> 2025-01-17 10:49:16.723566: iinla: Step rescaling: 61.8%, Contract (norm0 = 2292, norm1 = 2107, norm01 = 395.2) (level 3)
#> 2025-01-17 10:49:16.724733: iinla: Step rescaling: 38.2%, Contract (norm0 = 460.2, norm1 = 339.3, norm01 = 395.2) (level 3)
#> 2025-01-17 10:49:16.726558: iinla: Step rescaling: 27.2%, Approx Optimisation (norm0 = 208.3, norm1 = 256.3, norm01 = 395.2) (level 3)
#> 2025-01-17 10:49:16.727033: iinla: |lin1-lin0| = 395.2
#> <eta-lin1,delta>/|delta| = -225.8
#> |eta-lin0 - delta <delta,eta-lin0>/<delta,delta>| = 121.3 (level 4)
#> 2025-01-17 10:49:16.727432: iinla: Step rescaling: 27.2% (norm0 = 208.3, norm1 = 256.3, norm01 = 395.2) (level 2)
#> 2025-01-17 10:49:16.728303: iinla: Evaluate component linearisations (level 3)
#> 2025-01-17 10:49:16.72874: Linearise component 'z' (level 4)
#> 2025-01-17 10:49:16.736222: Linearise component 'Intercept' (level 4)
#> 2025-01-17 10:49:16.743528: iinla: Evaluate predictor linearisation (level 3)
#> 2025-01-17 10:49:16.744847: Linearise with respect to component 'z' (level 4)
#> 2025-01-17 10:49:16.747302: Linearise with respect to component 'Intercept' (level 4)
#> 2025-01-17 10:49:16.759547: iinla: Iteration 2 [max:10] (level 1)
#> 2025-01-17 10:49:17.181024: iinla: Step rescaling: 99.6%, Approx Optimisation (norm0 = 255.4, norm1 = 12.89, norm01 = 256.4) (level 3)
#> 2025-01-17 10:49:17.181566: iinla: |lin1-lin0| = 256.4
#> <eta-lin1,delta>/|delta| = -1.292
#> |eta-lin0 - delta <delta,eta-lin0>/<delta,delta>| = 12.83 (level 4)
#> 2025-01-17 10:49:17.182003: iinla: Step rescaling: 99.6% (norm0 = 255.4, norm1 = 12.89, norm01 = 256.4) (level 2)
#> 2025-01-17 10:49:17.182891: iinla: Evaluate component linearisations (level 3)
#> 2025-01-17 10:49:17.183338: Linearise component 'z' (level 4)
#> 2025-01-17 10:49:17.190981: Linearise component 'Intercept' (level 4)
#> 2025-01-17 10:49:17.198506: iinla: Evaluate predictor linearisation (level 3)
#> 2025-01-17 10:49:17.204979: Linearise with respect to component 'z' (level 4)
#> 2025-01-17 10:49:17.207481: Linearise with respect to component 'Intercept' (level 4)
#> 2025-01-17 10:49:17.218971: iinla: Max deviation from previous: 52900% of SD, and line search is active
#> [stop if: <10% and line search inactive] (level 1)
#> 2025-01-17 10:49:17.220021: iinla: Iteration 3 [max:10] (level 1)
#> 2025-01-17 10:49:17.632117: iinla: Step rescaling: 162%, Expand (norm0 = 20.29, norm1 = 7.4, norm01 = 12.89) (level 3)
#> 2025-01-17 10:49:17.633291: iinla: Step rescaling: 100%, Overstep (norm0 = 12.67, norm1 = 0.2192, norm01 = 12.89) (level 3)
#> 2025-01-17 10:49:17.635063: iinla: Step rescaling: 101.8%, Approx Optimisation (norm0 = 12.89, norm1 = 0.01798, norm01 = 12.89) (level 3)
#> 2025-01-17 10:49:17.635564: iinla: |lin1-lin0| = 12.89
#> <eta-lin1,delta>/|delta| = -2.965e-05
#> |eta-lin0 - delta <delta,eta-lin0>/<delta,delta>| = 0.01798 (level 4)
#> 2025-01-17 10:49:17.63601: iinla: Step rescaling: 102% (norm0 = 12.89, norm1 = 0.01798, norm01 = 12.89) (level 2)
#> 2025-01-17 10:49:17.636918: iinla: Evaluate component linearisations (level 3)
#> 2025-01-17 10:49:17.637375: Linearise component 'z' (level 4)
#> 2025-01-17 10:49:17.64526: Linearise component 'Intercept' (level 4)
#> 2025-01-17 10:49:17.652645: iinla: Evaluate predictor linearisation (level 3)
#> 2025-01-17 10:49:17.654047: Linearise with respect to component 'z' (level 4)
#> 2025-01-17 10:49:17.657445: Linearise with respect to component 'Intercept' (level 4)
#> 2025-01-17 10:49:17.672427: iinla: Max deviation from previous: 599% of SD, and line search is active
#> [stop if: <10% and line search inactive] (level 1)
#> 2025-01-17 10:49:17.673568: iinla: Iteration 4 [max:10] (level 1)
#> 2025-01-17 10:49:18.098708: iinla: Step rescaling: 162%, Expand (norm0 = 0.02912, norm1 = 0.01112, norm01 = 0.018) (level 3)
#> 2025-01-17 10:49:18.100035: iinla: Step rescaling: 100%, Overstep (norm0 = 0.018, norm1 = 1.151e-07, norm01 = 0.018) (level 3)
#> 2025-01-17 10:49:18.101886: iinla: Step rescaling: 100%, Approx Optimisation (norm0 = 0.018, norm1 = 1.147e-07, norm01 = 0.018) (level 3)
#> 2025-01-17 10:49:18.102389: iinla: |lin1-lin0| = 0.018
#> <eta-lin1,delta>/|delta| = 1.968e-10
#> |eta-lin0 - delta <delta,eta-lin0>/<delta,delta>| = 1.147e-07 (level 4)
#> 2025-01-17 10:49:18.103337: iinla: Evaluate component linearisations (level 3)
#> 2025-01-17 10:49:18.103818: Linearise component 'z' (level 4)
#> 2025-01-17 10:49:18.111737: Linearise component 'Intercept' (level 4)
#> 2025-01-17 10:49:18.119369: iinla: Evaluate predictor linearisation (level 3)
#> 2025-01-17 10:49:18.120728: Linearise with respect to component 'z' (level 4)
#> 2025-01-17 10:49:18.123258: Linearise with respect to component 'Intercept' (level 4)
#> 2025-01-17 10:49:18.135002: iinla: Max deviation from previous: 10.1% of SD, and line search is inactive
#> [stop if: <10% and line search inactive] (level 1)
#> 2025-01-17 10:49:18.136043: iinla: Iteration 5 [max:10] (level 1)
#> 2025-01-17 10:49:18.556201: iinla: Step rescaling: 162%, Expand (norm0 = 3.436e-07, norm1 = 1.312e-07, norm01 = 2.123e-07) (level 3)
#> 2025-01-17 10:49:18.557426: iinla: Step rescaling: 100%, Overstep (norm0 = 2.123e-07, norm1 = 8.273e-13, norm01 = 2.123e-07) (level 3)
#> 2025-01-17 10:49:18.55913: iinla: Step rescaling: 100%, Approx Optimisation (norm0 = 2.123e-07, norm1 = 7.25e-13, norm01 = 2.123e-07) (level 3)
#> 2025-01-17 10:49:18.559617: iinla: |lin1-lin0| = 2.123e-07
#> <eta-lin1,delta>/|delta| = 3.094e-14
#> |eta-lin0 - delta <delta,eta-lin0>/<delta,delta>| = 7.244e-13 (level 4)
#> 2025-01-17 10:49:18.560524: iinla: Evaluate component linearisations (level 3)
#> 2025-01-17 10:49:18.560994: Linearise component 'z' (level 4)
#> 2025-01-17 10:49:18.568549: Linearise component 'Intercept' (level 4)
#> 2025-01-17 10:49:18.57615: iinla: Evaluate predictor linearisation (level 3)
#> 2025-01-17 10:49:18.577518: Linearise with respect to component 'z' (level 4)
#> 2025-01-17 10:49:18.580078: Linearise with respect to component 'Intercept' (level 4)
#> 2025-01-17 10:49:18.592415: iinla: Max deviation from previous: 0.111% of SD, and line search is inactive
#> [stop if: <10% and line search inactive] (level 1)
#> 2025-01-17 10:49:18.592969: iinla: Convergence criterion met.
#> Running final INLA integration step with known theta mode. (level 1)
#> 2025-01-17 10:49:18.593982: iinla: Iteration 6 [max:10] (level 1)
#> 2025-01-17 10:49:22.156326: iinla: Evaluate component inputs (level 3)
#> 2025-01-17 10:49:22.186205: iinla: Evaluate component linearisations (level 3)
#> 2025-01-17 10:49:22.186769: Linearise component 'x' (level 4)
#> 2025-01-17 10:49:22.19647: Linearise component 'x' (level 4)
#> 2025-01-17 10:49:22.204498: iinla: Evaluate component simplifications (level 3)
#> 2025-01-17 10:49:22.205091: Simplify component 'x' (level 4)
#> 2025-01-17 10:49:22.21327: Simplify component 'x' (level 4)
#> 2025-01-17 10:49:22.221339: iinla: Evaluate predictor linearisation (level 3)
#> 2025-01-17 10:49:22.227345: iinla: Construct inla stack (level 3)
#> 2025-01-17 10:49:22.242136: iinla: Model initialisation completed (level 3)
#> 2025-01-17 10:49:22.24262: iinla: Iteration 1 [max:1] (level 1)