
Print and plot methods for PESTO ensemble-smoother results
Source:R/ies_result_methods.R
pesto_ies_result-methods.Rdprint() gives a one-screen summary of a fitted iterative ensemble-smoother
run (driver, problem dimensions, the phi-convergence trace, the spread-ESS
dispersion diagnostic and the failure rate). plot() draws the
objective-function (phi) convergence trace by delegating to plot_phi(). For
posterior parameter distributions (prior vs posterior) use plot_ensemble().
Arguments
- x
A
pesto_ies_result, as returned bypesto_ies_callback()orpesto_ies_filter().- ...
Further arguments. For
plot()these are passed toplot_phi()(e.g.log_scale,title);print()ignores them.
Examples
set.seed(1)
G <- matrix(rnorm(18L), 6L, 3L)
prior <- matrix(rnorm(150L), 50L, 3L, dimnames = list(NULL, paste0("p", 1:3)))
obs <- stats::setNames(as.numeric(G %*% c(1, -0.5, 2)) + rnorm(6L, sd = 0.05),
paste0("o", 1:6))
fit <- pesto_ies_callback(function(t) t %*% t(G), prior, obs,
obs_sd = 0.05, noptmax = 4L, verbose = FALSE)
print(fit)
#> $phi
#> iteration realisation phi
#> <int> <int> <num>
#> 1: 1 1 7941.118063
#> 2: 1 2 28682.646430
#> 3: 1 3 21839.224359
#> 4: 1 4 1156.296969
#> 5: 1 5 17649.083100
#> ---
#> 196: 4 46 7.284413
#> 197: 4 47 9.757525
#> 198: 4 48 14.905811
#> 199: 4 49 4.186931
#> 200: 4 50 11.107835
#>
#> $par_ensemble
#> real_name p1 p2 p3
#> <char> <num> <num> <num>
#> 1: real_1 1.0091543 -0.4408587 2.054183
#> 2: real_2 1.0109685 -0.4258462 2.018277
#> 3: real_3 0.9753164 -0.4455381 2.034948
#> 4: real_4 0.9683662 -0.4260018 2.008124
#> 5: real_5 1.0106096 -0.4357984 2.023406
#> 6: real_6 1.0145227 -0.4545189 1.986513
#> 7: real_7 0.9690505 -0.4776318 2.018160
#> 8: real_8 0.9965343 -0.5114288 2.036115
#> 9: real_9 0.9838363 -0.5013709 2.017445
#> 10: real_10 0.9959392 -0.4829080 2.011961
#> 11: real_11 1.0058239 -0.4331886 2.006159
#> 12: real_12 1.0072044 -0.4306809 2.018223
#> 13: real_13 1.0189329 -0.4953815 2.014751
#> 14: real_14 0.9543042 -0.5390686 2.038567
#> 15: real_15 1.0162450 -0.4778157 2.033479
#> 16: real_16 0.9494269 -0.5014980 1.992085
#> 17: real_17 1.0203385 -0.4362632 2.027408
#> 18: real_18 0.9953119 -0.4654994 1.972927
#> 19: real_19 0.9932791 -0.4592398 2.021286
#> 20: real_20 1.0021684 -0.4438066 2.020963
#> 21: real_21 1.0047381 -0.5257757 2.002813
#> 22: real_22 0.9940396 -0.4303503 2.013608
#> 23: real_23 0.9992622 -0.4645996 2.028369
#> 24: real_24 1.0153701 -0.4436199 2.058913
#> 25: real_25 1.0431085 -0.4197699 2.012497
#> 26: real_26 0.9963696 -0.4279695 2.022302
#> 27: real_27 0.9821049 -0.4862203 2.023376
#> 28: real_28 0.9568302 -0.4899690 2.006639
#> 29: real_29 1.0008523 -0.4359828 2.015372
#> 30: real_30 1.0219492 -0.3906535 2.037149
#> 31: real_31 0.9943045 -0.5123960 2.015093
#> 32: real_32 0.9858073 -0.5459015 1.982977
#> 33: real_33 1.0136229 -0.4573861 2.034968
#> 34: real_34 0.9862681 -0.4830909 2.031974
#> 35: real_35 0.9854595 -0.4349624 2.015712
#> 36: real_36 1.0484231 -0.4458023 2.017575
#> 37: real_37 1.0233556 -0.4033416 2.020839
#> 38: real_38 1.0073890 -0.4369336 2.033011
#> 39: real_39 0.9685797 -0.5103209 2.010241
#> 40: real_40 1.0182115 -0.4778415 1.988764
#> 41: real_41 0.9886025 -0.5066115 2.043843
#> 42: real_42 0.9629574 -0.4519701 2.013992
#> 43: real_43 0.9847756 -0.5303691 2.000773
#> 44: real_44 1.0121197 -0.4702965 2.051722
#> 45: real_45 0.9899989 -0.4865884 1.990791
#> 46: real_46 1.0032059 -0.4456999 2.020205
#> 47: real_47 1.0269203 -0.5180347 2.004892
#> 48: real_48 0.9373215 -0.5153695 2.027246
#> 49: real_49 0.9922765 -0.4995570 2.020582
#> 50: real_50 0.9459081 -0.4459235 2.013781
#> real_name p1 p2 p3
#> <char> <num> <num> <num>
#>
#> $obs_ensemble
#> real_name o1 o2 o3 o4 o5 o6
#> <char> <num> <num> <num> <num> <num> <num>
#> 1: real_1 -2.123218 -4.689572 1.213698 1.652216 -0.3672155 0.9389675
#> 2: real_2 -2.094730 -4.598633 1.180434 1.652139 -0.3433407 0.9094420
#> 3: real_3 -2.092351 -4.656640 1.217641 1.600528 -0.3851281 0.9467511
#> 4: real_4 -2.061810 -4.584086 1.204522 1.584680 -0.3574494 0.9347523
#> 5: real_5 -2.102543 -4.617406 1.180773 1.654375 -0.3585876 0.9106975
#> 6: real_6 -2.091200 -4.548802 1.125222 1.667992 -0.3850022 0.8653677
#> 7: real_7 -2.093640 -4.644305 1.185512 1.601088 -0.4354396 0.9235353
#> 8: real_8 -2.138485 -4.703977 1.163285 1.654447 -0.4777678 0.9047569
#> 9: real_9 -2.114030 -4.657535 1.158685 1.631957 -0.4664444 0.9014753
#> 10: real_10 -2.109205 -4.629535 1.153033 1.645873 -0.4344557 0.8935667
#> 11: real_11 -2.087559 -4.578162 1.166874 1.646718 -0.3559398 0.8993636
#> 12: real_12 -2.094695 -4.602774 1.180734 1.647613 -0.3518892 0.9105944
#> 13: real_13 -2.131423 -4.640701 1.129774 1.686238 -0.4457815 0.8724713
#> 14: real_14 -2.127025 -4.737569 1.185417 1.595408 -0.5335080 0.9309443
#> 15: real_15 -2.132812 -4.669703 1.163203 1.675744 -0.4204147 0.8992012
#> 16: real_16 -2.076781 -4.607783 1.158837 1.578243 -0.4775640 0.9057216
#> 17: real_17 -2.111351 -4.624826 1.176878 1.669857 -0.3561494 0.9063116
#> 18: real_18 -2.076077 -4.530349 1.119670 1.641309 -0.4077125 0.8640266
#> 19: real_19 -2.101795 -4.633200 1.179373 1.633982 -0.3997020 0.9137770
#> 20: real_20 -2.099641 -4.619459 1.180468 1.643464 -0.3734362 0.9121959
#> 21: real_21 -2.129929 -4.639309 1.110707 1.673412 -0.4962148 0.8610015
#> 22: real_22 -2.083420 -4.594727 1.186734 1.626718 -0.3556525 0.9171690
#> 23: real_23 -2.112556 -4.651746 1.179255 1.644845 -0.4059480 0.9134638
#> 24: real_24 -2.131396 -4.700945 1.212235 1.662762 -0.3694183 0.9372556
#> 25: real_25 -2.108312 -4.575444 1.150573 1.701815 -0.3234707 0.8799856
#> 26: real_26 -2.089120 -4.611795 1.195938 1.629317 -0.3514262 0.9243907
#> 27: real_27 -2.109244 -4.659801 1.175526 1.624302 -0.4442065 0.9143995
#> 28: real_28 -2.084841 -4.630145 1.175661 1.585878 -0.4579310 0.9178788
#> 29: real_29 -2.091529 -4.601542 1.179783 1.639227 -0.3619513 0.9110487
#> 30: real_30 -2.096179 -4.612429 1.212751 1.658061 -0.2868244 0.9319644
#> 31: real_31 -2.124500 -4.658543 1.140943 1.652129 -0.4796245 0.8863678
#> 32: real_32 -2.115557 -4.613715 1.092623 1.650249 -0.5325574 0.8499658
#> 33: real_33 -2.122136 -4.658399 1.178832 1.665255 -0.3904177 0.9107225
#> 34: real_34 -2.115669 -4.675770 1.183522 1.629601 -0.4382430 0.9203194
#> 35: real_35 -2.081600 -4.604367 1.193615 1.614344 -0.3654863 0.9243961
#> 36: real_36 -2.127485 -4.604934 1.136856 1.718015 -0.3611570 0.8702694
#> 37: real_37 -2.093112 -4.585416 1.185922 1.664912 -0.3052786 0.9104697
#> 38: real_38 -2.107046 -4.640108 1.193616 1.649152 -0.3615204 0.9219630
#> 39: real_39 -2.104359 -4.650990 1.158176 1.610675 -0.4848853 0.9037041
#> 40: real_40 -2.106277 -4.570330 1.111243 1.680898 -0.4190817 0.8553739
#> 41: real_41 -2.135969 -4.718991 1.181380 1.639975 -0.4732238 0.9204364
#> 42: real_42 -2.074725 -4.617247 1.200691 1.583718 -0.3985850 0.9346045
#> 43: real_43 -2.118395 -4.641849 1.122448 1.643060 -0.5097038 0.8736642
#> 44: real_44 -2.137895 -4.705311 1.191501 1.666047 -0.4107020 0.9227354
#> 45: real_45 -2.094126 -4.586458 1.132062 1.638471 -0.4416343 0.8770245
#> 46: real_46 -2.100743 -4.618988 1.177658 1.645732 -0.3759442 0.9098913
#> 47: real_47 -2.141344 -4.634125 1.098966 1.706341 -0.4772366 0.8477818
#> 48: real_48 -2.097802 -4.698118 1.200518 1.561587 -0.5030929 0.9434319
#> 49: real_49 -2.120381 -4.661593 1.156205 1.644727 -0.4609718 0.8982178
#> 50: real_50 -2.060966 -4.615447 1.218182 1.554682 -0.3950584 0.9507515
#> real_name o1 o2 o3 o4 o5 o6
#> <char> <num> <num> <num> <num> <num> <num>
#>
#> $iterations
#> $iterations[[1]]
#> $iterations[[1]]$lambda
#> [1] 3
#>
#> $iterations[[1]]$mda_alpha
#> [1] 4
#>
#> $iterations[[1]]$mean_phi
#> [1] 20268.07
#>
#> $iterations[[1]]$n_failures
#> [1] 0
#>
#> $iterations[[1]]$spread_ess
#> [1] 2.153083
#>
#> $iterations[[1]]$spread_ess_ratio
#> [1] 0.7176943
#>
#> $iterations[[1]]$inflation_method
#> [1] "none"
#>
#> $iterations[[1]]$inflation_factor
#> [1] 1
#>
#> $iterations[[1]]$retention
#> [1] NA
#>
#> $iterations[[1]]$localisation
#> [1] "none"
#>
#> $iterations[[1]]$loc_threshold
#> [1] NA
#>
#> $iterations[[1]]$loc_frac_active
#> [1] NA
#>
#>
#> $iterations[[2]]
#> $iterations[[2]]$lambda
#> [1] 3
#>
#> $iterations[[2]]$mda_alpha
#> [1] 4
#>
#> $iterations[[2]]$mean_phi
#> [1] 16.30708
#>
#> $iterations[[2]]$n_failures
#> [1] 0
#>
#> $iterations[[2]]$spread_ess
#> [1] 2.074332
#>
#> $iterations[[2]]$spread_ess_ratio
#> [1] 0.6914439
#>
#> $iterations[[2]]$inflation_method
#> [1] "none"
#>
#> $iterations[[2]]$inflation_factor
#> [1] 1
#>
#> $iterations[[2]]$retention
#> [1] NA
#>
#> $iterations[[2]]$localisation
#> [1] "none"
#>
#> $iterations[[2]]$loc_threshold
#> [1] NA
#>
#> $iterations[[2]]$loc_frac_active
#> [1] NA
#>
#>
#> $iterations[[3]]
#> $iterations[[3]]$lambda
#> [1] 3
#>
#> $iterations[[3]]$mda_alpha
#> [1] 4
#>
#> $iterations[[3]]$mean_phi
#> [1] 9.943535
#>
#> $iterations[[3]]$n_failures
#> [1] 0
#>
#> $iterations[[3]]$spread_ess
#> [1] 2.268008
#>
#> $iterations[[3]]$spread_ess_ratio
#> [1] 0.7560025
#>
#> $iterations[[3]]$inflation_method
#> [1] "none"
#>
#> $iterations[[3]]$inflation_factor
#> [1] 1
#>
#> $iterations[[3]]$retention
#> [1] NA
#>
#> $iterations[[3]]$localisation
#> [1] "none"
#>
#> $iterations[[3]]$loc_threshold
#> [1] NA
#>
#> $iterations[[3]]$loc_frac_active
#> [1] NA
#>
#>
#> $iterations[[4]]
#> $iterations[[4]]$lambda
#> [1] 3
#>
#> $iterations[[4]]$mda_alpha
#> [1] 4
#>
#> $iterations[[4]]$mean_phi
#> [1] 7.863664
#>
#> $iterations[[4]]$n_failures
#> [1] 0
#>
#> $iterations[[4]]$spread_ess
#> [1] 1.94713
#>
#> $iterations[[4]]$spread_ess_ratio
#> [1] 0.6490433
#>
#> $iterations[[4]]$inflation_method
#> [1] "none"
#>
#> $iterations[[4]]$inflation_factor
#> [1] 1
#>
#> $iterations[[4]]$retention
#> [1] NA
#>
#> $iterations[[4]]$localisation
#> [1] "none"
#>
#> $iterations[[4]]$loc_threshold
#> [1] NA
#>
#> $iterations[[4]]$loc_frac_active
#> [1] NA
#>
#>
#>
#> $runtime_seconds
#> [1] 0.002
#>
#> $n_forward_evals
#> [1] 250
#>
#> $failure_rate
#> [1] 0
#>
#> $converged
#> [1] FALSE
#>
#> $n_iterations
#> [1] 4
#>
#> $fidelity
#> NULL
#>
#> $obs_target
#> o1 o2 o3 o4 o5 o6
#> -2.1198695 -4.6045419 1.2417415 1.6633979 -0.4359134 0.8684248
#>
#> $obs_sd
#> o1 o2 o3 o4 o5 o6
#> 0.05 0.05 0.05 0.05 0.05 0.05
#>
#> $weights
#> o1 o2 o3 o4 o5 o6
#> 20 20 20 20 20 20
#>
#> $obs_perturbation
#> $obs_perturbation$scheme
#> [1] "mda"
#>
#> $obs_perturbation$alpha
#> [1] 4 4 4 4
#>
#> $obs_perturbation$seed
#> [1] NA
#>
#> $obs_perturbation$obs_noise
#> real_1 real_2 real_3 real_4 real_5 real_6
#> o1 0.171892634 0.077208630 0.12620094 -0.0337691156 -0.07666166 0.018358371
#> o2 -0.095854353 -0.014083939 -0.04057740 -0.0009148952 0.03820076 0.040487101
#> o3 -0.160431026 0.039309393 0.06667638 -0.0125309208 0.02418959 -0.099412447
#> o4 -0.184560942 0.022421857 0.01646392 -0.2090846097 -0.11327594 -0.108542933
#> o5 0.055573719 0.002354199 0.17815245 0.1697393895 0.14899074 -0.004854255
#> o6 -0.006011919 -0.062296266 0.07112140 0.1063881154 -0.02482471 0.057608560
#> real_7 real_8 real_9 real_10 real_11 real_12
#> o1 0.007383053 -0.078980045 -0.07185115 -0.06741693 0.01798052 0.06855122
#> o2 0.070594557 -0.046572889 -0.05545976 -0.05012972 0.11540920 0.03895035
#> o3 0.033498010 -0.010485207 0.12454892 0.15423258 -0.11985336 -0.13053959
#> o4 0.054538781 -0.164785109 -0.12589214 -0.09620181 -0.04257244 0.12168880
#> o5 -0.140290591 -0.009953695 -0.02153845 -0.08721795 0.13663086 0.07951740
#> o6 0.067705389 -0.043985764 -0.24719617 -0.13976296 -0.06842974 -0.04882025
#> real_13 real_14 real_15 real_16 real_17 real_18
#> o1 -0.09039935 0.07719040 -0.003368478 -0.32131885 -0.03755807 -0.032986733
#> o2 -0.03904184 -0.11591179 -0.062232642 -0.12756187 -0.05014424 0.084434471
#> o3 0.08140634 -0.02379155 -0.070936346 0.07629063 0.04966126 -0.098107576
#> o4 -0.05642493 -0.12221933 0.087144541 -0.04068151 0.15208809 -0.013922141
#> o5 -0.18742053 0.01168062 0.010513802 -0.12083178 0.09880918 0.218543791
#> o6 -0.01429047 -0.01324996 -0.018693527 -0.04393227 0.12461225 -0.001282801
#> real_19 real_20 real_21 real_22 real_23 real_24
#> o1 -0.03053089 0.20737836 -0.179976067 -0.15570357 -0.01959882 0.01960117
#> o2 -0.05842135 -0.07788302 -0.030824994 0.19231637 -0.02068205 -0.03393434
#> o3 0.07712685 0.11315325 0.001551524 -0.18568296 0.07250432 0.12651441
#> o4 0.21061894 -0.04213451 -0.044231772 -0.21061184 0.13987190 0.09397737
#> o5 0.04121570 -0.10217474 -0.163800773 0.06976485 -0.15905551 0.12779525
#> o6 -0.02612649 0.12183054 -0.064140116 0.09074444 0.13044971 -0.02911601
#> real_25 real_26 real_27 real_28 real_29 real_30
#> o1 0.077617245 0.052897160 -0.02962719 0.01188450 -0.14617717 -0.025557163
#> o2 0.029572563 0.038973452 0.07343303 0.04822472 -0.09848063 -0.128862710
#> o3 -0.051719955 -0.070577141 0.04014807 -0.02913248 -0.13360537 0.006526642
#> o4 0.175723302 -0.005317848 -0.05383011 -0.16521103 -0.03651316 0.103532642
#> o5 0.016172682 0.260644449 -0.10827228 0.00690946 0.13814542 0.226021579
#> o6 -0.005468438 -0.007259310 0.08478014 0.23905767 -0.01533173 0.131469628
#> real_31 real_32 real_33 real_34 real_35 real_36
#> o1 -0.087002335 -0.0426529867 0.06334489 0.16999707 0.006134144 0.01697943
#> o2 -0.050313004 -0.0926404248 -0.05091808 -0.09777419 -0.011082579 -0.01078778
#> o3 0.060745556 -0.0928557925 -0.08570086 0.20488176 -0.157623356 0.01819945
#> o4 -0.001004142 -0.0718900602 0.16161676 0.12264493 0.074258985 0.11459282
#> o5 0.027533030 -0.0414790570 0.09938664 0.03070230 0.214232340 0.14772988
#> o6 -0.131229878 -0.0005667893 0.06968459 0.06243330 0.208977296 0.04079442
#> real_37 real_38 real_39 real_40 real_41 real_42
#> o1 0.111427874 -0.06681473 -0.09597765 -0.05523583 -0.001551973 -0.035068420
#> o2 -0.002707584 0.04458080 -0.12055752 0.05904614 -0.029757733 0.073472324
#> o3 0.049772220 -0.04058252 0.15675731 -0.05272754 -0.016767915 -0.005841448
#> o4 0.118564001 0.06352831 0.02252858 0.13418462 0.115647858 -0.134581290
#> o5 0.363957363 0.03412484 -0.09224107 0.02438446 -0.133876401 0.034690527
#> o6 -0.005400260 0.13161672 -0.10737724 0.01958808 0.108676878 -0.063840465
#> real_43 real_44 real_45 real_46 real_47 real_48
#> o1 0.11243924 -0.02375841 -0.0002555836 0.139082051 -0.160431219 -0.11712486
#> o2 -0.08277330 -0.05953265 -0.0038227771 0.123124622 0.079135067 -0.08294148
#> o3 -0.17877801 -0.04107422 -0.2036237420 -0.111333746 0.006815653 0.02292120
#> o4 -0.08540100 0.03279914 -0.0301229079 -0.079605389 0.061439600 -0.08149929
#> o5 -0.05720227 -0.11636466 -0.0555646104 -0.008951988 -0.120306775 -0.09934455
#> o6 -0.08259307 0.07601777 0.0847295416 -0.105965689 -0.034045484 -0.13061685
#> real_49 real_50
#> o1 -0.14342218 -0.01506437
#> o2 -0.08628479 -0.03940069
#> o3 0.17037992 0.02520693
#> o4 -0.06556326 -0.02827064
#> o5 -0.11131686 0.08676676
#> o6 -0.14055054 0.07200911
#>
#>
#> attr(,"class")
#> [1] "pesto_ies_callback_result" "pesto_ies_result"
p <- plot(fit) # phi convergence (a ggplot2 object)