lmls: Gaussian location-scale regression

Description Usage Arguments Value Examples

View source: R/lmls.R

Description

The location-scale regression model assumes a normally distributed response variable with one linear predictor for the mean (= the location) and one for the standard deviation (= the scale). The standard deviation is mapped to the linear predictor through a log link.

This function sets up the model object and estimates it with maximum likelihood.

Usage

1
2
3
4
5
6
7
8
lmls(
  location,
  scale = ~1,
  data = environment(location),
  light = TRUE,
  maxit = 100,
  reltol = sqrt(.Machine$double.eps)
)

Arguments

location

A two-sided formula with the response variable on the LHS and the predictor for the mean on the RHS.

scale

A one-sided formula with the predictor for the standard deviation on the RHS.

data

A data frame (or list or environment) in which to evaluate the location and scale formulas.

light

If TRUE, the design matrices are removed from the estimated model to save some memory.

maxit

The maximum number of iterations of the Fisher scoring algorithm.

reltol

The relative convergence tolerance of the Fisher scoring algorithm.

Value

A fitted linear model for location and scale as an lmls S3 object. The object has at least the following entries:

Examples

1
2
3
4
5
library(lmls)
m <- lmls(y ~ poly(x, 2), ~ x, data = abdom)
summary(m)
plot(m)
qqnorm(m)

hriebl/lmls documentation built on Jan. 18, 2022, 2:41 p.m.