Description Usage Arguments Details Value Author(s) See Also Examples
Given a vector of data and a design matrix, describing how these data are thought to relate to some predictors in a linear model, the posterior for the parameters of this linear model is found, using a flat prior.
1 | linearmodel(data, design)
|
data |
A vector with data values. |
design |
A design matrix. The number of rows must be equal to the length of the data vector. The number of columns corresponds to the number of explanatory variables. |
If y_i is the i'th data value and β_j is the j'th unknown parameter, and if x_{ij} is the value in the i'th row and j'th column of the design matrix, then one assumes that y_i is normally distributed with exptectation
x_{i1}β_1 + x_{i2}β_2 + … + x_{ik}β_k
and logged standard deviation λ. The computed probability distribution is then the posterior for the joint distribution of
(β_1,β_2,…,β_k,λ)
.
If k is the number of columns in the design matrix and if k>1, then the output is a multivariate Normal-ExpGamma distribution representing the posterior for the corresponding k values and the logged scale parameter in the linear model. If k=1, the output is a Normal-ExpGamma distribution representing the posterior.
Petter Mostad <mostad@chalmers.se>
fittedvalues
, leastsquares
,
linearpredict
1 2 3 4 5 6 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.