ParamRegrModel | R Documentation |
This is the abstract base class for parametric regression model objects like NormalGLM.
Parametric regression models are built around the following key tasks:
A method fit()
to fit the model to given data, i.e. compute the MLE
for the model parameters
Methods f_yx()
, F_yx()
and mean_yx()
to evaluate the conditional
density, distribution and regression function
A method sample_yx()
to generate a random sample of response variables
following the model given a vector of covariates
set_params()
Set the value of the model parameters used as default for the class functions.
ParamRegrModel$set_params(params)
params
model parameters to use as default
The modified object (self
), allowing for method chaining.
get_params()
Returns the value of the model parameters used as default for the class functions.
ParamRegrModel$get_params()
model parameters used as default
fit()
Calculates the maximum likelihood estimator for the model parameters based on given data.
ParamRegrModel$fit(data, params_init = private$params, loglik = loglik_xy)
data
list containing the data to fit the model to
params_init
initial value of the model parameters to use for the optimization (defaults to the fitted parameter values)
loglik
function(data, model, params)
defaults to loglik_xy()
MLE of the model parameters for the given data, same shape as
params_init
f_yx()
Evaluates the conditional density function.
ParamRegrModel$f_yx(t, x, params = private$params)
t
value(s) at which the conditional density shall be evaluated
x
vector of covariates
params
model parameters to use, defaults to the fitted parameter values
value(s) of the conditional density function, same shape as t
F_yx()
Evaluates the conditional distribution function.
ParamRegrModel$F_yx(t, x, params = private$params)
t
value(s) at which the conditional distribution shall be evaluated
x
vector of covariates
params
model parameters to use, defaults to the fitted parameter values
value(s) of the conditional distribution function, same shape as
t
F1_yx()
Evaluates the conditional quantile function.
ParamRegrModel$F1_yx(t, x, params = private$params)
t
value(s) at which the conditional quantile function shall be evaluated
x
vector of covariates
params
model parameters to use, defaults to the fitted parameter values
value(s) of the conditional quantile function, same shape as
t
sample_yx()
Generates a new sample of response variables with the same conditional distribution.
ParamRegrModel$sample_yx(x, params = private$params)
x
vector of covariates
params
model parameters to use, defaults to the fitted parameter values
vector of sampled response variables, same length as x
mean_yx()
Evaluates the regression function or in other terms the expected value of Y given X=x.
ParamRegrModel$mean_yx(x, params = private$params)
x
vector of covariates
params
model parameters to use, defaults to the fitted parameter values
value of the regression function
clone()
The objects of this class are cloneable with this method.
ParamRegrModel$clone(deep = FALSE)
deep
Whether to make a deep clone.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.