SlideShare a Scribd company logo
1 of 8
Download to read offline
Introduction to AD Model Builder
Anders Nielsen
an@aqua.dtu.dk
What is AD Model Builder
ˆ Tool for development and optimization of nonlinear models
ˆ Structured template for C++ programming
ˆ Support library containing:
– A quasi-Newton minimizer aided by automatic differentiation
– Data objects (number, vector, matrix, 3darray,
ragged arrays, strings, ...)
– Model parameters (unbounded, bounded, fixed, summing to zero,
vectors of, matrix of, ...)
– A simple way to set up optimization in phases
– Standard ways to quantify uncertainty (Hessian based delta method, profile like-
lihood, MCMC sampling)
– Tools for random effects (AD aided Laplace approximation, sparse ma-
trix, importance sampling, ...)
– Lots of helper functions (gammaln, choleski decomp, inv, det, eigenvalues, RNG,
... )
What is it used for?
ˆ Not enough
ˆ Our web-site lists (at my last count):
— 110 peer reviewed publications based on AD Model Builder applications
— 18 Theses and Dissertations
— Countless reports and fish stock assessments
ˆ Those are only the users who remembered to report back
ˆ Models in fisheries science are typically:
— Non-standard
— Non-linear
— High dimensional
ˆ Often they also contain random effects
ˆ They should preferably run in minutes
Dave Fournier receiving the AFS Ricker award
Quick example
ˆ Assume that these 15 numbers follow a negative binomial distribution:
# Number of observations
15
# Observations
13 5 28 28 15 4 13 4 10 17 11 13 12 17 3
ˆ Estimate the two unknown parameters.
ˆ Entire AD Model Builder Program:
DATA_SECTION
init_int N
init_vector X(1,N);
PARAMETER_SECTION
init_number logsize;
init_bounded_number p(0,1);
sdreport_number size;
objective_function_value nll;
PROCEDURE_SECTION
size=exp(logsize);
nll=-sum(gammln(X+size))+N*gammln(size)+
sum(gammln(X+1.0))-N*size*log(p)-sum(X)*log(1.0-p);
ˆ Compile: <filename>.tpl
makeadm
−→ <filename>.cpp
g++
−→ binary
index name value std dev
1 logsize 1.3017e+00 4.7101e-01
2 p 2.2218e-01 8.5571e-02
3 size 3.6754e+00 1.7312e+00
A fisheries catch-at-age model
ˆ Data is the yearly catch in 7 age classes and 45 years Cay, and a yearly index of fishing
effort ey
ˆ The model has 107 model parameters to be estimated (small for an assessment model)
ˆ The model is non-linear
ˆ In AD Model Builder that takes 0.3 seconds to optimize and compute and write all
output
Random effects — no problem
DATA_SECTION
init_int N
init_vector Y(1,N)
PARAMETER_SECTION
init_number logr0
init_number logtheta
init_bounded_number logK(4.6,7.6)
init_number logQ
init_number logR
random_effects_vector X(1,N);
sdreport_number r0
sdreport_number theta
sdreport_number K
sdreport_number Q
sdreport_number R
objective_function_value jnll
PROCEDURE_SECTION
for(int i=2; i<=N; ++i){
step(X(i-1),X(i),logr0,logK,logtheta,logQ);
}
for(int i=1; i<=N; ++i){
obs(X(i),logR,i);
}
r0=exp(logr0); theta=exp(logtheta); K=exp(logK); Q=exp(logQ); R=exp(logR);
SEPARABLE_FUNCTION void step(const dvariable& x1, const dvariable& x2, const dvariable& logr0, const dv
dvariable var=exp(logQ);
dvariable m=x1 + exp(logr0) * (1.0 - pow(exp(x1)/exp(logK),exp(logtheta)));
jnll+=0.5*(log(2.0*M_PI*var)+square(x2-m)/var);
SEPARABLE_FUNCTION void obs(const dvariable& x, const dvariable& logR, int i)
dvariable var=exp(logR);
jnll+=0.5*(log(2.0*M_PI*var)+square(x-Y(i))/var);
A theta logistic population model is defined
for the log-transformed population size as a
nonlinear function of its previous size in the
following way:
Xt = Xt−1 + r0 1 −
exp(Xt−1)
K
θ
+ et,
Yt = Xt + ut,
where et ∼ N(0, Q) and ut ∼ N(0, R).
Anders Nielsen AD Model-Builder
Anders Nielsen AD Model-Builder

More Related Content

What's hot

Machine Learning Basics for Web Application Developers
Machine Learning Basics for Web Application DevelopersMachine Learning Basics for Web Application Developers
Machine Learning Basics for Web Application DevelopersEtsuji Nakai
 
Overview of Apache SystemML by Berthold Reinwald and Nakul Jindal
Overview of Apache SystemML by Berthold Reinwald and Nakul JindalOverview of Apache SystemML by Berthold Reinwald and Nakul Jindal
Overview of Apache SystemML by Berthold Reinwald and Nakul JindalArvind Surve
 
Sajid Ali reg # 016
Sajid Ali reg # 016Sajid Ali reg # 016
Sajid Ali reg # 016Sajid Ali
 
Minimal Introduction to C++ - Part I
Minimal Introduction to C++ - Part IMinimal Introduction to C++ - Part I
Minimal Introduction to C++ - Part IMichel Alves
 
Basic_analysis.ppt
Basic_analysis.pptBasic_analysis.ppt
Basic_analysis.pptSoumyaJ3
 
Performance analysis(Time & Space Complexity)
Performance analysis(Time & Space Complexity)Performance analysis(Time & Space Complexity)
Performance analysis(Time & Space Complexity)swapnac12
 
Complexity Analysis
Complexity Analysis Complexity Analysis
Complexity Analysis Shaista Qadir
 
C programs Set 2
C programs Set 2C programs Set 2
C programs Set 2Koshy Geoji
 
14 dimentionality reduction
14 dimentionality reduction14 dimentionality reduction
14 dimentionality reductionTanmayVijay1
 
Amortized complexity
Amortized complexityAmortized complexity
Amortized complexityparamita30
 
Amortized complexity
Amortized complexityAmortized complexity
Amortized complexityparamita30
 
Amortized complexity
Amortized complexityAmortized complexity
Amortized complexityparamita30
 

What's hot (20)

Machine Learning Basics for Web Application Developers
Machine Learning Basics for Web Application DevelopersMachine Learning Basics for Web Application Developers
Machine Learning Basics for Web Application Developers
 
Concept of c
Concept of cConcept of c
Concept of c
 
Matlab integration
Matlab integrationMatlab integration
Matlab integration
 
Overview of Apache SystemML by Berthold Reinwald and Nakul Jindal
Overview of Apache SystemML by Berthold Reinwald and Nakul JindalOverview of Apache SystemML by Berthold Reinwald and Nakul Jindal
Overview of Apache SystemML by Berthold Reinwald and Nakul Jindal
 
Oral-2
Oral-2Oral-2
Oral-2
 
Sajid Ali reg # 016
Sajid Ali reg # 016Sajid Ali reg # 016
Sajid Ali reg # 016
 
Minimal Introduction to C++ - Part I
Minimal Introduction to C++ - Part IMinimal Introduction to C++ - Part I
Minimal Introduction to C++ - Part I
 
Basic_analysis.ppt
Basic_analysis.pptBasic_analysis.ppt
Basic_analysis.ppt
 
Performance analysis(Time & Space Complexity)
Performance analysis(Time & Space Complexity)Performance analysis(Time & Space Complexity)
Performance analysis(Time & Space Complexity)
 
Complexity Analysis
Complexity Analysis Complexity Analysis
Complexity Analysis
 
Software Metrics
Software MetricsSoftware Metrics
Software Metrics
 
C programs Set 2
C programs Set 2C programs Set 2
C programs Set 2
 
14 dimentionality reduction
14 dimentionality reduction14 dimentionality reduction
14 dimentionality reduction
 
Amortized complexity
Amortized complexityAmortized complexity
Amortized complexity
 
2 optimization
2 optimization2 optimization
2 optimization
 
Computational Complexity
Computational ComplexityComputational Complexity
Computational Complexity
 
Exp 3
Exp 3Exp 3
Exp 3
 
Amortized complexity
Amortized complexityAmortized complexity
Amortized complexity
 
Amortized complexity
Amortized complexityAmortized complexity
Amortized complexity
 
Analysis of algo
Analysis of algoAnalysis of algo
Analysis of algo
 

Similar to Anders Nielsen AD Model-Builder

Feature Engineering - Getting most out of data for predictive models - TDC 2017
Feature Engineering - Getting most out of data for predictive models - TDC 2017Feature Engineering - Getting most out of data for predictive models - TDC 2017
Feature Engineering - Getting most out of data for predictive models - TDC 2017Gabriel Moreira
 
Feature Engineering - Getting most out of data for predictive models
Feature Engineering - Getting most out of data for predictive modelsFeature Engineering - Getting most out of data for predictive models
Feature Engineering - Getting most out of data for predictive modelsGabriel Moreira
 
Software Analytics In Action: A Hands-on Tutorial on Mining, Analyzing, Model...
Software Analytics In Action: A Hands-on Tutorial on Mining, Analyzing, Model...Software Analytics In Action: A Hands-on Tutorial on Mining, Analyzing, Model...
Software Analytics In Action: A Hands-on Tutorial on Mining, Analyzing, Model...Chakkrit (Kla) Tantithamthavorn
 
DN 2017 | Multi-Paradigm Data Science - On the many dimensions of Knowledge D...
DN 2017 | Multi-Paradigm Data Science - On the many dimensions of Knowledge D...DN 2017 | Multi-Paradigm Data Science - On the many dimensions of Knowledge D...
DN 2017 | Multi-Paradigm Data Science - On the many dimensions of Knowledge D...Dataconomy Media
 
[DSC Europe 22] Smart approach in development and deployment process for vari...
[DSC Europe 22] Smart approach in development and deployment process for vari...[DSC Europe 22] Smart approach in development and deployment process for vari...
[DSC Europe 22] Smart approach in development and deployment process for vari...DataScienceConferenc1
 
Chapter 1 Basic Concepts
Chapter 1 Basic ConceptsChapter 1 Basic Concepts
Chapter 1 Basic ConceptsHareem Aslam
 
Towards a Unified Data Analytics Optimizer with Yanlei Diao
Towards a Unified Data Analytics Optimizer with Yanlei DiaoTowards a Unified Data Analytics Optimizer with Yanlei Diao
Towards a Unified Data Analytics Optimizer with Yanlei DiaoDatabricks
 
TDC2017 | São Paulo - Trilha Java EE How we figured out we had a SRE team at ...
TDC2017 | São Paulo - Trilha Java EE How we figured out we had a SRE team at ...TDC2017 | São Paulo - Trilha Java EE How we figured out we had a SRE team at ...
TDC2017 | São Paulo - Trilha Java EE How we figured out we had a SRE team at ...tdc-globalcode
 
Tactical data engineering
Tactical data engineeringTactical data engineering
Tactical data engineeringJulian Hyde
 
Automatic Task-based Code Generation for High Performance DSEL
Automatic Task-based Code Generation for High Performance DSELAutomatic Task-based Code Generation for High Performance DSEL
Automatic Task-based Code Generation for High Performance DSELJoel Falcou
 
Mini-lab 1: Stochastic Gradient Descent classifier, Optimizing Logistic Regre...
Mini-lab 1: Stochastic Gradient Descent classifier, Optimizing Logistic Regre...Mini-lab 1: Stochastic Gradient Descent classifier, Optimizing Logistic Regre...
Mini-lab 1: Stochastic Gradient Descent classifier, Optimizing Logistic Regre...Yao Yao
 
Real-Time Spark: From Interactive Queries to Streaming
Real-Time Spark: From Interactive Queries to StreamingReal-Time Spark: From Interactive Queries to Streaming
Real-Time Spark: From Interactive Queries to StreamingDatabricks
 
Aggregation Functions in OCL
Aggregation Functions in OCL Aggregation Functions in OCL
Aggregation Functions in OCL Jordi Cabot
 
R Programming - part 1.pdf
R Programming - part 1.pdfR Programming - part 1.pdf
R Programming - part 1.pdfRohanBorgalli
 
Timeseries - data visualization in Grafana
Timeseries - data visualization in GrafanaTimeseries - data visualization in Grafana
Timeseries - data visualization in GrafanaOCoderFest
 

Similar to Anders Nielsen AD Model-Builder (20)

Feature Engineering - Getting most out of data for predictive models - TDC 2017
Feature Engineering - Getting most out of data for predictive models - TDC 2017Feature Engineering - Getting most out of data for predictive models - TDC 2017
Feature Engineering - Getting most out of data for predictive models - TDC 2017
 
R programmingmilano
R programmingmilanoR programmingmilano
R programmingmilano
 
Feature Engineering - Getting most out of data for predictive models
Feature Engineering - Getting most out of data for predictive modelsFeature Engineering - Getting most out of data for predictive models
Feature Engineering - Getting most out of data for predictive models
 
Software Analytics In Action: A Hands-on Tutorial on Mining, Analyzing, Model...
Software Analytics In Action: A Hands-on Tutorial on Mining, Analyzing, Model...Software Analytics In Action: A Hands-on Tutorial on Mining, Analyzing, Model...
Software Analytics In Action: A Hands-on Tutorial on Mining, Analyzing, Model...
 
DN 2017 | Multi-Paradigm Data Science - On the many dimensions of Knowledge D...
DN 2017 | Multi-Paradigm Data Science - On the many dimensions of Knowledge D...DN 2017 | Multi-Paradigm Data Science - On the many dimensions of Knowledge D...
DN 2017 | Multi-Paradigm Data Science - On the many dimensions of Knowledge D...
 
[DSC Europe 22] Smart approach in development and deployment process for vari...
[DSC Europe 22] Smart approach in development and deployment process for vari...[DSC Europe 22] Smart approach in development and deployment process for vari...
[DSC Europe 22] Smart approach in development and deployment process for vari...
 
Chapter 1 Basic Concepts
Chapter 1 Basic ConceptsChapter 1 Basic Concepts
Chapter 1 Basic Concepts
 
Towards a Unified Data Analytics Optimizer with Yanlei Diao
Towards a Unified Data Analytics Optimizer with Yanlei DiaoTowards a Unified Data Analytics Optimizer with Yanlei Diao
Towards a Unified Data Analytics Optimizer with Yanlei Diao
 
TDC2017 | São Paulo - Trilha Java EE How we figured out we had a SRE team at ...
TDC2017 | São Paulo - Trilha Java EE How we figured out we had a SRE team at ...TDC2017 | São Paulo - Trilha Java EE How we figured out we had a SRE team at ...
TDC2017 | São Paulo - Trilha Java EE How we figured out we had a SRE team at ...
 
Tactical data engineering
Tactical data engineeringTactical data engineering
Tactical data engineering
 
L5 array
L5 arrayL5 array
L5 array
 
Automatic Task-based Code Generation for High Performance DSEL
Automatic Task-based Code Generation for High Performance DSELAutomatic Task-based Code Generation for High Performance DSEL
Automatic Task-based Code Generation for High Performance DSEL
 
Mini-lab 1: Stochastic Gradient Descent classifier, Optimizing Logistic Regre...
Mini-lab 1: Stochastic Gradient Descent classifier, Optimizing Logistic Regre...Mini-lab 1: Stochastic Gradient Descent classifier, Optimizing Logistic Regre...
Mini-lab 1: Stochastic Gradient Descent classifier, Optimizing Logistic Regre...
 
Real-Time Spark: From Interactive Queries to Streaming
Real-Time Spark: From Interactive Queries to StreamingReal-Time Spark: From Interactive Queries to Streaming
Real-Time Spark: From Interactive Queries to Streaming
 
Analytics with Spark
Analytics with SparkAnalytics with Spark
Analytics with Spark
 
Aggregation Functions in OCL
Aggregation Functions in OCL Aggregation Functions in OCL
Aggregation Functions in OCL
 
R Programming - part 1.pdf
R Programming - part 1.pdfR Programming - part 1.pdf
R Programming - part 1.pdf
 
Xgboost
XgboostXgboost
Xgboost
 
Timeseries - data visualization in Grafana
Timeseries - data visualization in GrafanaTimeseries - data visualization in Grafana
Timeseries - data visualization in Grafana
 
big-data-anallytics.pptx
big-data-anallytics.pptxbig-data-anallytics.pptx
big-data-anallytics.pptx
 

More from David LeBauer

Software and data as scaffolds for integrative science
Software and data as scaffolds for integrative scienceSoftware and data as scaffolds for integrative science
Software and data as scaffolds for integrative scienceDavid LeBauer
 
Reusable Software and Open Data To Optimize Agriculture
Reusable Software and Open Data To Optimize AgricultureReusable Software and Open Data To Optimize Agriculture
Reusable Software and Open Data To Optimize AgricultureDavid LeBauer
 
Matt Jones software-interoperability
Matt Jones software-interoperabilityMatt Jones software-interoperability
Matt Jones software-interoperabilityDavid LeBauer
 
Aaron Ellison: Analytic Web
Aaron Ellison: Analytic WebAaron Ellison: Analytic Web
Aaron Ellison: Analytic WebDavid LeBauer
 
Ilkay Altintas: Kepler
Ilkay Altintas: KeplerIlkay Altintas: Kepler
Ilkay Altintas: KeplerDavid LeBauer
 
Jeroen Steenbeek Ecopath with Ecosim
Jeroen Steenbeek Ecopath with EcosimJeroen Steenbeek Ecopath with Ecosim
Jeroen Steenbeek Ecopath with EcosimDavid LeBauer
 
Aaron Ellison Keynote: Reaching the 99%
Aaron Ellison Keynote: Reaching the 99%Aaron Ellison Keynote: Reaching the 99%
Aaron Ellison Keynote: Reaching the 99%David LeBauer
 
Andrew Thomas OpenBUGS
Andrew Thomas OpenBUGSAndrew Thomas OpenBUGS
Andrew Thomas OpenBUGSDavid LeBauer
 
Janine Illian R-INLA
Janine Illian R-INLAJanine Illian R-INLA
Janine Illian R-INLADavid LeBauer
 
Advancing Software for Ecological Forecasting: Public Sessions
Advancing Software for Ecological Forecasting: Public SessionsAdvancing Software for Ecological Forecasting: Public Sessions
Advancing Software for Ecological Forecasting: Public SessionsDavid LeBauer
 
Advancing software for ecological forecasting
Advancing software for ecological forecastingAdvancing software for ecological forecasting
Advancing software for ecological forecastingDavid LeBauer
 

More from David LeBauer (20)

Software and data as scaffolds for integrative science
Software and data as scaffolds for integrative scienceSoftware and data as scaffolds for integrative science
Software and data as scaffolds for integrative science
 
Reusable Software and Open Data To Optimize Agriculture
Reusable Software and Open Data To Optimize AgricultureReusable Software and Open Data To Optimize Agriculture
Reusable Software and Open Data To Optimize Agriculture
 
Yiqi Luo EcoPAD
Yiqi Luo EcoPADYiqi Luo EcoPAD
Yiqi Luo EcoPAD
 
David LeBauer PEcAn
David LeBauer PEcAnDavid LeBauer PEcAn
David LeBauer PEcAn
 
David Kelly SWIFT
David Kelly SWIFTDavid Kelly SWIFT
David Kelly SWIFT
 
Matt Jones software-interoperability
Matt Jones software-interoperabilityMatt Jones software-interoperability
Matt Jones software-interoperability
 
Aaron Ellison: Analytic Web
Aaron Ellison: Analytic WebAaron Ellison: Analytic Web
Aaron Ellison: Analytic Web
 
Ilkay Altintas: Kepler
Ilkay Altintas: KeplerIlkay Altintas: Kepler
Ilkay Altintas: Kepler
 
Jeroen Steenbeek Ecopath with Ecosim
Jeroen Steenbeek Ecopath with EcosimJeroen Steenbeek Ecopath with Ecosim
Jeroen Steenbeek Ecopath with Ecosim
 
Aaron Ellison Keynote: Reaching the 99%
Aaron Ellison Keynote: Reaching the 99%Aaron Ellison Keynote: Reaching the 99%
Aaron Ellison Keynote: Reaching the 99%
 
Andrew Thomas OpenBUGS
Andrew Thomas OpenBUGSAndrew Thomas OpenBUGS
Andrew Thomas OpenBUGS
 
Martyn Plummer JAGS
Martyn Plummer JAGSMartyn Plummer JAGS
Martyn Plummer JAGS
 
Daniel Lee STAN
Daniel Lee STANDaniel Lee STAN
Daniel Lee STAN
 
Ed Ionides POMP
Ed Ionides POMPEd Ionides POMP
Ed Ionides POMP
 
Janine Illian R-INLA
Janine Illian R-INLAJanine Illian R-INLA
Janine Illian R-INLA
 
Andy Fox DART
Andy Fox DARTAndy Fox DART
Andy Fox DART
 
Mike Dietze PEcAn
Mike Dietze PEcAnMike Dietze PEcAn
Mike Dietze PEcAn
 
de Valpine NIMBLE
de Valpine NIMBLEde Valpine NIMBLE
de Valpine NIMBLE
 
Advancing Software for Ecological Forecasting: Public Sessions
Advancing Software for Ecological Forecasting: Public SessionsAdvancing Software for Ecological Forecasting: Public Sessions
Advancing Software for Ecological Forecasting: Public Sessions
 
Advancing software for ecological forecasting
Advancing software for ecological forecastingAdvancing software for ecological forecasting
Advancing software for ecological forecasting
 

Recently uploaded

Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 

Recently uploaded (20)

Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 

Anders Nielsen AD Model-Builder

  • 1. Introduction to AD Model Builder Anders Nielsen an@aqua.dtu.dk
  • 2. What is AD Model Builder ˆ Tool for development and optimization of nonlinear models ˆ Structured template for C++ programming ˆ Support library containing: – A quasi-Newton minimizer aided by automatic differentiation – Data objects (number, vector, matrix, 3darray, ragged arrays, strings, ...) – Model parameters (unbounded, bounded, fixed, summing to zero, vectors of, matrix of, ...) – A simple way to set up optimization in phases – Standard ways to quantify uncertainty (Hessian based delta method, profile like- lihood, MCMC sampling) – Tools for random effects (AD aided Laplace approximation, sparse ma- trix, importance sampling, ...) – Lots of helper functions (gammaln, choleski decomp, inv, det, eigenvalues, RNG, ... )
  • 3. What is it used for? ˆ Not enough ˆ Our web-site lists (at my last count): — 110 peer reviewed publications based on AD Model Builder applications — 18 Theses and Dissertations — Countless reports and fish stock assessments ˆ Those are only the users who remembered to report back ˆ Models in fisheries science are typically: — Non-standard — Non-linear — High dimensional ˆ Often they also contain random effects ˆ They should preferably run in minutes Dave Fournier receiving the AFS Ricker award
  • 4. Quick example ˆ Assume that these 15 numbers follow a negative binomial distribution: # Number of observations 15 # Observations 13 5 28 28 15 4 13 4 10 17 11 13 12 17 3 ˆ Estimate the two unknown parameters. ˆ Entire AD Model Builder Program: DATA_SECTION init_int N init_vector X(1,N); PARAMETER_SECTION init_number logsize; init_bounded_number p(0,1); sdreport_number size; objective_function_value nll; PROCEDURE_SECTION size=exp(logsize); nll=-sum(gammln(X+size))+N*gammln(size)+ sum(gammln(X+1.0))-N*size*log(p)-sum(X)*log(1.0-p); ˆ Compile: <filename>.tpl makeadm −→ <filename>.cpp g++ −→ binary index name value std dev 1 logsize 1.3017e+00 4.7101e-01 2 p 2.2218e-01 8.5571e-02 3 size 3.6754e+00 1.7312e+00
  • 5. A fisheries catch-at-age model ˆ Data is the yearly catch in 7 age classes and 45 years Cay, and a yearly index of fishing effort ey ˆ The model has 107 model parameters to be estimated (small for an assessment model) ˆ The model is non-linear ˆ In AD Model Builder that takes 0.3 seconds to optimize and compute and write all output
  • 6. Random effects — no problem DATA_SECTION init_int N init_vector Y(1,N) PARAMETER_SECTION init_number logr0 init_number logtheta init_bounded_number logK(4.6,7.6) init_number logQ init_number logR random_effects_vector X(1,N); sdreport_number r0 sdreport_number theta sdreport_number K sdreport_number Q sdreport_number R objective_function_value jnll PROCEDURE_SECTION for(int i=2; i<=N; ++i){ step(X(i-1),X(i),logr0,logK,logtheta,logQ); } for(int i=1; i<=N; ++i){ obs(X(i),logR,i); } r0=exp(logr0); theta=exp(logtheta); K=exp(logK); Q=exp(logQ); R=exp(logR); SEPARABLE_FUNCTION void step(const dvariable& x1, const dvariable& x2, const dvariable& logr0, const dv dvariable var=exp(logQ); dvariable m=x1 + exp(logr0) * (1.0 - pow(exp(x1)/exp(logK),exp(logtheta))); jnll+=0.5*(log(2.0*M_PI*var)+square(x2-m)/var); SEPARABLE_FUNCTION void obs(const dvariable& x, const dvariable& logR, int i) dvariable var=exp(logR); jnll+=0.5*(log(2.0*M_PI*var)+square(x-Y(i))/var); A theta logistic population model is defined for the log-transformed population size as a nonlinear function of its previous size in the following way: Xt = Xt−1 + r0 1 − exp(Xt−1) K θ + et, Yt = Xt + ut, where et ∼ N(0, Q) and ut ∼ N(0, R).