hello
I couldn't find previous posts to answer this, but please point me to any.
I am trying to understand bsts, starting with no regressors
Here is code which appears to mimic bsts, producing graphs similar to the
model plot, but gives a rather different posterior distribution for the
is probably a better bet in the latter case.
best,
Simom
ps. Note that the chi squared approximation for the *difference* in
deviance between two nested models does not suffer from this problem.
On 04/02/14 09:25, Greg Dropkin wrote:
mgcv: distribution of dev
hi
I can't tell
' was you as well! It's possible that moving to a Pearson
estimator of the scale will solve that problem too.
Thanks for this... very helpful.
best,
Simon
On 05/02/14 12:56, Greg Dropkin wrote:
thanks Simon
also, it appears at least with ML that the default scale estimate with
quasipoisson
was puzzled that the default
estimate used dev instead.
thanks
Greg
On 05/02/2014 12:56, Greg Dropkin wrote:
thanks Simon
also, it appears at least with ML that the default scale estimate with
quasipoisson (i.e. using dev) is the scale which minimises the ML value
of
the fitted model. So
mgcv: distribution of dev
hi
I can't tell if this is a simple error.
I'm puzzled by the distribution of dev when fitting a gam to Poisson
generated data.
I expected dev to be approximately chi-squared on residual d.f., i.e.
about 1000 in each case below.
In particular, the low values in the 3rd
just to clarify how I see the error, it was the mis-definition of the
penalty term in the function dv. The following code corrects this error.
What is actually being minimised at this step is the penalised deviance
conditional on the smoothing parameter. A second issue is that the optim
default
please ignore this, I see the error.
greg
hi
probably a silly mistake, but I expected gam to minimise the penalised
deviance.
thanks
greg
set.seed(1)
library(mgcv)
x-runif(100)
lp-exp(-2*x)*sin(8*x)
y-rpois(100,exp(lp))
plot(x,y)
m1-gam(y~s(x),poisson)
hi
probably a silly mistake, but I expected gam to minimise the penalised
deviance.
thanks
greg
set.seed(1)
library(mgcv)
x-runif(100)
lp-exp(-2*x)*sin(8*x)
y-rpois(100,exp(lp))
plot(x,y)
m1-gam(y~s(x),poisson)
points(x,exp(lp),pch=16,col=green3)
points(x,fitted(m1),pch=16,cex=0.5,col=blue)
hi
I'm trying to understand (a little) the code behind summary.gam, and have
the Biometrika article referred to in the Help. But am stuck early on.
In the code, starting at line 167:
if (est.disp)
rdf - residual.df
else rdf - -1
res - testStat(p, Xt, V, df[i], type = p.type,
res.df = rdf)
or the scale returned by gam?
thanks
Greg Dropkin
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self
(0.5,1.5))$min-phix
Dpq/(2*phix) + F3q + Mp/2*log(2*pi*phix)
m3$gcv
#but what is phix - not the Pearson estimate or the scale returned by gam?
thanks
Greg Dropkin
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do
hi Simon
this follows on from the example where gcv increased unexpectedly with
increasing basis dimension. I'm now looking at t2 tensor splines with
REML, and find that the REML score can increase when adding a new
predictor. Again, this seems odd.
thanks
Greg
library(mgcv)
set.seed(0)
thanks Simon
I'll upgrade R to try t2. The data I'm actually analysing requires scaled
Poisson so I don't think REML is an option.
thanks
Greg
On 14/02/12 11:22 Simon Wood wrote:
That's interesting. Playing with the example, it doesn't seem to be a
local minimum. I think that this happens
hi
Using a ts or tprs basis, I expected gcv to decrease when increasing the
basis dimension, as I thought this would minimise gcv over a larger
subspace. But gcv increased. Here's an example. thanks for any comments.
greg
#simulate some data
set.seed(0)
x1-runif(500)
x2-rnorm(500)
re: Cubic splines in package mgcv
I don't have access to Gu (2002) but clearly the function R(x,z) defined
on p126 of Simon Wood's book is piecewise quartic, not piecewise cubic.
Like Kunio Takezawa (below) I was puzzled by the word cubic on p126.
As Simon Wood writes, this basis is not
hadn't realised the answer would be in the source code!
anyway, this appears to work. The only difference is in the last section.
greg
--
library(mgcv)
#simulate some data
x1-runif(500)
x2-rnorm(500)
x3-rpois(500,3)
d-runif(500)
t-runif(500,20,50)
linp--6.5+x1+2*x2-x3+2*exp(-2*d)*sin(2*pi*d)
hello
I'm learning mgcv and would like to obtain numerical output corresponding
to plot.gam.
I can do so when seWithMean=FALSE (the default)
but only approximately when seWithMean=TRUE.
Can anyone show how to obtain the exact values?
Alternatively, can you clarify the explanation in the manual
re [R] matrix^(-1/2)
re the discussion in November on this thread. I don't know about expm but
the problem must be equivalent to solve(B^(1/2)) and a solution will exist
iff B is invertible and has a square root A with A%*%A = B. For 2x2
matrices necessary and sufficient conditions for B to have
Greg Dropkin
gr...@gn.apc.org
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
]
On Wed, 23 Sep 2009, Greg Dropkin wrote:
hi
sorry if this has been discussed before, but I'm wondering why the scaled
Schoenfeld residuals do not follow the defining formula for obtaining them
from the ordinary Schoenfeld residuals, but are instead offset by the
estimated parameter values
re post from
bkelcey at umich.edu bkelcey at umich.edu
Wed Feb 27 15:09:48 CET 2008
If the response y is given as the proportion of successes out of n trials,
and y, n, p, x, and z are vectors of length M, and the model is logit(p) =
b0 + b1*x + b2*z then for the score test for the null
21 matches
Mail list logo