how to add offset for Poisson-GPR using GPML package? I'm using the popular GPML package in MATLAB for both Poisson and NB regression. Is there any way to add offset as easily as glmfit()?
Specifically, assume there are N obesrvations, I want $\log(\mu)=\text{offset}+f(x)$, where $f(x)\sim GP$ and $\text{offset}\in\mathbb{R}^N$.
Ortherwise, I guess I have to modify the likelihood function manually, which would be tedious...
EDIT
With the help of the package author, Hannes Nickisch, I finnaly find an easy way to do it. Moreover, modifying the likelihood function is not very tedious. See my answers below.

method 2: use meanDiscrete
First, expand the predictor as x_expand = [(1:N)' x];, then use the 1st column for mean function snf 2nd column for covariance function...
maskMean = [true,false];
maskCov = [false,true];
m_raw = {@meanSum,{@meanConst,{'meanDiscrete',N}}};
c_raw = {@covSEiso};

m = {'meanMask',maskMean,m_raw};
c = {'covMask', {maskCov, c_raw{:}}};

To hold the offset fixed, we just need to clampsed prior on offset
prior.multi{1} = {@priorClampedMulti,struct('mean',2:(N+1))};
hyp1 = struct('mean', [0;offset], 'cov', [log(1);log(1)]);

options = struct('MaxIter',1000, 'Display', 'on');
im = {@infPrior,@infLaplace,prior};
hyp2 =  minimize_minfunc(hyp1,@gp,...
    options,im,m,c,likfunc,x_expand,y);

method 2: modify the likelihood function
Take the likPoisson.m for example. In their code, the mu is kind of confusing, it is actually the linear predictor, but not $E(Y)$. Since the code uses lg = g(mu,link) in line 34, and the special case should be g(mu,'exp') = mu = lg.
Keep this in mind, modify the function with a new input offset, and change all
lg = g(mu, link);
[lg,dlg,d2lg,d3lg] = g(mu,link);

to
lg_tmp = g(mu, link);
[lg_tmp,dlg,d2lg,d3lg] = g(mu,link);
lg = lg_tmp + offset;

