melsm.default: Mixed-Effects Location Scale Model

Description Usage Arguments Value Examples

View source: R/melsm.R

Description

Mixed-Effects Location Scale Model

Usage

1
2
3
4
5
## Default S3 method:
melsm(fixed_location, random_location, fixed_scale,
  random_scale, prior = NULL, mixture = NULL, k = 2,
  rho_test = "muvar", adapt = 1000, chains = 4, iter = 5000,
  thin = 1, data, ...)

Arguments

fixed_location

a formula object for the fixed-effects part of the location sub-model, with the response (on the left) and the terms (on the right) sepearted by ~.

random_location

a formula object for the random effects part of the location sub-model, with the random effect (on the left) and the cluster (on the right) seperated by ~.

fixed_scale

a formula object for the fixed-effects part of the scale sub-model, with the response (on the left) and the terms (on the right) sepearted by ~.

random_scale

a formula object for the random effects part of the location sub-model, with the random effect (on the left) and the cluster (on the right) seperated by ~.

prior

a list specifying non-default prior distribution. Set to NULL for the defaults.

mixture

type of mixture prior distribution for the random effects correlations. Options are mixture = "KM" for Kuo and Mallick (1998) or mixture = SSVS for stochastic search variable section (X). Default is set to NULL, wherein no covariance selection is performed. See notes for futher details.

k

number of mixture components. options are k = 2 or k = 3 for mixture = "SSVS". When mixture = "KM". only two components are allowed.

rho_test

rho_test = "all" tests all of the random effects correlations, whereas rho_test = "muvar" tests the random effects correlations that capture mean–variance relations across the location and scale sub-models.

adapt

adaptive phase. see X.

chains

number of chains.

iter

number of posterior samples for each chain

thin

thinning interval (e.g., with thin = 5 every 5 iteraions are saved)

data

a data frame containing the variables named in fixed_location, random_location, fixed_scale, and random_scale

...

currently ignored

Value

object of class melsm

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
dat <- nlme::Orthodont
fit <- melsm(fixed_location = distance ~  age,
            random_location = ~ age | Subject,
            fixed_scale = sigma ~  1, k = 3,
            random_scale = ~ 1 | Subject,
            adapt = 5000,
            iter = 10000,
            rho_test = "all",
            mixture = "SSVS",
            data = dat)

## End(Not run)

donaldRwilliams/hypMuVar documentation built on Jan. 10, 2020, 9:45 a.m.