View source: R/bestBraidModel.R
findBestBraid | R Documentation |
Picks the most parsimonious BRAID fit from a standard set of commonly used variants
findBestBraid(
formula,
data,
defaults,
extended = FALSE,
weights = NULL,
start = NULL,
direction = 0,
lower = NULL,
upper = NULL,
prior = "moderate",
getCIs = TRUE,
useBIC = TRUE
)
## S3 method for class 'formula'
findBestBraid(
formula,
data,
defaults,
extended = FALSE,
weights = NULL,
start = NULL,
direction = 0,
lower = NULL,
upper = NULL,
prior = "moderate",
getCIs = TRUE,
useBIC = TRUE
)
## Default S3 method:
findBestBraid(
formula,
data,
defaults,
extended = FALSE,
weights = NULL,
start = NULL,
direction = 0,
lower = NULL,
upper = NULL,
prior = "moderate",
getCIs = TRUE,
useBIC = TRUE
)
formula |
Either an object of class |
data |
If |
defaults |
Default minimal and maximal effect values used to fix effect parameters during model selection. |
extended |
Should models with an additional freely varying Ef parameter
be included. If |
weights |
A vector of weights (between 0 and 1) the same length as
the data which determines the weight with which each measurement
will impact the the sum of squared errors. Weights will be multiplied by
errors before squaring. If |
start |
A BRAID parameter vector specifying the first guess where the
non-linear optimization should begin. May be a length 7, 8, or 9 vector,
though a full length vector is always preferable. If |
direction |
Determines the possible directionality of the BRAID model. If 0 (the default) no additional constraints are placed on the parameters. If greater than 0, the fitting will require that the maximal effects are all greater than or equal to the minimal effect. If less than 0, the fitting will require that all maximal effect is less than or equal to the minimal effect. |
lower |
A numeric vector of lower bounds on the fitted parameter values.
May be the same length as the number of fitted parameters, or a full,
length-9 vector. Missing or unspecified lower bounds may be included as |
upper |
A numeric vector of upper bounds on the fitted parameter values.
Used in the same way as |
prior |
A character string specifying the desired Bayesian prior term
for kappa, or an object of class |
getCIs |
Should bootstrapped confidence intervals be estimated and
added to the BRAID fit object. Default value is |
useBIC |
If |
When fitting real experimental data, it is not uncommon for a measured surface to contain such incomplete or noisy data that many of the parameters are highly underdetermined. Unfortunately, in such cases, non-linear optimization can often resort to wildly implausible values to explain small variations in the data. To address this, this function runs multiple BRAID response fits, including some in which the minimal and maximal effect parameters are constrained to reasonable default values, to test if additional free parameters offer sufficiently improved fits to be included.
When the parameter extended
is set to FALSE
, the function runs ten BRAID
scenarios: five in which the minimal effect parameter is allowed to vary
freely, and five in which it is fixed at the first default value. The five
tested models in each set represent five distinct configurations of the
maximal effect parameters:
Both maximal effects are fixed the same value (the second default)
Maximal effect EfA (and when it is larger, Ef) varies freely, but effect EfB is fixed at the second default
Maximal effect EfB (and when it is larger, Ef) varies freely, but effect EfA is fixed at the second default
The maximal effect Ef varies freely, and both EfA and EfB are constrained to be equal to it
The maximal effects EfA and EfB both vary freely, and Ef is constrained to be equal to the larger of the two
When extended
is TRUE
, two additional models (one with E0 fixed and one
in which it varies freely) are included, in which all three maximal effect
parameters are allowed to vary freely and independently.
An object of class braidrm
. It will contain all the fields of a
standard braidrm
object, and also an additional field, allfits
containing a summary of the best fit model from each of the 10 or 12
candidate models tested.
Akaike, Hirotugu. 1974. “A New Look at the Statistical Model Identification.” IEEE Transactions on Automatic Control 19 (6): 716–23.
Schwarz, Gideon. 1978. “Estimating the Dimension of a Model.” The Annals of Statistics, 461–64.
bfit1 <- findBestBraid(measure ~ concA + concB, additiveExample,
defaults=c(0,1))
summary(bfit1)
length(bfit1$allfits)
bfit2 <- findBestBraid(measure ~ concA + concB, additiveExample,
defaults=c(0,2), extended=TRUE, getCIs = FALSE)
summary(bfit2)
length(bfit2$allfits)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.