lmvar_no_fit: Create an 'lmvar'-like object without a model fit

Description Usage Arguments Details Value Examples

Description

Creates an 'lmvar'-like object without carrying out a model fit. This object is a 'lmvar' object from which all members have been left out that are the result of the fit. Such an object can be used in functions which typically use an 'lmvar' object as input but do not need the fit results. Since no fit is performed, lmvar_no_fit is convenient when the fit is time-consuming or, e.g., does not converge.

Usage

1
2
3
lmvar_no_fit(y, X_mu = NULL, X_sigma = NULL, intercept_mu = TRUE,
  intercept_sigma = TRUE, sigma_min = 0, slvr_options = list(method =
  "NR"), control = list(), ...)

Arguments

y

Vector of observations

X_mu

Model matrix for the expected values μ

X_sigma

Model matrix for the logarithms of the standard deviations σ

intercept_mu

see the function lmvar

intercept_sigma

see the function lmvar.

sigma_min

see the function lmvar.

slvr_options

see the function lmvar

control

see the function lmvar.

...

Additional arguments, not used in the current implementation

Details

See lmvar for the requirements and a further explanation of all the arguments.

The class 'lmvar' is an extension of the class 'lmvar_no_fit'. This means that each object which is of class 'lmvar', is of class 'lmvar_no_fit' as well. Wherever an object of class 'lmvar_no_fit' is required, an object of class 'lmvar' can be used as well.

Accessor and utility functions for a 'lmvar_no_fit' object are: nobs.lmvar_no_fit, alias.lmvar_no_fit and dfree

The function lmvar_no_fit is especially useful in combination with fwbw.lmvar_no_fit. In case a model with many degrees of freedom does not converge with lmvar, one can create an 'lmvar_no_fit' object. This is used as input for fwbw with the argument fw = TRUE. The fwbw algorithm will try to select an optimal subset of all degrees of freedom, starting with the smallest subset possible.

Although lmvar_no_fit does not carry out a model fit, it will do the following:

Value

An object of class 'lmvar_no_fit', which is a list. The list-members are the same as for an object of call 'lmvar', but with members that are the result of the model fit left out.

Users are discouraged to access list-members directly. Instead, list-members are to be accessed with the various accessor and utility functions in the package. Exceptions are the following list members for which no accessor functions exist:

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# As example we sue the dataset 'iris' from the library 'datasets'
library(datasets)

# Create the model matrix for both the expected values and the standard deviations
X = model.matrix( ~ Species - 1, data = iris)

# Take as response variabe the variable Sepal.length
y = iris$Sepal.Length

# Construct a 'lmvar_no_fit' object
no_fit = lmvar_no_fit( y, X, X)

# The following functions all work on such an object
nobs(no_fit)
dfree(no_fit)
alias(no_fit)

# You can also supply 'lmvar' arguments
no_fit = lmvar_no_fit( y, X[,-1], X[,-1], intercept_mu = FALSE, intercept_sigma = FALSE)
dfree(no_fit)

# Some (most) arguments have no effect except that they are stored in the 'lmvar_no_fit'
# object
no_fit = lmvar_no_fit( y, X, X, control = list( slvr_log = TRUE, remove_df_sigma = TRUE))
no_fit$control

lmvar documentation built on May 16, 2019, 5:06 p.m.