# GLD.lm.full: This function fits a GLD regression linear model and conducts... In GLDreg: Fit GLD Regression Model and GLD Quantile Regression Model to Empirical Data

## Description

The function is an extension of `GLD.lm` and defaults to 1000 simulation runs, coefficients and statistical properties of coefficients can be plotted as part of the output.

## Usage

 ```1 2``` ```GLD.lm.full(formula, data, param, maxit = 20000, fun, method = "Nelder-Mead", range = c(0.01, 0.99), n.simu = 1000, summary.plot = TRUE, init = NULL) ```

## Arguments

 `formula` A symbolic expression of the model to be fitted, similar to the formula argument in `lm`, see `formula` for more information `data` Dataset containing variables of the model `param` Can be "rs", "fmkl" or "fkml" `maxit` Maximum number of iterations for numerical optimisation `fun` If param="fmkl" or "fkml", this can be one of `fun.RMFMKL.ml.m`, `fun.RMFMKL.ml`, for maximum likelihood estimation (*.ml.m is a faster implementation of *.ml) and `fun.RMFMKL.lm` for L moment matching. If param="rs", this can be one of `fun.RPRS.ml.m`, `fun.RPRS.ml`, for maximum likelihood estimation (*.ml.m is a faster implementation of *.ml) and `fun.RPRS.lm` for L moment matching. `method` Defaults to "Nelder-Mead" algorithm, can also be "SANN" but this is a lot slower and may not as good `range` The is the quantile range to plot the QQ plot, defaults to 0.01 and 0.99 to avoid potential problems with extreme values of GLD which might be -Inf or Inf. `n.simu` Number of times to repeat the simulation runs, defaults to 1000. `summary.plot` Whether to plot the coefficients graphically, defaults to TRUE. `init` Choose a different set of initial values to start the optimisation process. This can either be full set of parameters including GLD parameter estimates, or it can just be the coefficient estimates of the regression model.

## Details

This function usually takes some time to run, as it involves refitting the GLD regression model many times, the progress of the simulation is outputted to the R screen, so users can guage the progress of the computation.

## Value

 `[[1]]` Output of `GLD.lm` `[[2]]` A matrix showing the bias adjustment, coefficents of the model, parameters of GLD and whether the result converged at each run `[[3]]` Adjusted simulation result so that the empirical mean of coefficients is the same as the estimated parameters obtained in `GLD.lm`

Steve Su

## References

Su (2015) "Flexible Parametric Quantile Regression Model" Statistics & Computing May 2015, Volume 25, Issue 3, pp 635-650

`GLD.lm`, `GLD.quantreg`, `summaryGraphics.gld.lm`
 ``` 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 33 34 35 36 37 38 39 40 41 42 43 44 45 46``` ```## Dummy example ## Create dataset set.seed(10) x<-rnorm(200,3,2) y<-3*x+rnorm(200) dat<-data.frame(y,x) ## Fit FKML GLD regression with 3 simulations fit<-GLD.lm.full(y~x,data=dat,fun=fun.RMFMKL.ml.m,param="fkml",n.simu=3) ## Not run: ## Extract the Engel dataset library(quantreg) data(engel) ## Fit a full GLD regression engel.fit.full<-GLD.lm.full(foodexp~income,data=engel,param="fmkl", fun=fun.RMFMKL.ml.m) ## Extract the mammals dataset library(MASS) ## Fit a full GLD regression mammals.fit.full<-GLD.lm.full(log(brain)~log(body),data=mammals,param="fmkl", fun=fun.RMFMKL.ml.m) ## Using quantile regression coefficients as starting values library(quantreg) mammals.fit1.full<-GLD.lm.full(log(brain)~log(body),data=mammals,param="fmkl", fun=fun.RMFMKL.ml.m, init=rq(log(brain)~log(body),data=mammals)\$coeff) ## Using the result of mammals.fit.full as initial values mammals.fit2.full<-GLD.lm.full(log(brain)~log(body),data=mammals,param="fmkl", fun=fun.RMFMKL.ml.m, init=mammals.fit1.full[[1]][[3]]) ## End(Not run) ```