Description Public fields Methods Examples
This model class assumes a normally distributed response variable with one linear predictor for the location (i.e. the mean) and one for the scale (i.e. the standard deviation). The linear predictors for the location and the scale are called Xβ and Zγ respectively. The scale uses a log link.
beta
A numeric vector with the beta
parameters.
gamma
A numeric vector with the gamma
parameters.
new()
LocationScaleRegression$new( location, scale = ~1, data = environment(location), ... )
location
A two-sided formula with the response variable on the LHS and the predictor for the location (i.e. the mean) on the RHS.
scale
A one-sided formula with the predictor for the scale (i.e. the standard deviation) on the RHS.
data
A data frame (or list or environment) in which to evaluate
the location
and scale
formulas.
...
Passed on to stats::model.matrix()
.
Create a new LocationScaleRegression
object.
A LocationScaleRegression
object.
y <- rnorm(30) LocationScaleRegression$new(y ~ 1)
loglik()
LocationScaleRegression$loglik()
Returns the log-likelihood of a LocationScaleRegression
object
at the current parameter values.
A single number.
y <- rnorm(30) model <- LocationScaleRegression$new(y ~ 1) model$loglik()
grad_beta()
LocationScaleRegression$grad_beta()
Returns the gradient of the log-likelihood of a
LocationScaleRegression
object with respect to β
at the current parameter values.
A numeric vector.
y <- rnorm(30) model <- LocationScaleRegression$new(y ~ 1) model$grad_beta()
grad_gamma()
LocationScaleRegression$grad_gamma()
Returns the gradient of the log-likelihood of a
LocationScaleRegression
object with respect to γ
at the current parameter values.
A numeric vector.
y <- rnorm(30) model <- LocationScaleRegression$new(y ~ 1) model$grad_gamma()
clone()
The objects of this class are cloneable with this method.
LocationScaleRegression$clone(deep = FALSE)
deep
Whether to make a deep clone.
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 26 27 28 29 30 31 32 | ## ------------------------------------------------
## Method `LocationScaleRegression$new`
## ------------------------------------------------
y <- rnorm(30)
LocationScaleRegression$new(y ~ 1)
## ------------------------------------------------
## Method `LocationScaleRegression$loglik`
## ------------------------------------------------
y <- rnorm(30)
model <- LocationScaleRegression$new(y ~ 1)
model$loglik()
## ------------------------------------------------
## Method `LocationScaleRegression$grad_beta`
## ------------------------------------------------
y <- rnorm(30)
model <- LocationScaleRegression$new(y ~ 1)
model$grad_beta()
## ------------------------------------------------
## Method `LocationScaleRegression$grad_gamma`
## ------------------------------------------------
y <- rnorm(30)
model <- LocationScaleRegression$new(y ~ 1)
model$grad_gamma()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.