Learn R Programming

hesim (version 0.2.0)

params_mean: Parameters of a mean model

Description

Create a list containing the parameters of a mean model.

Usage

params_mean(mu, sigma = NULL)

Arguments

mu

Matrix of samples from the posterior distribution of the mean. Columns denote random samples and rows denote means for different observations.

sigma

A vector of samples of the standard deviation.

Value

An object of class "params_mean", which is a list containing mu, sigma, and n_samples. n_samples is equal to the number of columns in mu.

Details

The mean model is given by, $$y_j = \mu_j + \epsilon,$$ where \(\mu_j\) is the mean value for observation \(j\). Predicted means are consequently given by \(\hat{\mu}_j\), which is an estimate of \(\mu_j\) from the available data. Random samples are obtained by sampling the error term from a normal distribution, \(\epsilon \sim N(0, \hat{\sigma}^2)\).

Examples

Run this code
# NOT RUN {
params <- params_mean(mu = matrix(seq(1, 4), nrow = 2), 
                      sigma = c(0, 0))
print(params)

# }

Run the code above in your browser using DataLab