\name{getDoublevertDefault}
\alias{getDoublevertDefault}
\title{Retrieve default double-vertical-bar-expansion method}
\description{
  Retrieve information about whether random effect terms specified with
  double bars (\code{||}) should be split semantically into separate,
  intercept-free terms, or encoded with a \code{diag()} special
}
\usage{
getDoublevertDefault()
}
\value{
	a (1-element) character vector suitable for \code{reformulas::findbars_x}
	specifying whether to expand random-effects terms containing double bars (\code{||})
	as a set of independent random effects terms ("split": i.e., \code{(1+a+b||f)} becomes
	\code{(1|f) + (0+a|f) + (0+b|f)}) or whether to specify that the covariance matrix is
	diagonal ("diag_special": i.e., \code{diag(1+a+b|f)}).
}
\details{
    To set the global behaviour retrieved by \code{getDoublevertDefault()}
    to "diag_special", run \code{options(lme4.doublevert.default = "diag_special")}

    The default value of "split" is backward compatible with the behaviour of \code{lme4} <
    2.0; double bars do \emph{not} work as typically expected with factors
    as varying terms. 
    That is, if \code{g} is a factor
    then \code{(1 + g||f)} will expand (with method "split") to \code{(1|f) + (0 + g|f)}; the
    second term will \emph{not} produce a covariance matrix where the contrasts generated by
    the factor are independent.

    "diag_special" is probably the generally preferred option; by
    transforming \code{(1+a+b||f)}
    into \code{diag(1+a+b|f)}, it ensures that variation across groups
    in the contrasts coded by the factor will be independent. This matches
    the results of specifying a double-bar term in \code{afex::mixed()},
    or \code{glmmTMB}.

    Note that if \code{f} is a factor, even with "diag_special" set,
    models containing \code{(0+f||g)} vs. \code{(f||g)} will give
    different results. \code{(0+f||g)} creates a set of dummy variables
    that are indicator variables for each level of the factor, so the
    random effect term will describe variation in the intercept for each
    level of the factor. With default treatment contrasts set,
    \code{(f||g)} (equivalent to \code{(1+f||g)}
    because R automatically adds the intercept term) will estimate
    variation first in the intercept in the baseline level of the
    factor, then in the differences between observations in the baseline and successive
    levels of the factor (see \code{\link{contr.treatment}}).
    
  }
  

  


