ParameterVar
MCBB.ParameterVar — TypeParameterVarParameter Variation types, these structs holds information about the parameters and how they should be varied. For many cases this struct is automaticlly initialized when calling DEMCBBProblem with appropiate Tuples. It assumes that the parameters are itself structs most commonly with a field that has to be varied.
Type Hierachy
OneDimParameterVar, MultiDimParameterVar <: ParameterVarParameterVarArray, ParameterVarFunc <: OneDimParameterVarMulitDimParameterVarArray, MultiDimParameterVarFunc <: MultiDimParameterVar
MCBB.ParameterVarArray — TypeParameterVarArrayType for the parameter variation with an array that holds all parameter values. The struct has the fields:
name: Symbol of the name of the parameternew_val:: Function that returns a new value, signature:(i::Int) -> new_value::Numberor()-> new_value::Numbernew_par:: Function that returns a new parameter struct, default: Parameters.reconstruct, signature:(old_par; Dict(name=>new_val)) = new_parN:: Length of the array / Number of parameter valuesarr:: The input array saved
Initialization
ParameterVar(name::Symbol, arr::AbstractArray, new_par::Function)ParameterVar(name::Symbol, arr::AbstractArray)nameis the name of the field of the parameter struct that should be variedarris the array that containts all values the parameter should be varied to.
MCBB.ParameterVarFunc — TypeParameterVarFuncStruct for the parameter variation with a function that generates new values. The struct has the fields:
name: Symbol of the name of the parameternew_val:: Function that returns a new value, signature:(i::Int) -> new_value::Numbernew_par:: Function that returns a new parameter struct, default: Parameters.reconstruct, signature:(old_par; Dict(name=>new_val)) = new_par
Initialization
ParameterVar(name::Symbol, func::Function, new_par::Function)ParameterVar(name::Symbol, func::Function)nameis the name of the field of the parameter struct that should be variedfuncis the function that generates the parameter values, signature:(i::Int) -> new_value::Number
MCBB.MultiDimParameterVar — TypeMultiDimParameterVarHolds information about multiple parameters that should be varied simultaneously. The struct has the fields:
data: 1-D Array ofOneDimParamterVarFunction: function that returns a new parameter struct given keyword arguments of all parameters that should be varied. signature:(old_par; Dict(name_1=>new_val_1, name_2=>new_val_2, ...)) = new_parN: Number of parameters that are varied.
Internally there are two different main types, MultiDimParameterVarFunc and MultiDimParameterVarArray. The only difference is what type of ParameterVar they store. The different types are needed for dispatching on them in the routines that setups DEMCBBProblem
For Hidden Parameter Varition (see HiddenParameterVar) there is MultiDimHiddenParameterVar. It always takes the hidden parameters from the first HiddenParameterVar it is initialized with.
Initialization
MultiDimParameterVar(data::Array{ParameterVarFunc,1}, func::Function)MultiDimParameterVar(data::Array{ParameterVarArray,1}, func::Function)MultiDimParameterVar(parvar::ParameterVar, func::Function)MultiDimParameterVar(parvar::ParameterVar): default function is Parameters.reconstruct
MCBB.HiddenParameterVar — Typestruct HiddenParameterVar <: ParameterVarSubtype of ParameterVar that varies a lot of "hidden"/"background" parameters randomly and one control parameter. If multiple control parameters need to varied, MultiDimHiddenParameterVar has to be used.
Fields
name::Symbolpars::AbstractArraystores the values of the hidden parametersnew_par::Functionfunction that returns new parameter instance with signature(pars[i,:]..., name=>new_val()) -> new_parametersnew_val::Function:: Function that returns new values for the control parameters(i::Int)->new_val::NumberN_control_par::Int: Number of control parameters drawn/usedN_hidden_par::Int: Number of 'hidden' parametersflag_repeat_hidden_pars::Bool: Iftruethe valuesparsfor the hidden parameters are repeated for every value of the control parameter. Iffalse, thenN_control_par==N_hidden_par.
Initialization
HiddenParameterVar(name::Symbol, pars::AbstractArray, new_par::Function, new_val::Function, N_control_par::Int, N_hidden_par::Union{Int, Nothing}=nothing, flag_repeat_hidden_pars::Bool=true)
HiddenParameterVar(name::Symbol, f::Function, new_par, new_val, N_control_par::Int, N_hidden_par::Int, flag_repeat_hidden_pars::Bool=true)
* `f` : Is the function that returns the hidden parameters. Signature `(i)->pars[i,:]` or `()->pars[i,:]`.Base.getindex — Methodgetindex(parvar::MultiDimParameterVar, i::Int)Like regular arrays the individual ParameterVar entries can be accessed with square brackets e.g.: parvar[i].
Base.length — Methodlength(parvar::MultiDimParameterVar)Length returns the amount of Parameters that are setup to be varied.
MCBB.ParameterVar — MethodParameterVar(prob::myMCProblem)Given one of the problem types of this library its ParameterVar is returned.