Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
..
Failed to load latest commit information.
tools
validation
Makefile
README.md
adaptive_integration.R
adaptive_integration.cpp
adaptive_integration.expected.RData
ar1_4D.R
ar1_4D.cpp
ar1_4D.expected.RData
compois.R
compois.cpp update compois examples Jan 12, 2017
compois.expected.RData Add compois expected output Jan 31, 2017
hmm.R New example: HMM filter Apr 27, 2015
hmm.cpp New example: HMM filter Apr 27, 2015
hmm.expected.RData
hmm_filter.hpp Doxygen: Add new examples Aug 18, 2016
laplace.R
laplace.cpp tmbutils::vector: Conversion too general Feb 17, 2017
laplace.expected.RData
linreg.R tmb_examples consistency #202 : Sep 16, 2016
linreg.cpp tmb_examples consistency #202 : Sep 16, 2016
linreg.expected.RData Updated all expected output Sep 16, 2016
linreg_parallel.R
linreg_parallel.cpp
linreg_parallel.expected.RData
longlinreg.R
longlinreg.cpp tmb_examples consistency #202 : Sep 16, 2016
longlinreg.expected.RData Updated all expected output Sep 16, 2016
lr_test.R tmb_examples consistency #202 : Sep 16, 2016
lr_test.cpp
matern.R travis: re-enable (modified) matern example May 6, 2017
matern.cpp
matern.expected.RData
mvrw.R
mvrw.cpp
mvrw.expected.RData Updated all expected output Sep 16, 2016
mvrw_sparse.R
mvrw_sparse.cpp Fix un-used variable warnings: Dec 20, 2016
mvrw_sparse.expected.RData
nmix.R
nmix.cpp Fix un-used variable warnings: Dec 20, 2016
nmix.dat Rename files and folders Oct 22, 2013
nmix.expected.RData Updated all expected output Sep 16, 2016
orange_big.R
orange_big.cpp
orange_big.expected.RData Updated all expected output Sep 16, 2016
orange_data.R
register_atomic.R
register_atomic.cpp New example 'register_atomic' Dec 10, 2017
register_atomic.expected.RData
register_atomic_parallel.R
register_atomic_parallel.cpp New example 'register_atomic_parallel' Dec 10, 2017
sam.R tmb_examples consistency #202 : Sep 16, 2016
sam.cpp
sam.expected.RData Updated all expected output Sep 16, 2016
sam_data.R
sde_linear.R
sde_linear.cpp
sde_linear.expected.RData
sdv_multi.R
sdv_multi.cpp MVNORM: Use atomic matrix AD by default Nov 27, 2014
sdv_multi.expected.RData
sdv_multi_compact.R
sdv_multi_compact.cpp
sdv_multi_compact.expected.RData
sdv_multi_data.R Add missing file in sdv_multi example Oct 24, 2013
socatt.R
socatt.cpp
socatt.dat Remove deprecated folders: May 9, 2017
socatt.expected.RData Updated all expected output Sep 16, 2016
spatial.R tmb_examples consistency #202 : Sep 16, 2016
spatial.cpp
spatial.expected.RData
spatial_data.R
spde.R
spde.cpp
spde_aniso.R
spde_aniso.cpp
thetalog.R
thetalog.cpp
thetalog.dat New example: theta logistic Feb 7, 2014
thetalog.expected.RData
transform.R
transform.cpp
transform.expected.RData
transform2.R tmb_examples consistency #202 : Sep 16, 2016
transform2.cpp Add example 'transform2' Sep 5, 2016
transform2.expected.RData
transform_parallel.R New example: transform_parallel Jan 4, 2015
transform_parallel.cpp
tweedie.R
tweedie.cpp
tweedie.expected.RData Updated all expected output Sep 16, 2016
tweedie_data.R

README.md

README

This folder contains TMB examples. If "examp.cpp" and "examp.R" both exists then "examp" is a valid example. Test automation is provided by the files "Makefile" and "unittest.R". The purpose of the test is to verify correctness of results and to verify that the timings are reasonable. Each example is associated with a file "examp.expected.RData" with correct output from a reference test machine (For new examples this file is automatically generated, and correctness must be manually verified). Perform a full test by running

make clean
make

A file "REPORT.md" (see below) will be generated with test results and timings.

REPORT.md

Example overview:

Examples in '.':

"adaptive_integration": Adaptive integration using
                        'tiny_ad'
"ar1_4D":               Separable covariance on 4D lattice
                        with AR1 structure in each
                        direction.
"hmm":                  Inference in a 'double-well'
                        stochastic differential equation
                        using HMM filter.
"laplace":              Laplace approximation from scratch
                        demonstrated on 'spatial' example.
"linreg_parallel":      Parallel linear regression.
"linreg":               Simple linear regression.
"longlinreg":           Linear regression - 10^6
                        observations.
"lr_test":              Illustrate map feature of TMB to
                        perform likelihood ratio tests on a
                        ragged array dataset.
"matern":               Gaussian process with Matern
                        covariance.
"mvrw":                 Random walk with multivariate
                        correlated increments and
                        measurement noise.
"mvrw_sparse":          Identical with random walk example.
                        Utilizing sparse block structure so
                        efficient when the number of states
                        is high.
"nmix":                 nmix example from
                        https://groups.nceas.ucsb.edu/non-linear-modeling/projects/nmix
