AdaptiveDesignOptimization.Model
— TypeModel
Creates a model object containing a log likelihood function and prior distributions
prior
: a vector of distribution objects for each parameter. A uniform prior is used if no
prior is passed.
loglike
: a function that computes the log likelihood
Constructor
Model(args...; prior=nothing, loglike, kwargs...)
Examples
# Default uninform prior
loglike(θ, design, data) = ...
model = Model(;loglike)
# Custom priors
prior = [Beta(5,5),...]
loglike(θ, design, data) = ...
model = Model(;loglike, prior)
AdaptiveDesignOptimization.Optimizer
— TypeOptimizer(;task, model, grid_design, grid_parms, grid_response)
Optimizer
constructs a model object for adaptive design optimization
Fields
model
: a model objectgrid_design
:a grid of design parametersgrid_parms
: a grid of model parametersgrid_data
: a grid of datalog_like
: a three dimensional array of precomputed log likelihoodsmarg_log_like
: a two dimensional array containing marginal log likelihoods for design and datapriors
: a multidimensional array of prior probabilities for parameterslog_post
: a one dimensional array of log posterior probabilities for parametersentropy
: a two dimensional array of entropy values for parameter and design combinationsmarg_entropy
:cond_entropy
:mutual_info
:best_design
:parm_names
:model_state
:update_state!
:
AdaptiveDesignOptimization.loglikelihood!
— Methodloglikelihood(optimizer::Optimizer)
Computes a three dimensional grid of log likelihoods where the first dimension is the model parameters, the second dimension is the design parameters, and the third dimension is the data values.
loglike
: a model object containing a log likelihood function and prior distributionsparm_grid
: a grid of model parametersdesign_grid
: a grid of design parametersdata_grid
: a grid of data valuesmodel_type
: model type can beStatic
orDynamic
model_state
: model state variables that are updated forDynamic
models
AdaptiveDesignOptimization.loglikelihood!
— Methodloglikelihood(optimizer::Optimizer)
Computes a three dimensional grid of log likelihoods for a dynamic model where the first dimension is the model parameters, the second dimension is the design parameters, and the third dimension is the data values.
optimizer
: an optimizer object
AdaptiveDesignOptimization.loglikelihood
— Methodloglikelihood(model::Model, design_grid, parm_grid, data_grid, model_type, model_state)
Computes a three dimensional grid of log likelihoods where the first dimension is the model parameters, the second dimension is the design parameters, and the third dimension is the data values.
loglike
: a model object containing a log likelihood function and prior distributionsparm_grid
: a grid of model parametersdesign_grid
: a grid of design parametersdata_grid
: a grid of data valuesmodel_type
: model type can beStatic
orDynamic
model_state
: model state variables that are updated forDynamic
models
AdaptiveDesignOptimization.loglikelihood
— Methodloglikelihood(model::Model, design_grid, parm_grid, data_grid, model_type, model_state)
Computes a three dimensional grid of log likelihoods for a dynamic model where the first dimension is the model parameters, the second dimension is the design parameters, and the third dimension is the data values.
loglike
: a model object containing a log likelihood function and prior distributionsparm_grid
: a grid of model parametersdesign_grid
: a grid of design parametersdata_grid
: a grid of data valuesmodel_type
: model type can beStatic
orDynamic
model_state
: model state variables that are updated forDynamic
models
AdaptiveDesignOptimization.loglikelihood
— Methodloglikelihood(model::Model, design_grid, parm_grid, data_grid, model_type, model_state)
Computes a three dimensional grid of log likelihoods where the first dimension is the model parameters, the second dimension is the design parameters, and the third dimension is the data values.
model::Model
: a model object containing a log likelihood function and prior distributionsparm_grid
: a grid of model parametersdesign_grid
: a grid of design parametersdata_grid
: a grid of data valuesmodel_type
: model type can beStatic
orDynamic
model_state
: model state variables that are updated forDynamic
models
AdaptiveDesignOptimization.loglikelihood
— Methodloglikelihood(model::Model, design_grid, parm_grid, data_grid, model_type, model_state)
Computes a three dimensional grid of log likelihoods where the first dimension is the model parameters, the second dimension is the design parameters, and the third dimension is the data values.
model::Model
: a model object containing a log likelihood function and prior distributionsparm_grid
: a grid of model parametersdesign_grid
: a grid of design parametersdata_grid
: a grid of data valuesmodel_type
: model type can beStatic
orDynamic
model_state
: model state variables that are updated forDynamic
models
AdaptiveDesignOptimization.marginal_log_like!
— Methodmarginal_log_like!(optimizer)
Marginalizes the log likelihoods over model parameters, resulting in a three dimensional array where the first dimension is length 1, the second dimension is the design parameters, and the third dimension is the data values.
optimizer
: an optimizer object
AdaptiveDesignOptimization.marginal_log_like
— Methodmarginal_log_like(optimizer)
Marginalizes the log likelihoods over model parameters, resulting in a three dimensional array where the first dimension is length 1, the second dimension is the design parameters, and the third dimension is the data values.
log_post
: a vector of posterior log likelihood values for the model parameterslog_like
: a three dimensional vector of log likelihood values where the first dimension corresponds to the model parameters,
the second dimension corresponds to the design parameters, and the third dimension corresponds to the data values
AdaptiveDesignOptimization.mutual_information!
— Methodmutual_information!(optimizer)
Computes a vector of the mutual information values where each element corresponds to a design parameter.
optimizer
: an optimizer object
AdaptiveDesignOptimization.mutual_information
— Methodmutual_information(optimizer)
Computes a vector of the mutual information values where each element corresponds to a design parameter.
marg_entropy
: a vector of marginal entropy values where each element corresponds to a design parametercond_entropy
: a vector of conditional entropy values where each element corresponds to a design parameter
AdaptiveDesignOptimization.prior_probs
— Methodprior_probs(prior, parm_grid)
Computes a grid of prior probabilities over model parameters.
prior
: a vector ofDistribution
objects, one for each parameterparm_grid
: a grid of parameter values
AdaptiveDesignOptimization.prior_probs
— Methodprior_probs(model::Model, parm_grid)
Computes a grid of prior probabilities over model parameters.
model::Model
: a model objectparm_grid
: a grid of parameter values
AdaptiveDesignOptimization.prior_probs
— Methodprior_probs(prior, parm_grid)
Computes a grid of uniform prior probabilities over model parameters.
prior::Nothing
: a vector ofDistribution
objects, one for each parameterparm_grid
: a grid of parameter values