library(FishMap)
library(FishMap)

main.R

This vignette runs a toy example of the FishMap spatio-temporal model. The execution comprises three steps : data preparation, model fitting and graph generation.

part1: Data preparation

input data

FishMap requires three types of input data :

  • survey data
  • vms x logbook data
  • study domain data

They should be provided as individual data frames to the fm_load_data() function. You can find below the preview of example input data frames used in this vignette.

survey_data_file <- system.file("original_data",
                                "Solea_solea",
                                "survey_data.Rds",
                                package = "FishMap"
)

survey_data <- readr::read_rds(file = survey_data_file)
survey_data %>% head() %>% knitr::kable()
layer Survey Year Month StNo HaulNo HaulDur Quarter Day TimeShot Stratum StatRec Depth Distance long lati Year_Quarter CatchWgt_spp
19830 BTS-VIII 2017 11 BIGO 1 0.5000000 04 3 1347 N 24E5 69 4720 -4.525 47.875 2017_04 5.4737333
19830 BTS-VIII 2018 11 BIGO 8 0.5000000 04 14 820 N 24E5 NA 4664 -4.525 47.875 2018_04 1.4612254
20081 BTS-VIII 2017 11 BEME 3 0.2333333 04 4 849 N 24E5 15 2393 -3.975 47.825 2017_04 0.2672393
20081 BTS-VIII 2018 11 BEME 1 0.2500000 04 10 1124 N 24E5 16 2489 -3.975 47.825 2018_04 0.0338412
20313 BTS-VIII 2017 11 PEMA 4 0.5000000 04 4 1113 N 24E5 63 4687 -4.375 47.775 2017_04 5.2887857
20313 BTS-VIII 2018 11 PEMA 9 0.5000000 04 14 1008 N 24E5 250 4540 -4.375 47.775 2018_04 2.0623380
vmslogbook_data_file <- system.file("original_data",
                                    "Solea_solea",
                                    "vmslogbook_data.Rds",
                                    package = "FishMap"
)

vmslogbook_data <- readr::read_rds(file = vmslogbook_data_file)
vmslogbook_data %>% head() %>% knitr::kable()
layer VE_REF SI_DATE Ifr_Fleet VE_LEN VE_KW LE_GEAR LE_MET_level6 long lati MET HF year Month Year Year_Month Quarter Year_Quarter LE_KG LE_KG_mature CPUE CPUE_mature CPUE_spp f
569 18157 10/07/2017 2 NA 478.0 OTB OTB_DEF_>=70_0 -10.575 51.875 OTB_DEF 1 2017 07 2017 2017_07 03 2017_03 0 0 0 0 0 1
1086 18157 10/07/2017 2 NA 478.0 OTB OTB_DEF_>=70_0 -10.725 51.775 OTB_DEF 1 2017 07 2017 2017_07 03 2017_03 0 0 0 0 0 1
1602 18157 10/07/2017 2 NA 478.0 OTB OTB_DEF_>=70_0 -10.925 51.675 OTB_DEF 1 2017 07 2017 2017_07 03 2017_03 0 0 0 0 0 1
2119 18157 10/07/2017 2 NA 478.0 OTB OTB_DEF_>=70_0 -11.075 51.575 OTB_DEF 1 2017 07 2017 2017_07 03 2017_03 0 0 0 0 0 1
2895 18157 10/07/2017 2 NA 478.0 OTB OTB_DEF_>=70_0 -11.275 51.425 OTB_DEF 1 2017 07 2017 2017_07 03 2017_03 0 0 0 0 0 1
3412 18157 10/07/2017 2 NA 478.0 OTB OTB_DEF_>=70_0 -11.425 51.325 OTB_DEF 1 2017 07 2017 2017_07 03 2017_03 0 0 0 0 0 1
study_domain_file <- system.file("original_data",
                                 "Solea_solea",
                                 "study_domain.Rds",
                                 package = "FishMap"
)

