[R] Weighted Optimization
j.scally at student.qut.edu.au
Thu Jan 13 07:50:13 CET 2011
I am trying to code an R script which gives me the time varying parameters of the NIG and GH distributions. Further, becasue I think these these time varying parameters should be more responsive to more recent observations, I would like to include a weighted likelihood estimation proceedure where the observations have an exponentially decaying weighting rather than the equal weighting implied by a standard MLE approach.
The optimization function which leads to my parameter estimates is given by;
gh.fit = try(optim(vega, negllh,hessian = se,pdf = gh.pdf,
tmp.data = data, transf = transform, const.pars = vars[!opt.pars],
silent = silent, par.names = names(vars), ...))
param.est = gh.fit$par
In the above, vega are the parameters to estimate and pdf is the GH pdf. This seems to work well for the case where observations are equally weighted. However, I'm stuck on how to include a weighted vector (w_i) to turn this problem into a weighted ML optimization.
Would you please be able to suggest a function or change in code which may allow me to do this?
Thank you in advance for your time.
More information about the R-help