Re: [R] MRF smoothers in MGCV - specifying neighbours

2014-05-08 Thread Mark Payne
data(columb.polys) ## district shapes list > xt <- list(polys=columb.polys) ## neighbourhood structure info for MRF > par(mfrow=c(2,2)) > ## First a full rank MRF... > b0 <- gam(crime ~ s(district,bs="mrf",xt=xt),data=columb,method="REML") > >

[R] MRF smoothers in MGCV - specifying neighbours

2014-05-07 Thread Mark Payne
Hi, Does anyone have an example of a Markov Random Field smoother (MRF) in MGCV where they have specified the neighbourhood directly, rather than supplying polygons? Does anyone understand how the rules should be? Based on the columb example, I have setup my data set and neighbourhood like so: >

[R] Negative binomial parameterisation in mgcv

2013-11-13 Thread Mark Payne
Dear R-help, The negative binomial distribution has several different parameterisations, but I can't seem to figure out what the exact one used in mgcv's negbin family is? negbin() requires a theta argument, but its not clear anywhere in the documentation (that I can find), how this parameter shou

[R] Setting up 3D tensor product interactions in mgcv

2013-08-23 Thread Mark Payne
Hi, I am trying to fit a smoothing model where there are three dimensions over which I can smooth (x,y,z). I expect interactions between some, or all, of these terms, and so I have set up my model as mdl <- gam(PA ~ s(x) + s(y) + s(z) + te(x,y) + te(x,z) + te(y,z) + te(x,y,z),...) I have recentl

[R] Named list of data.frames to data.frame with names

2012-10-30 Thread Mark Payne
Hi, I very frequently end up in a situation where I have a named list of data.frames that I wish to combine. e.g. l <- list(A=data.frame(x=rnorm(5), y=rnorm(5)), B=data.frame(x=rnorm(3),y=rnorm(3)), C=data.frame(x=rnorm(4),y=rnorm(4)), D=data.frame(x=rnorm(7),y=rnorm

[R] Seasonal smoothing of data with large gaps (mgcv)

2012-10-26 Thread Mark Payne
Hi, I have a set of measurements that are made on a daily basis over many years. I would like to produce a *non-parametric* smooth of these data to estimate the seasonal cycle - to achieve this, I have been using the cyclic cubic splines from the mgcv package. This works superbly in most situation

Re: [R] scatter.smooth() line colour

2012-06-22 Thread Mark Payne
.. argument, but these are not >> passed to the plotting function that actually plots the smoother - >> only to the function that plots the points. Could I please therefore >> request that an argument be added to this function to give easier >> control over line properties? e.g

Re: [R] Manually modifying an hclust dendrogram to remove singletons

2012-05-25 Thread Mark Payne
lution to the problem - I'll see if I can get something out of it. However,  this discussion has started me wondering how I can use the spatial proximity of the pixels in the analysis - does anyone have any insights? Can the WGCNA approach be used in s