study_domain <- readr::read_rds(file = study_domain_file)
study_domain %>% head() %>% knitr::kable()
ID ZONE STRATE_BAT SURFACE SURFACE_MI STRATE prof geometry
0 Gn 1 8201691989.5538 2391.2308 Gn1 NA MULTIPOLYGON (((-4.736794 4…
0 Gn 2 11771068809.3136 3431.8945 Gn2 NA MULTIPOLYGON (((-5.098735 4…
0 Gn 3 17327206591.5471 5051.8051 Gn3 NA MULTIPOLYGON (((-5.098735 4…
0 Gn 4 18854029923.0492 5496.9556 Gn4 NA MULTIPOLYGON (((-2.610457 4…
0 Gn 5 1612118624.86359 470.0186 Gn5 NA MULTIPOLYGON (((-5.725294 4…
0 Gn 6 1090197796.63664 317.8508 Gn6 NA MULTIPOLYGON (((-5.740776 4…

fm_load_data() : prepare and load model inputs

This function prepares all the necessary output for the model fitting. It will filter and shape the observation data (VMS and scientific). It will generate the spatial mesh for the study domain. All outputs are reported as part of a named list.

# run part1
fm_data_inputs <- fm_load_data(species = "Solea_solea",
                         fleet = c("OTB_DEF_>=70_0","OTB_CEP_>=70_0","OTT_DEF_>=70_0"),
                         fitted_data = "biomass",
                         survey_data = survey_data,
                         vmslogbook_data = vmslogbook_data,
                         study_domain = study_domain,
                         year_start = 2018,
                         year_end = 2018,
                         month_start = 11,
                         month_end = 11,
                         time_step = "Month",
                         k = 0.25,
                         grid_xmin = -6,
                         grid_xmax = 0,
                         grid_ymin = 42,
                         grid_ymax = 48)
#> Running step 1 -loading data-
#> as(<dgCMatrix>, "dgTMatrix") is deprecated since Matrix 1.5-0; do as(., "TsparseMatrix") instead
#> Joining with `by = join_by(Year, Month)`
#> Joining with `by = join_by(Month, Year, Year_Month)`
#> Joining with `by = join_by(layer, cell)`
#> Joining with `by = join_by(layer, cell)`
#> Joining with `by = join_by(layer, cell)`
#> Step 1 -loading data-: 18.577 sec elapsed

part2: fit model

fm_fit_model(): compile model and fit to data

This function will fit the model to the observation data. It will compile the model cpp file. It will fit the model to the input data generated from fm_load_data() and provide the results as a named list.

# run part 2
fm_model_results <- fm_fit_model(fm_data_inputs = fm_data_inputs,
                                 SE = 1,
                                 data_source = 1,
                                 data_obs = 2,
                                 samp_process = 0,
                                 b_constraint = 2,
                                 cov_samp_process = 0,
                                 biomass_temporal = 1,
                                 sampling_temporal = 0,
                                 lf_link = 0,
                                 ref_data = "com",
                                 EM = "est_b",
                                 month_ref = 1)
#> Running step 2 -compile model-
#> Step 2 -compile model-: 0.043 sec elapsed
#> Running step 3 -fit model-
#>   0:     36231.535:  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  1.00000  1.00000  0.00000  0.00000  1.00000
#>   1:     34620.699: -0.000611263 0.0111047 -0.0156403 0.0102825 0.124038 0.170300 0.107928 0.219166 0.254485 0.984779  1.02404 0.00480612 0.00127533  1.00142
#>   2:     34468.939: -0.00311577 0.0603602 -0.0857435 -0.0222451 0.208401 0.331487 0.292156 0.0501506 0.0135788 0.943944  1.10149 0.0240668 0.00653019  1.00723
#>   3:     33982.291: -0.00699680 0.128341 -0.184046 -0.0766144 0.374464 0.603974 0.131266 0.113838 0.101948 0.842542  1.14889 0.0497129 0.0137662  1.01562
#>   4:     33810.021: -0.0154823 0.261197 -0.383417 0.0764999 0.493458 0.618758 0.133829 0.0569172 -0.0430482 0.632082  1.08769 0.0951398 0.0275287  1.03258
#>   5:     33729.552: -0.0164510 0.276589 -0.407765 0.0514200 0.505881 0.652014 0.156276 0.0145354 0.0575309 0.659175  1.08274 0.100509 0.0293550  1.03485
#>   6:     33686.940: -0.0191766 0.318496 -0.474206 0.00893454 0.549691 0.617556 0.168675 0.0248413 -0.00151819 0.682039  1.06548 0.114979 0.0343887  1.04119
#>   7:     33638.958: -0.0227585 0.371712 -0.559775 -0.00605338 0.532240 0.625772 0.176094 -0.00423238 0.0426364 0.641538  1.05089 0.133499 0.0412104  1.04991
#>   8:     33620.032: -0.0261337 0.418411 -0.640393 -0.0342850 0.530637 0.608663 0.190487 0.0649055 0.0254458 0.629140  1.03516 0.151114 0.0487885  1.05974
#>   9:     33583.491: -0.0296476 0.466499 -0.724333 -0.0438316 0.526986 0.616835 0.176766 -0.00160644 0.00236307 0.616259  1.01214 0.170230 0.0571068  1.07045
#>  10:     33567.300: -0.0303451 0.475466 -0.740533 -0.0474712 0.543779 0.633865 0.185195 0.0289533 0.0438028 0.617156  1.00937 0.174022 0.0588620  1.07273
#>  11:     33551.884: -0.0322315 0.496623 -0.783106 -0.0470869 0.548051 0.625279 0.190934 0.0119093 0.0189748 0.620048 0.995482 0.184162 0.0643544  1.07994
#>  12:     33541.057: -0.0342130 0.517556 -0.826890 -0.0592820 0.547664 0.638322 0.183568 0.0225153 0.0423825 0.612723 0.990476 0.194633 0.0704097  1.08794
#>  13:     33528.834: -0.0363021 0.536812 -0.871073 -0.0604765 0.541815 0.629576 0.193767 0.0194579 0.0151104 0.602361 0.985144 0.205331 0.0773888  1.09723
#>  14:     33519.168: -0.0384477 0.552458 -0.914393 -0.0659811 0.550695 0.635143 0.193089 0.00997024 0.0422614 0.615365 0.974737 0.216080 0.0857430  1.10843
#>  15:     33509.846: -0.0407163 0.568351 -0.959088 -0.0687796 0.558711 0.632886 0.186068 0.0271709 0.0198829 0.603188 0.971821 0.226922 0.0947787  1.12057
#>  16:     33502.083: -0.0429815 0.578676 -1.00012 -0.0665735 0.535914 0.634885 0.205201 0.00950489 0.0328800 0.592881 0.972014 0.236688 0.105213  1.13471
#>  17:     33493.520: -0.0452376 0.585728 -1.03957 -0.0882358 0.549713 0.639364 0.185023 0.0166912 0.0251598 0.612600 0.971261 0.245905 0.117084  1.15076
#>  18:     33487.994: -0.0471415 0.600190 -1.07719 -0.0688601 0.553780 0.637511 0.214288 0.0170128 0.0295670 0.590455 0.963771 0.254301 0.124793  1.16104
#>  19:     33480.739: -0.0494881 0.606979 -1.11736 -0.0785503 0.556318 0.629804 0.179710 0.00974230 0.0278094 0.588749 0.957460 0.262852 0.138020  1.17879
#>  20:     33474.263: -0.0519570 0.612911 -1.15736 -0.0813324 0.551730 0.647238 0.204749 0.0224565 0.0256494 0.605509 0.958260 0.270745 0.152337  1.19792
#>  21:     33472.105: -0.0545821 0.613891 -1.19624 -0.0907478 0.541919 0.636643 0.196735 -0.00361663 0.0247866 0.592207 0.965429 0.277726 0.169802  1.22112
#>  22:     33465.711: -0.0569968 0.615873 -1.23230 -0.0864680 0.563252 0.624284 0.187534 0.0205426 0.0330845 0.575822 0.963280 0.284163 0.185693  1.24213
#>  23:     33461.588: -0.0591968 0.612596 -1.26176 -0.0680949 0.567658 0.630247 0.196047 0.00330718 0.0254294 0.601226 0.941321 0.287887 0.203347  1.26504
#>  24:     33457.265: -0.0613984 0.613760 -1.29411 -0.0826166 0.545476 0.657021 0.195647 0.0201496 0.0299338 0.592629 0.950954 0.292273 0.219800  1.28621
#>  25:     33455.112: -0.0638411 0.612770 -1.32821 -0.0976103 0.549692 0.633063 0.199143 0.00917653 0.0106782 0.585262 0.962883 0.296877 0.239010  1.31082
#>  26:     33450.162: -0.0662130 0.611947 -1.36089 -0.0966840 0.572320 0.623438 0.196624 0.00623256 0.0390277 0.572211 0.965236 0.300944 0.258558  1.33549
#>  27:     33446.244: -0.0683495 0.611843 -1.39041 -0.0806185 0.556850 0.633802 0.192643 0.0152277 0.0218311 0.591302 0.941839 0.304123 0.277352  1.35858
#>  28:     33446.066: -0.0709831 0.608455 -1.42318 -0.0896153 0.550049 0.654254 0.206963 0.00200116 0.0348572 0.590870 0.949390 0.306816 0.301269  1.38787
#>  29:     33441.307: -0.0719101 0.607491 -1.43465 -0.0935515 0.558646 0.646101 0.201915 0.0157816 0.0199124 0.586969 0.952276 0.307867 0.309482  1.39790
#>  30:     33439.669: -0.0733362 0.608765 -1.45429 -0.0924653 0.558604 0.642584 0.196732 0.00762463 0.0277530 0.582821 0.949920 0.310385 0.321082  1.41200
#>  31:     33438.084: -0.0748115 0.606517 -1.47068 -0.0953221 0.562567 0.635865 0.202746 0.0140195 0.0241471 0.581540 0.954071 0.311477 0.334958  1.42853
#>  32:     33436.743: -0.0764086 0.603015 -1.48655 -0.0983562 0.562545 0.641348 0.200382 0.00738585 0.0277208 0.582450 0.955860 0.312034 0.350082  1.44639
#>  33:     33435.363: -0.0779813 0.599834 -1.50194 -0.0940494 0.561115 0.642252 0.197865 0.0145157 0.0217946 0.581635 0.950363 0.312795 0.365026  1.46378
#>  34:     33434.164: -0.0795491 0.597046 -1.51670 -0.0946204 0.557069 0.638739 0.203867 0.00915478 0.0283104 0.582174 0.950678 0.313440 0.380615  1.48145
#>  35:     33432.896: -0.0811394 0.593365 -1.53029 -0.0972105 0.565670 0.640199 0.200618 0.0127109 0.0234597 0.583870 0.953931 0.313553 0.396601  1.49937
#>  36:     33431.781: -0.0827963 0.590587 -1.54558 -0.0942867 0.561350 0.643533 0.198687 0.00727471 0.0267462 0.580729 0.951335 0.314371 0.412644  1.51724
#>  37:     33430.726: -0.0844115 0.587591 -1.55869 -0.0961397 0.557642 0.636866 0.202154 0.0159436 0.0242706 0.581130 0.951965 0.314710 0.428988  1.53496
#>  38:     33429.657: -0.0861081 0.583315 -1.57014 -0.0978335 0.563002 0.640960 0.202878 0.00775508 0.0263837 0.584701 0.952558 0.314215 0.446221  1.55334
#>  39:     33428.707: -0.0878513 0.579241 -1.58248 -0.0938992 0.565811 0.642957 0.198006 0.0142107 0.0236579 0.581413 0.949825 0.314244 0.463467  1.57158
#>  40:     33427.723: -0.0896252 0.576560 -1.59619 -0.0944415 0.558800 0.639666 0.200458 0.00853952 0.0246172 0.580702 0.952347 0.314797 0.480575  1.58955
#>  41:     33427.030: -0.0914521 0.572943 -1.60688 -0.0979362 0.559452 0.639612 0.203080 0.0168202 0.0292618 0.585722 0.954732 0.314366 0.498464  1.60768
#>  42:     33426.145: -0.0932647 0.567957 -1.61678 -0.0973674 0.565575 0.640581 0.202557 0.0104064 0.0201326 0.583131 0.951228 0.313801 0.515732  1.62539
#>  43:     33425.425: -0.0951859 0.564311 -1.62750 -0.0940310 0.561981 0.643447 0.197185 0.00906740 0.0297558 0.581938 0.947205 0.313717 0.533314  1.64288
#>  44:     33424.398: -0.0971560 0.560307 -1.63929 -0.0927862 0.563275 0.640798 0.200265 0.0141452 0.0238508 0.581365 0.952872 0.313738 0.551233  1.66099
#>  45:     33423.739: -0.0993266 0.557064 -1.65041 -0.0962762 0.558740 0.642044 0.201113 0.00775327 0.0261325 0.587170 0.952794 0.313505 0.569674  1.67906
#>  46:     33422.780: -0.101521 0.551927 -1.66034 -0.0974160 0.564511 0.642811 0.201105 0.0130812 0.0264047 0.582471 0.947582 0.312895 0.588109  1.69743
#>  47:     33422.145: -0.103777 0.551047 -1.67510 -0.0913425 0.560491 0.639067 0.198672 0.00840824 0.0232250 0.583694 0.953805 0.314117 0.604731  1.71398
#>  48:     33421.348: -0.106260 0.545913 -1.68653 -0.0906986 0.564049 0.643855 0.200561 0.0109637 0.0272766 0.583242 0.957734 0.313845 0.622971  1.73259
#>  49:     33420.840: -0.108545 0.543701 -1.69470 -0.100743 0.560247 0.641959 0.199641 0.0137350 0.0213189 0.586009 0.940699 0.313402 0.636736  1.74649
#>  50:     33420.094: -0.111344 0.538954 -1.70547 -0.101988 0.562307 0.643547 0.204202 0.00809373 0.0270126 0.579514 0.936470 0.312949 0.653871  1.76456
#>  51:     33419.447: -0.113361 0.540319 -1.71880 -0.0918492 0.562510 0.640861 0.199294 0.0132629 0.0242906 0.585166 0.954212 0.315056 0.663935  1.77534
#>  52:     33418.944: -0.116658 0.536606 -1.73264 -0.0892351 0.562223 0.643959 0.198691 0.00740873 0.0251719 0.587547 0.959950 0.315741 0.680485  1.79376
#>  53:     33418.246: -0.119592 0.530727 -1.73904 -0.0986615 0.563663 0.643182 0.201469 0.0119969 0.0243635 0.581334 0.944902 0.314345 0.694415  1.80971
#>  54:     33417.940: -0.123237 0.531664 -1.75586 -0.0953071 0.560798 0.641609 0.204811 0.00601897 0.0275211 0.583531 0.939138 0.316423 0.708921  1.82680
#>  55:     33416.925: -0.127372 0.528130 -1.76925 -0.0931468 0.560193 0.641963 0.199481 0.0131407 0.0256051 0.585661 0.946656 0.317466 0.723584  1.84540
#>  56:     33416.886: -0.130928 0.524581 -1.78327 -0.0992058 0.564137 0.646786 0.206346 0.00609689 0.0184910 0.581290 0.945937 0.317624 0.736308  1.86256
#>  57:     33416.140: -0.132769 0.523927 -1.78985 -0.0994944 0.564880 0.647348 0.202570 0.0115819 0.0256141 0.580964 0.946711 0.317958 0.741700  1.87011
#>  58:     33415.804: -0.134945 0.523665 -1.79749 -0.0958054 0.564374 0.642907 0.201325 0.00940610 0.0231512 0.582949 0.948056 0.318748 0.747957  1.87880
#>  59:     33415.517: -0.137368 0.522196 -1.80467 -0.0944678 0.562573 0.644304 0.201124 0.0116503 0.0262963 0.584372 0.949349 0.319441 0.754867  1.88863
#>  60:     33415.271: -0.139899 0.519224 -1.81061 -0.0962206 0.561292 0.644512 0.201037 0.0108777 0.0227704 0.584072 0.948046 0.319665 0.761989  1.89909
#>  61:     33415.004: -0.142759 0.516815 -1.81693 -0.0951407 0.564129 0.644672 0.200769 0.0113526 0.0256256 0.584185 0.947601 0.319990 0.768758  1.90968
#>  62:     33414.761: -0.145583 0.515049 -1.82416 -0.0952283 0.562629 0.643008 0.201465 0.0100381 0.0234220 0.583748 0.948746 0.320406 0.775272  1.92020
#>  63:     33414.542: -0.148467 0.511965 -1.82989 -0.0966932 0.561659 0.645144 0.201337 0.0119625 0.0256178 0.583234 0.948271 0.320627 0.781899  1.93110
#>  64:     33414.321: -0.151656 0.509414 -1.83511 -0.0928180 0.563974 0.645369 0.200396 0.0108259 0.0224878 0.586048 0.947658 0.321388 0.787751  1.94162
#>  65:     33414.087: -0.154774 0.507785 -1.84227 -0.0940196 0.563209 0.644708 0.200722 0.0103866 0.0258523 0.584381 0.948485 0.321924 0.793627  1.95230
#>  66:     33413.911: -0.158008 0.504663 -1.84747 -0.0971528 0.562977 0.642646 0.201660 0.0112429 0.0229041 0.582514 0.948161 0.321573 0.799372  1.96333
#>  67:     33413.691: -0.161688 0.501568 -1.85234 -0.0948430 0.562754 0.645631 0.201120 0.0110865 0.0247342 0.584865 0.948221 0.321911 0.804854  1.97472
#>  68:     33413.503: -0.165417 0.499740 -1.85893 -0.0928463 0.563593 0.644413 0.200530 0.0114878 0.0219080 0.585195 0.948181 0.323724 0.810042  1.98588
#>  69:     33413.285: -0.169182 0.497478 -1.86507 -0.0953892 0.563411 0.643669 0.200755 0.00992332 0.0248764 0.583550 0.948318 0.323852 0.814984  1.99717
#>  70:     33413.157: -0.173318 0.495110 -1.87062 -0.0946343 0.564129 0.643768 0.202113 0.0136597 0.0233621 0.584121 0.948612 0.322239 0.819335  2.00881
#>  71:     33412.928: -0.177324 0.492488 -1.87632 -0.0952845 0.561721 0.645344 0.201629 0.0108746 0.0227674 0.584855 0.948247 0.322830 0.824147  2.02036
#>  72:     33412.795: -0.181476 0.490022 -1.88127 -0.0941248 0.564960 0.645171 0.200295 0.0128726 0.0257810 0.583956 0.947573 0.327220 0.828311  2.03121
#>  73:     33412.558: -0.185833 0.488140 -1.88761 -0.0943894 0.564605 0.643149 0.200898 0.0110842 0.0233761 0.584142 0.948491 0.327907 0.832476  2.04284
#>  74:     33412.400: -0.189970 0.486604 -1.89395 -0.0932749 0.563034 0.645398 0.201533 0.0119533 0.0254991 0.584680 0.948786 0.323844 0.836022  2.05408
#>  75:     33412.214: -0.194303 0.483910 -1.89955 -0.0948246 0.563164 0.645467 0.201007 0.0121374 0.0229168 0.584269 0.947347 0.325731 0.840468  2.06582
#>  76:     33412.057: -0.198639 0.482025 -1.90485 -0.0944735 0.564092 0.644324 0.201183 0.0107880 0.0255582 0.584678 0.948446 0.332215 0.844191  2.07637
#>  77:     33411.898: -0.202970 0.480550 -1.91139 -0.0935179 0.564123 0.643485 0.201164 0.0120419 0.0238071 0.584552 0.949245 0.327805 0.847357  2.08777
#>  78:     33411.758: -0.207432 0.477699 -1.91660 -0.0937191 0.563467 0.645903 0.200924 0.0110210 0.0248340 0.583905 0.947457 0.324993 0.850959  2.09969
#>  79:     33411.625: -0.211572 0.474948 -1.92007 -0.0940163 0.563539 0.645481 0.201289 0.0120240 0.0232885 0.585045 0.947709 0.333902 0.854456  2.10952
#>  80:     33411.489: -0.216398 0.473901 -1.92676 -0.0936233 0.563573 0.644260 0.200940 0.0107409 0.0254659 0.585351 0.949349 0.331144 0.856934  2.12119
#>  81:     33411.368: -0.220938 0.471915 -1.93220 -0.0937422 0.564465 0.643806 0.200820 0.0119596 0.0238298 0.584004 0.948561 0.325457 0.859264  2.13261
#>  82:     33411.250: -0.225535 0.468334 -1.93499 -0.0933649 0.563413 0.645777 0.201183 0.0110298 0.0245573 0.583929 0.947693 0.332978 0.862398  2.14332
#>  83:     33411.126: -0.231128 0.466647 -1.94052 -0.0931201 0.564005 0.645109 0.200969 0.0121223 0.0232511 0.586134 0.948886 0.333388 0.864298  2.15563
#>  84:     33411.009: -0.236452 0.464823 -1.94576 -0.0935760 0.564016 0.644875 0.200702 0.0109211 0.0249502 0.585166 0.948753 0.329335 0.865918  2.16772
#>  85:     33410.910: -0.241749 0.461537 -1.94905 -0.0932443 0.563871 0.644429 0.201025 0.0119870 0.0233517 0.583465 0.947984 0.334838 0.868387  2.17941
#>  86:     33410.523: -0.279468 0.448068 -1.97290 -0.0898310 0.563367 0.646238 0.200741 0.0149853 0.0252612 0.589257 0.956212 0.332807 0.872562  2.25468
#>  87:     33410.063: -0.321145 0.432104 -1.98594 -0.0850476 0.566316 0.644337 0.196629 0.00845322 0.0244359 0.589584 0.954393 0.341249 0.870793  2.32987
#>  88:     33409.867: -0.365557 0.425585 -1.99420 -0.103742 0.565831 0.642854 0.202227 0.0108960 0.0270830 0.577494 0.931994 0.359011 0.859726  2.39639
#>  89:     33409.764: -0.415977 0.435233 -2.01156 -0.0989621 0.562959 0.640655 0.208719 0.0120761 0.0215660 0.580853 0.936365 0.346932 0.831181  2.45925
#>  90:     33409.128: -0.465992 0.438348 -2.02826 -0.0896046 0.565948 0.647408 0.201611 0.0120632 0.0238730 0.581453 0.950134 0.371791 0.811031  2.52079
#>  91:     33409.066: -0.466059 0.438577 -2.02892 -0.0911731 0.565463 0.646218 0.200041 0.00868178 0.0225310 0.584574 0.949425 0.371711 0.811247  2.52107
#>  92:     33409.006: -0.468161 0.438087 -2.02990 -0.0909369 0.566072 0.646392 0.200252 0.0114764 0.0240113 0.584973 0.949218 0.370257 0.812047  2.52448
#>  93:     33408.974: -0.470743 0.437187 -2.03079 -0.0907168 0.565420 0.645976 0.200272 0.0105037 0.0235737 0.585387 0.949194 0.368955 0.813237  2.52864
#>  94:     33408.953: -0.473173 0.436678 -2.03247 -0.0905881 0.564901 0.645892 0.200380 0.0117193 0.0240240 0.585779 0.949101 0.367877 0.814548  2.53272
#>  95:     33408.929: -0.475882 0.435750 -2.03347 -0.0905977 0.564666 0.645701 0.200261 0.0107780 0.0236356 0.585975 0.949232 0.366766 0.815626  2.53695
#>  96:     33408.781: -0.523280 0.417010 -2.04532 -0.0900355 0.568743 0.644871 0.199067 0.0107564 0.0234362 0.586810 0.953304 0.352092 0.831168  2.60830
#>  97:     33408.596: -0.574763 0.397657 -2.05336 -0.0846317 0.564957 0.643929 0.200117 0.00984481 0.0255994 0.589168 0.958682 0.362849 0.841883  2.67841
#>  98:     33408.387: -0.634567 0.398869 -2.07006 -0.0818251 0.564183 0.647226 0.198470 0.0120080 0.0218985 0.591845 0.957664 0.377272 0.817882  2.73867
#>  99:     33408.232: -0.691083 0.416478 -2.08958 -0.0866217 0.562603 0.646089 0.198238 0.0119281 0.0245659 0.590874 0.955901 0.376374 0.770715  2.78529
#> 100:     33408.109: -0.746839 0.408664 -2.09374 -0.0881178 0.564144 0.644890 0.199875 0.0116913 0.0244096 0.589823 0.959824 0.388587 0.774097  2.85563
#> 101:     33407.999: -0.801257 0.397870 -2.09712 -0.0849578 0.563792 0.646254 0.198623 0.00980912 0.0223195 0.588517 0.954046 0.386941 0.779570  2.92734
#> 102:     33407.921: -0.853950 0.380647 -2.10177 -0.0840622 0.565168 0.647478 0.199094 0.0120656 0.0241826 0.590139 0.952169 0.387349 0.782712  2.99944
#> 103:     33407.797: -0.958374 0.329876 -2.13572 -0.0828375 0.563581 0.645506 0.198379 0.0126769 0.0238701 0.591165 0.955159 0.395116 0.725150  3.14345
#> 104:     33407.691: -1.06984 0.342544 -2.14142 -0.0845975 0.563318 0.648819 0.199856 0.0104877 0.0225213 0.590481 0.952769 0.409058 0.684826  3.29934
#> 105:     33407.632: -1.10901 0.383641 -2.12926 -0.0831487 0.564241 0.645439 0.197983 0.0111166 0.0235978 0.591065 0.955477 0.416830 0.684079  3.36346
#> 106:     33407.629: -1.11565 0.381689 -2.13127 -0.0855764 0.563851 0.646877 0.198524 0.0120156 0.0240080 0.589093 0.955656 0.415900 0.680614  3.37955
#> 107:     33407.609: -1.12095 0.373913 -2.13692 -0.0859254 0.564152 0.646457 0.198823 0.0111967 0.0235081 0.589286 0.955134 0.418232 0.673434  3.39212
#> 108:     33407.603: -1.12629 0.367001 -2.14180 -0.0859437 0.564592 0.646094 0.199096 0.0112936 0.0237005 0.589509 0.954737 0.420422 0.666798  3.40581
#> 109:     33407.592: -1.14359 0.359646 -2.14302 -0.0862764 0.564311 0.645859 0.198928 0.0113385 0.0237446 0.589811 0.954508 0.423695 0.666104  3.45635
#> 110:     33407.582: -1.16043 0.355097 -2.14882 -0.0857520 0.564395 0.645699 0.199056 0.0110590 0.0236957 0.589247 0.954831 0.425828 0.652028  3.50512
#> 111:     33407.574: -1.17062 0.348212 -2.15487 -0.0862770 0.564348 0.645902 0.198954 0.0110890 0.0236427 0.589065 0.954580 0.430624 0.628384  3.55149
#> 112:     33407.570: -1.18176 0.348615 -2.15689 -0.0862902 0.564230 0.645968 0.199093 0.0113208 0.0234609 0.589317 0.954470 0.431972 0.616078  3.60286
#> 113:     33407.567: -1.18778 0.340755 -2.16313 -0.0856416 0.564148 0.645983 0.198977 0.0112198 0.0237795 0.589786 0.955244 0.436088 0.603815  3.65400
#> 114:     33407.566: -1.18608 0.336148 -2.16587 -0.0859493 0.564451 0.646022 0.198927 0.0111621 0.0237166 0.589372 0.954808 0.436817 0.597750  3.67543
#> 115:     33407.566: -1.18344 0.338239 -2.16421 -0.0859896 0.564210 0.646036 0.198935 0.0112391 0.0236187 0.589432 0.954885 0.438714 0.589864  3.69661
#> 116:     33407.566: -1.18064 0.337678 -2.16520 -0.0860472 0.564253 0.646033 0.198956 0.0112285 0.0236448 0.589414 0.954832 0.438147 0.592681  3.69200
#> 117:     33407.566: -1.17996 0.338181 -2.16453 -0.0859897 0.564291 0.646026 0.198945 0.0112172 0.0236574 0.589431 0.954853 0.438125 0.592049  3.69259
#> 118:     33407.566: -1.17949 0.337931 -2.16478 -0.0859944 0.564271 0.646033 0.198943 0.0112249 0.0236473 0.589429 0.954853 0.438195 0.592206  3.69256
#> Warning: 4 external pointers will be removed
#> Step 3 -fit model-: 38.89 sec elapsed

part3: generate output graphs

fm_generate_graphs() : generate output graphs

This function will generate graphs of the model predictions. It will use as input the data generated from fm_fit_model() and provide the predictive plot within a named list. Is the sampling process is activated (samp_process = 1), an additionnal graphic for eta result will be generated.

# run part 3
fm_generate_graphs(fm_model_results = fm_model_results)
#> Running step 4 -plot graphs-

#> Step 4 -plot graphs-: 0.41 sec elapsed
#> $pred_plot