wiki:OfficialTolArchiveNetworkGrzLinModel

Version 20 (modified by Víctor de Buen Remiro, 16 years ago) ( diff )

--

Package GrzLinModel

Max-likelihood and bayesian estimation of ​generalized linear models with scalar prior information and constraining linear inequations.

Weighted Generalized Regresions

Abstract class GrzLinModel::@WgtReg is the base to inherit weighted generalized linear regressions as poisson, binomial, normal or any other, given just the scalar link function LatexEquation( g ) and the density function LatexEquation( f ).

In a weighted regression each row of input data has a distinct weight in the likelihood function. For example, it can be very usefull to handle with data extrated from an stratified sample.

Let be

Then we purpose that the average of the output is the inverse of the link function applyied to the linear predictor

LatexEquation( E\left[y\right]=\mu=g^{-1}\left(X\beta\right) )

The density function becomes as a real valuated function of at least two parameters

LatexEquation( f\left(y;\mu\right) )

For each row LatexEquation( i=1 \dots n) we will know the output LatexEquation( y_i ) and the average

LatexEquation( \mu_i=g^{-1}\left(\eta_i\right)=g^{-1}\left(x_i\beta\right) )

Each particular distribution may have its own additional parameters which will be treated as a different Gibbs block and should implement next methods in order to be able of build both bayesian and max-likelihood estimations

The likelihood function of the weigthed regression is then

LatexEquation( lk\left(\beta\right)=\overset{m}{\underset{i}{\prod}}f_{i}^{w_{i}}\:\wedge f_{i}=f\left(y_{i};\mu_{i}\right)\:\forall i=1\ldots m )

and its logarithm

LatexEquation( L\left(\beta\right)=\ln\left(lk\left(\beta\right)\right)=\overset{m}{\underset{i}{\sum}}w_{i}f_{i} )

The gradient of the logarithm of the likelihood function will be

LatexEquation( \frac{\partial L\left(\beta\right)}{\partial\beta_{j}}=\frac{\partial L\left(\beta\right)}{\partial\eta_{i}}\frac{\partial\eta_{i}}{\partial\beta_{j}}=\overset{m}{\underset{i}{\sum}}w_{i}\frac{\partial\ln f_{i}}{\partial\eta_{i}}x_{ij} )

and the hessian is

LatexEquation( \frac{\partial L\left(\beta\right)}{\partial\beta_{i}\partial\beta_{j}}=\underset{k}{\sum}w_{k}\frac{\partial^{2}\ln f_{k}}{\partial\eta_{k}^{2}}x_{ik}x_{jk} )

This class also implements these common features

  • scalar prior information of type normal or uniform, truncated or not in both cases, and
  • linear constraining inequations over linear parameters

    LatexEquation( A \beta \ge a )

Weighted Normal Regresion

Is implemented in GrzLinModel::@WgtNormal There is an example of use in test_0001/test.tol

In this case we have

Weighted Poisson Regresion

It will be implemented in GrzLinModel::@WgtPoisson but is not available yet. There is an example of use in test_0002/test.tol

In this case we have

Weighted Qualitative Regresion

For boolean and qualitative response outputs like logit or probit there is an specialization on package QltvRespModel

Note: See TracWiki for help on using the wiki.