"orange_big":           Scaled up version of the Orange
                        Tree example (5000 latent random
                        variables)
"sam":                  State space assessment model from
                        Nielsen and Berg 2014, Fisheries
                        Research.
"sde_linear":           Inference in a linear scalar
                        stochastic differential equation.
"sdv_multi_compact":    Compact version of sdv_multi
"sdv_multi":            Multivatiate SV model from Skaug
                        and Yu 2013, Comp. Stat & data
                        Analysis (to appear)
"socatt":               socatt from ADMB example
                        collection.
"spatial":              Spatial poisson GLMM on a grid,
                        with exponentially decaying
                        correlation function
"spde_aniso":           Anisotropic version of "spde.cpp".
"spde":                 Illustration SPDE/INLA approach to
                        spatial modelling via Matern
                        correlation function
"thetalog":             Theta logistic population model
                        from Pedersen et al 2012, Ecol.
                        Modelling.
"transform2":           Beta distributed random effects
                        using copulas.
"transform_parallel":   Parallel version of transform
"transform":            Gamma distributed random effects
                        using copulas.
"tweedie":              Estimating parameters in a Tweedie
                        distribution.

Results (absolute error):

                                       Min.    Median      Max.
adaptive_integration              0.000e+00 0.000e+00 0.000e+00
ar1_4D                            0.000e+00 0.000e+00 0.000e+00
hmm                               0.000e+00 0.000e+00 0.000e+00
laplace                           0.000e+00 0.000e+00 0.000e+00
linreg                            0.000e+00 0.000e+00 0.000e+00
linreg_parallel                   0.000e+00 0.000e+00 0.000e+00
longlinreg                        0.000e+00 0.000e+00 0.000e+00
matern                            0.000e+00 0.000e+00 0.000e+00
mvrw                              0.000e+00 0.000e+00 0.000e+00
mvrw_sparse                       0.000e+00 0.000e+00 0.000e+00
nmix                              0.000e+00 0.000e+00 0.000e+00
orange_big                        0.000e+00 0.000e+00 0.000e+00
sam                               0.000e+00 0.000e+00 0.000e+00
sde_linear                        0.000e+00 0.000e+00 0.000e+00
sdv_multi_compact                 0.000e+00 0.000e+00 0.000e+00
sdv_multi                         0.000e+00 0.000e+00 0.000e+00
socatt                            0.000e+00 0.000e+00 0.000e+00
spatial                           0.000e+00 0.000e+00 0.000e+00
thetalog                          0.000e+00 0.000e+00 0.000e+00
transform2                        0.000e+00 0.000e+00 0.000e+00
transform                         0.000e+00 0.000e+00 0.000e+00
transform_parallel                1.914e-13 4.873e-13 3.593e-11
tweedie                           0.000e+00 0.000e+00 0.000e+00
validation/MVRandomWalkValidation 0.000e+00 0.000e+00 0.000e+00
validation/randomwalkvalidation   0.000e+00 0.000e+00 0.000e+00
validation/rickervalidation       0.000e+00 0.000e+00 0.000e+00

Timings:

                                  totaltime timeindex
adaptive_integration                  4.717 0.9778192
ar1_4D                               10.035 1.0135340
hmm                                   4.740 0.9618506
laplace                               6.016 1.0292558
linreg                                0.007 1.0000000
linreg_parallel                       0.307 0.9967532
longlinreg                            6.627 1.0046998
matern                                4.335 1.0693143
mvrw                                  0.155 0.9872611
mvrw_sparse                           0.146 1.0068966
nmix                                  0.778 1.0263852
orange_big                            2.865 1.0141593
sam                                   3.319 1.0006030
sde_linear                            0.156 0.9570552
sdv_multi_compact                     3.962 1.0104565
sdv_multi                             7.475 0.9946773
socatt                                0.791 0.9987374
spatial                               2.425 0.9958932
thetalog                              0.179 0.9322917
transform2                           10.829 0.9938510
transform                             6.354 1.0036329
transform_parallel                    3.208 0.5067130
tweedie                               0.508 0.9844961
validation/MVRandomWalkValidation     2.238 0.9734667
validation/randomwalkvalidation       0.285 1.0000000
validation/rickervalidation          75.970 0.9834559

Accuracy tests:

                                  passed
adaptive_integration                TRUE
ar1_4D                              TRUE
hmm                                 TRUE
laplace                             TRUE
linreg                              TRUE
linreg_parallel                     TRUE
longlinreg                          TRUE
matern                              TRUE
mvrw                                TRUE
mvrw_sparse                         TRUE
nmix                                TRUE
orange_big                          TRUE
sam                                 TRUE
sde_linear                          TRUE
sdv_multi                           TRUE
sdv_multi_compact                   TRUE
socatt                              TRUE
spatial                             TRUE
thetalog                            TRUE
transform                           TRUE
transform2                          TRUE
transform_parallel                  TRUE
tweedie                             TRUE
validation/MVRandomWalkValidation   TRUE
validation/randomwalkvalidation     TRUE
validation/rickervalidation         TRUE

Profiling:

Examples can be profiled using intel vtune. To profile e.g. example "spatial" run

make spatial.profile

This requires "amplxe-cl" on your path. View the profile with

amplxe-gui spatial.profile