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)
#> 2024-11-22 15:34:53.575184: inlabru loaded
#> 2024-11-22 15:34:53.575644: Clear override options
#> 2024-11-22 15:34:58.061577: iinla: Iteration 1 [max:1]
#> 2024-11-22 15:34:58.762964: iinla: Iteration 1 [max:10]
#> 2024-11-22 15:34:59.179568: iinla: Iteration 2 [max:10]
#> 2024-11-22 15:34:59.834796: iinla: Max deviation from previous: 0.222% of SD, and line search is inactive
#> [stop if: <10% and line search inactive]
#> 2024-11-22 15:34:59.835198: iinla: Convergence criterion met.
#> Running final INLA integration step with known theta mode.
#> 2024-11-22 15:34:59.836079: iinla: Iteration 3 [max:10]
#> 2024-11-22 15:35:00.345987: iinla: Iteration 1 [max:10]
#> 2024-11-22 15:35:00.714741: iinla: Step rescaling: 27.2% (norm0 = 208.3, norm1 = 256.3, norm01 = 395.2)
#> 2024-11-22 15:35:00.750838: iinla: Iteration 2 [max:10]
#> 2024-11-22 15:35:01.116451: iinla: Step rescaling: 99.6% (norm0 = 255.4, norm1 = 12.89, norm01 = 256.4)
#> 2024-11-22 15:35:01.147147: iinla: Max deviation from previous: 52900% of SD, and line search is active
#> [stop if: <10% and line search inactive]
#> 2024-11-22 15:35:01.148082: iinla: Iteration 3 [max:10]
#> 2024-11-22 15:35:01.518878: iinla: Step rescaling: 102% (norm0 = 12.89, norm1 = 0.01798, norm01 = 12.89)
#> 2024-11-22 15:35:01.549131: iinla: Max deviation from previous: 599% of SD, and line search is active
#> [stop if: <10% and line search inactive]
#> 2024-11-22 15:35:01.550111: iinla: Iteration 4 [max:10]
#> 2024-11-22 15:35:01.948418: iinla: Max deviation from previous: 10.1% of SD, and line search is inactive
#> [stop if: <10% and line search inactive]
#> 2024-11-22 15:35:01.949376: iinla: Iteration 5 [max:10]
#> 2024-11-22 15:35:02.350711: iinla: Max deviation from previous: 0.111% of SD, and line search is inactive
#> [stop if: <10% and line search inactive]
#> 2024-11-22 15:35:02.35114: iinla: Convergence criterion met.
#> Running final INLA integration step with known theta mode.
#> 2024-11-22 15:35:02.35203: iinla: Iteration 6 [max:10]
#> 2024-11-22 15:35:06.10126: iinla: Iteration 1 [max:1]
print(bru_log(), timestamp = TRUE, verbosity = TRUE)
#> 2024-11-22 15:34:53.575184: inlabru loaded (level 1)
#> 2024-11-22 15:34:53.575644: Clear override options (level 1)
#> 2024-11-22 15:34:57.953342: iinla: Evaluate component inputs (level 3)
#> 2024-11-22 15:34:57.975843: iinla: Evaluate component linearisations (level 3)
#> 2024-11-22 15:34:57.976471: Linearise component 'x' (level 4)
#> 2024-11-22 15:34:58.004663: Linearise component 'Intercept' (level 4)
#> 2024-11-22 15:34:58.011945: iinla: Evaluate component simplifications (level 3)
#> 2024-11-22 15:34:58.01259: Simplify component 'x' (level 4)
#> 2024-11-22 15:34:58.020313: Simplify component 'Intercept' (level 4)
#> 2024-11-22 15:34:58.027431: iinla: Evaluate predictor linearisation (level 3)
#> 2024-11-22 15:34:58.038658: iinla: Construct inla stack (level 3)
#> 2024-11-22 15:34:58.061111: iinla: Model initialisation completed (level 3)
#> 2024-11-22 15:34:58.061577: iinla: Iteration 1 [max:1] (level 1)
#> 2024-11-22 15:34:58.676642: iinla: Evaluate component inputs (level 3)
#> 2024-11-22 15:34:58.70093: iinla: Evaluate component linearisations (level 3)
#> 2024-11-22 15:34:58.701426: Linearise component 'x' (level 4)
#> 2024-11-22 15:34:58.719677: Linearise component 'Intercept' (level 4)
#> 2024-11-22 15:34:58.727025: iinla: Evaluate component simplifications (level 3)
#> 2024-11-22 15:34:58.727518: Simplify component 'x' (level 4)
#> 2024-11-22 15:34:58.735261: Simplify component 'Intercept' (level 4)
#> 2024-11-22 15:34:58.742566: iinla: Evaluate predictor linearisation (level 3)
#> 2024-11-22 15:34:58.744013: Linearise with respect to component 'x' (level 4)
#> 2024-11-22 15:34:58.748944: Linearise with respect to component 'Intercept' (level 4)
#> 2024-11-22 15:34:58.751174: iinla: Construct inla stack (level 3)
#> 2024-11-22 15:34:58.762525: iinla: Model initialisation completed (level 3)
#> 2024-11-22 15:34:58.762964: iinla: Iteration 1 [max:10] (level 1)
#> 2024-11-22 15:34:59.14727: iinla: Step rescaling: 100%, Approx Optimisation (norm0 = 343.2, norm1 = 0, norm01 = 343.2) (level 3)
#> 2024-11-22 15:34:59.147716: iinla: Optimisation did not improve on previous solution. (level 3)
#> 2024-11-22 15:34:59.148143: iinla: |lin1-lin0| = 343.2
#> <eta-lin1,delta>/|delta| = 0
#> |eta-lin0 - delta <delta,eta-lin0>/<delta,delta>| = 3.109e-14 (level 4)
#> 2024-11-22 15:34:59.149046: iinla: Evaluate component linearisations (level 3)
#> 2024-11-22 15:34:59.1495: Linearise component 'x' (level 4)
#> 2024-11-22 15:34:59.157547: Linearise component 'Intercept' (level 4)
#> 2024-11-22 15:34:59.164846: iinla: Evaluate predictor linearisation (level 3)
#> 2024-11-22 15:34:59.16587: Linearise with respect to component 'x' (level 4)
#> 2024-11-22 15:34:59.168: Linearise with respect to component 'Intercept' (level 4)
#> 2024-11-22 15:34:59.179568: iinla: Iteration 2 [max:10] (level 1)
#> 2024-11-22 15:34:59.801753: iinla: Step rescaling: 162%, Expand (norm0 = 7.367e-07, norm1 = 2.814e-07, norm01 = 4.553e-07) (level 3)
#> 2024-11-22 15:34:59.802825: iinla: Step rescaling: 100%, Overstep (norm0 = 4.553e-07, norm1 = 3.78e-14, norm01 = 4.553e-07) (level 3)
#> 2024-11-22 15:34:59.804356: iinla: Step rescaling: 100%, Approx Optimisation (norm0 = 4.553e-07, norm1 = 3.78e-14, norm01 = 4.553e-07) (level 3)
#> 2024-11-22 15:34:59.804791: iinla: Optimisation did not improve on previous solution. (level 3)
#> 2024-11-22 15:34:59.805189: 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)
#> 2024-11-22 15:34:59.806022: iinla: Evaluate component linearisations (level 3)
#> 2024-11-22 15:34:59.806442: Linearise component 'x' (level 4)
#> 2024-11-22 15:34:59.814173: Linearise component 'Intercept' (level 4)
#> 2024-11-22 15:34:59.82119: iinla: Evaluate predictor linearisation (level 3)
#> 2024-11-22 15:34:59.822171: Linearise with respect to component 'x' (level 4)
#> 2024-11-22 15:34:59.824149: Linearise with respect to component 'Intercept' (level 4)
#> 2024-11-22 15:34:59.834796: iinla: Max deviation from previous: 0.222% of SD, and line search is inactive
#> [stop if: <10% and line search inactive] (level 1)
#> 2024-11-22 15:34:59.835198: iinla: Convergence criterion met.
#> Running final INLA integration step with known theta mode. (level 1)
#> 2024-11-22 15:34:59.836079: iinla: Iteration 3 [max:10] (level 1)
#> 2024-11-22 15:35:00.275347: iinla: Evaluate component inputs (level 3)
#> 2024-11-22 15:35:00.298731: iinla: Evaluate component linearisations (level 3)
#> 2024-11-22 15:35:00.299249: Linearise component 'z' (level 4)
#> 2024-11-22 15:35:00.306659: Linearise component 'Intercept' (level 4)
#> 2024-11-22 15:35:00.313794: iinla: Evaluate component simplifications (level 3)
#> 2024-11-22 15:35:00.314288: Simplify component 'z' (level 4)
#> 2024-11-22 15:35:00.321396: Simplify component 'Intercept' (level 4)
#> 2024-11-22 15:35:00.328513: iinla: Evaluate predictor linearisation (level 3)
#> 2024-11-22 15:35:00.329691: Linearise with respect to component 'z' (level 4)
#> 2024-11-22 15:35:00.331979: Linearise with respect to component 'Intercept' (level 4)
#> 2024-11-22 15:35:00.33405: iinla: Construct inla stack (level 3)
#> 2024-11-22 15:35:00.345453: iinla: Model initialisation completed (level 3)
#> 2024-11-22 15:35:00.345987: iinla: Iteration 1 [max:10] (level 1)
#> 2024-11-22 15:35:00.71115: iinla: Step rescaling: 61.8%, Contract (norm0 = 2292, norm1 = 2107, norm01 = 395.2) (level 3)
#> 2024-11-22 15:35:00.712207: iinla: Step rescaling: 38.2%, Contract (norm0 = 460.2, norm1 = 339.3, norm01 = 395.2) (level 3)
#> 2024-11-22 15:35:00.713871: iinla: Step rescaling: 27.2%, Approx Optimisation (norm0 = 208.3, norm1 = 256.3, norm01 = 395.2) (level 3)
#> 2024-11-22 15:35:00.71433: iinla: |lin1-lin0| = 395.2
#> <eta-lin1,delta>/|delta| = -225.8
#> |eta-lin0 - delta <delta,eta-lin0>/<delta,delta>| = 121.3 (level 4)
#> 2024-11-22 15:35:00.714741: iinla: Step rescaling: 27.2% (norm0 = 208.3, norm1 = 256.3, norm01 = 395.2) (level 2)
#> 2024-11-22 15:35:00.715564: iinla: Evaluate component linearisations (level 3)
#> 2024-11-22 15:35:00.716004: Linearise component 'z' (level 4)
#> 2024-11-22 15:35:00.729148: Linearise component 'Intercept' (level 4)
#> 2024-11-22 15:35:00.736252: iinla: Evaluate predictor linearisation (level 3)
#> 2024-11-22 15:35:00.737506: Linearise with respect to component 'z' (level 4)
#> 2024-11-22 15:35:00.739741: Linearise with respect to component 'Intercept' (level 4)
#> 2024-11-22 15:35:00.750838: iinla: Iteration 2 [max:10] (level 1)
#> 2024-11-22 15:35:01.115511: iinla: Step rescaling: 99.6%, Approx Optimisation (norm0 = 255.4, norm1 = 12.89, norm01 = 256.4) (level 3)
#> 2024-11-22 15:35:01.116026: iinla: |lin1-lin0| = 256.4
#> <eta-lin1,delta>/|delta| = -1.292
#> |eta-lin0 - delta <delta,eta-lin0>/<delta,delta>| = 12.83 (level 4)
#> 2024-11-22 15:35:01.116451: iinla: Step rescaling: 99.6% (norm0 = 255.4, norm1 = 12.89, norm01 = 256.4) (level 2)
#> 2024-11-22 15:35:01.117366: iinla: Evaluate component linearisations (level 3)
#> 2024-11-22 15:35:01.117815: Linearise component 'z' (level 4)
#> 2024-11-22 15:35:01.125625: Linearise component 'Intercept' (level 4)
#> 2024-11-22 15:35:01.132998: iinla: Evaluate predictor linearisation (level 3)
#> 2024-11-22 15:35:01.134073: Linearise with respect to component 'z' (level 4)
#> 2024-11-22 15:35:01.136346: Linearise with respect to component 'Intercept' (level 4)
#> 2024-11-22 15:35:01.147147: iinla: Max deviation from previous: 52900% of SD, and line search is active
#> [stop if: <10% and line search inactive] (level 1)
#> 2024-11-22 15:35:01.148082: iinla: Iteration 3 [max:10] (level 1)
#> 2024-11-22 15:35:01.515332: iinla: Step rescaling: 162%, Expand (norm0 = 20.29, norm1 = 7.4, norm01 = 12.89) (level 3)
#> 2024-11-22 15:35:01.516387: iinla: Step rescaling: 100%, Overstep (norm0 = 12.67, norm1 = 0.2192, norm01 = 12.89) (level 3)
#> 2024-11-22 15:35:01.518025: iinla: Step rescaling: 101.8%, Approx Optimisation (norm0 = 12.89, norm1 = 0.01798, norm01 = 12.89) (level 3)
#> 2024-11-22 15:35:01.518481: iinla: |lin1-lin0| = 12.89
#> <eta-lin1,delta>/|delta| = -2.965e-05
#> |eta-lin0 - delta <delta,eta-lin0>/<delta,delta>| = 0.01798 (level 4)
#> 2024-11-22 15:35:01.518878: iinla: Step rescaling: 102% (norm0 = 12.89, norm1 = 0.01798, norm01 = 12.89) (level 2)
#> 2024-11-22 15:35:01.519706: iinla: Evaluate component linearisations (level 3)
#> 2024-11-22 15:35:01.520151: Linearise component 'z' (level 4)
#> 2024-11-22 15:35:01.527695: Linearise component 'Intercept' (level 4)
#> 2024-11-22 15:35:01.535129: iinla: Evaluate predictor linearisation (level 3)
#> 2024-11-22 15:35:01.536157: Linearise with respect to component 'z' (level 4)
#> 2024-11-22 15:35:01.538436: Linearise with respect to component 'Intercept' (level 4)
#> 2024-11-22 15:35:01.549131: iinla: Max deviation from previous: 599% of SD, and line search is active
#> [stop if: <10% and line search inactive] (level 1)
#> 2024-11-22 15:35:01.550111: iinla: Iteration 4 [max:10] (level 1)
#> 2024-11-22 15:35:01.915295: iinla: Step rescaling: 162%, Expand (norm0 = 0.02912, norm1 = 0.01112, norm01 = 0.018) (level 3)
#> 2024-11-22 15:35:01.916347: iinla: Step rescaling: 100%, Overstep (norm0 = 0.018, norm1 = 1.151e-07, norm01 = 0.018) (level 3)
#> 2024-11-22 15:35:01.917963: iinla: Step rescaling: 100%, Approx Optimisation (norm0 = 0.018, norm1 = 1.147e-07, norm01 = 0.018) (level 3)
#> 2024-11-22 15:35:01.918416: 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)
#> 2024-11-22 15:35:01.919266: iinla: Evaluate component linearisations (level 3)
#> 2024-11-22 15:35:01.919698: Linearise component 'z' (level 4)
#> 2024-11-22 15:35:01.927185: Linearise component 'Intercept' (level 4)
#> 2024-11-22 15:35:01.934467: iinla: Evaluate predictor linearisation (level 3)
#> 2024-11-22 15:35:01.935517: Linearise with respect to component 'z' (level 4)
#> 2024-11-22 15:35:01.937799: Linearise with respect to component 'Intercept' (level 4)
#> 2024-11-22 15:35:01.948418: iinla: Max deviation from previous: 10.1% of SD, and line search is inactive
#> [stop if: <10% and line search inactive] (level 1)
#> 2024-11-22 15:35:01.949376: iinla: Iteration 5 [max:10] (level 1)
#> 2024-11-22 15:35:02.317284: iinla: Step rescaling: 162%, Expand (norm0 = 3.436e-07, norm1 = 1.312e-07, norm01 = 2.123e-07) (level 3)
#> 2024-11-22 15:35:02.318328: iinla: Step rescaling: 100%, Overstep (norm0 = 2.123e-07, norm1 = 8.273e-13, norm01 = 2.123e-07) (level 3)
#> 2024-11-22 15:35:02.319941: iinla: Step rescaling: 100%, Approx Optimisation (norm0 = 2.123e-07, norm1 = 7.25e-13, norm01 = 2.123e-07) (level 3)
#> 2024-11-22 15:35:02.320405: 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)
#> 2024-11-22 15:35:02.32137: iinla: Evaluate component linearisations (level 3)
#> 2024-11-22 15:35:02.321805: Linearise component 'z' (level 4)
#> 2024-11-22 15:35:02.329317: Linearise component 'Intercept' (level 4)
#> 2024-11-22 15:35:02.336492: iinla: Evaluate predictor linearisation (level 3)
#> 2024-11-22 15:35:02.337537: Linearise with respect to component 'z' (level 4)
#> 2024-11-22 15:35:02.33981: Linearise with respect to component 'Intercept' (level 4)
#> 2024-11-22 15:35:02.350711: iinla: Max deviation from previous: 0.111% of SD, and line search is inactive
#> [stop if: <10% and line search inactive] (level 1)
#> 2024-11-22 15:35:02.35114: iinla: Convergence criterion met.
#> Running final INLA integration step with known theta mode. (level 1)
#> 2024-11-22 15:35:02.35203: iinla: Iteration 6 [max:10] (level 1)
#> 2024-11-22 15:35:06.020952: iinla: Evaluate component inputs (level 3)
#> 2024-11-22 15:35:06.046921: iinla: Evaluate component linearisations (level 3)
#> 2024-11-22 15:35:06.047415: Linearise component 'x' (level 4)
#> 2024-11-22 15:35:06.057335: Linearise component 'x' (level 4)
#> 2024-11-22 15:35:06.065177: iinla: Evaluate component simplifications (level 3)
#> 2024-11-22 15:35:06.065682: Simplify component 'x' (level 4)
#> 2024-11-22 15:35:06.073625: Simplify component 'x' (level 4)
#> 2024-11-22 15:35:06.081548: iinla: Evaluate predictor linearisation (level 3)
#> 2024-11-22 15:35:06.08674: iinla: Construct inla stack (level 3)
#> 2024-11-22 15:35:06.100819: iinla: Model initialisation completed (level 3)
#> 2024-11-22 15:35:06.10126: iinla: Iteration 1 [max:1] (level 1)