Fixed Age-Metallicity Relations
It is often the case that one may want to fit for star formation rates under a fixed age-metallicity relation or other metallicity evolution model with no degrees of freedom. Such functionality is provided by fixed_amr
, which takes as input the relative weights (relweights
in the function call, equivalently the $r_{j,k}$ in the above derivation) on each template due to a predetermined metallicity model and fits only the per-age-bin coefficients ($R_j$ in the above derivation).
StarFormationHistories.fixed_amr
— Functionfixed_amr(models::AbstractVector{T},
data::AbstractMatrix{<:Number},
logAge::AbstractVector{<:Number},
metallicities::AbstractVector{<:Number},
relweights::AbstractVector{<:Number};
relweightsmin::Number=0,
x0=construct_x0_mdf(logAge, convert(S,13.7)),
kws...) where {S <: Number, T <: AbstractMatrix{S}}
fixed_amr(models::AbstractMatrix{S},
data::AbstractVector{<:Number},
logAge::AbstractVector{<:Number},
metallicities::AbstractVector{<:Number},
relweights::AbstractVector{<:Number};
relweightsmin::Number=0,
x0=construct_x0_mdf(logAge, convert(S,13.7)),
kws...) where S <: Number
Method that fits a linear combination of the provided Hess diagrams models
to the observed Hess diagram data
, under an externally-imposed age-metallicity relation (AMR) and/or metallicity distribution function (MDF). As such, a number of coefficients equal to length(unique(logAge))
are returned; that is, only one coefficient is derived per unique entry in logAge
.
The second call signature supports the flattened formats for models
and data
. See the notes for the flattened call signature of StarFormationHistories.composite!
for more details.
Arguments
models::AbstractVector{<:AbstractMatrix{<:Number}}
is a vector of equal-sized matrices that represent the template Hess diagrams for the simple stellar populations that compose the observed Hess diagram.data::AbstractMatrix{<:Number}
is the Hess diagram for the observed data.logAge::AbstractVector{<:Number}
is the vector containing the effective ages of the stellar populations used to create the templates inmodels
, in units oflog10(age [yr])
. For example, if a population has an age of 1 Myr, its entry inlogAge
should belog10(10^6) = 6.0
.metallicities::AbstractVector{<:Number}
is the vector containing the effective metallicities of the stellar populations used to create the templates inmodels
. This is most commonly a logarithmic abundance like [M/H] or [Fe/H], but you could use a linear abundance like the metal mass fraction Z if you wanted to. There are some notes on the Wikipedia that might be useful.relweights::AbstractVector{<:Number}
is a vector of length equal to that ofmodels
which contains the relative weights to apply to each model Hess diagram resulting from an externally-imposed age-metallicity relation and/or metallicity distribution function. Additional details on how to create these weights is provided in the notes below and in the online documentation.
Keyword Arguments
relweightsmin
truncates the input list ofmodels
based on the providedrelweights
, providing a speedup at the cost of precision by removingmodels
that contribute least to the overall composite model. By default, no truncation of the input is performed and all providedmodels
are used in the fit. We recommend this only be increased when fitting performance begins to impact workflow (e.g., when running massive Monte Carlo experiments). SeeStarFormationHistories.truncate_relweights
for implementation details.x0
is the vector of initial guesses for the stellar mass coefficients per unique entry inlogAge
. You should basically always be calculating and passing this keyword argument. We provideStarFormationHistories.construct_x0_mdf
to preparex0
assuming constant star formation rate, which is typically a good initial guess.
Other kws...
are passed to Optim.options
to set things like convergence criteria for the optimization.
Notes
- All metallicity-related weighting of the
models
is assumed to be captured in the providedrelweights
vector, which has the same length as thelogAge
,metallicities
, andmodels
vectors. Each entry inrelweights
is assumed to be a relative weight for the correspondingmodel
. For example, for the model Hess diagrammodels[i]
, with log10(age [yr]) =logAge[i]
and metallicitymetallicities[i]
, the relative weight due to the model's age and metallicityw(logAge[i], metallicities[i])
is assumed to berelweights[i]
. The sum of allrelweights
for each unique entry inlogAge
should be 1; i.e., the following condition should be met:all( sum(relweights[logAge .== la]) ≈ 1 for la in unique(logAge))
. If this is not the case, this function will issue a warning and attempt to renormalizerelweights
by mutating the vector in place. More information on preparation of therelweights
for input to this method is provided in our online documentation. - This function is designed to work best with a "grid" of stellar models, defined by the outer product of
N
unique entries inlogAge
andM
unique entries inmetallicities
. See the examples for more information on usage.