David L. Miller (University of Rhode Island)
RUWPA Research Talk
29 July 2013



|
|
|
Fitting a simple (and not very good!) model:
ltdu.tw <- dsm(N ~ s(x, y, k = 100), ddf.obj = NULL,
seg.dat1, obs.dat1, strip.width = (107 * 2)/1000,
select = TRUE, method = "REML", family = Tweedie(p = 1.5))
dsmdsm.cor(ltdu.tw, max.lag = 18, Transect.Label = "tr.s.id",
Segment.Label = "segment", ylim = c(-0.1, 1), resid.type = "scaled.pearson")

dsms(x,y) terms)s(y, by=transect))gamm
dsm: engine="gamm" and correlation=...\[ N_i = \color{green}{\mathbf{X_i\beta}} + \color{blue}{\sum_k f_k(\mathbf{x}_i)} + \color{red}{\mathbf{Z_ib}} + \color{purple}{e_i} \]
correlation=corAR1(form=~segment|transect|survey)correlation=corARMA(form=~segment|transect|survey,p=p)dsmltdu.tw.cor <- dsm(N~ s(x,y,k=100),
ddf.obj=NULL, seg.dat1, obs.dat1,
strip.width=(107*2)/1000,engine="gamm",
correlation=corAR1(form=~segment|tr.s.id),
family=Tweedie(p=1.5))
dsm.cor)intervals)intervals(ltdu.tw.cor$lme)
## Approximate 95% confidence intervals
##
## Fixed effects:
## lower est. upper
## X(Intercept) 4.0253 4.1231 4.221
## Xs(x,y)Fx1 -0.8451 0.2259 1.297
## Xs(x,y)Fx2 -0.6111 0.5179 1.647
## attr(,"label")
## [1] "Fixed effects:"
##
## Random Effects:
## Level: g
## lower est. upper
## sd(Xr - 1) 1375 2010 2932
##
## Correlation structure:
## lower est. upper
## Phi1 0.1103 0.1537 0.1964
## attr(,"label")
## [1] "Correlation structure:"
##
## Within-group standard error:
## lower est. upper
## 4.777 4.925 5.078
ltdu.tw.cor2 <- dsm(N~ s(x,y,k=100),
ddf.obj=NULL, seg.dat1, obs.dat1,
strip.width=(107*2)/1000,engine="gamm",
correlation=corARMA(p=2,form=~segment|tr.s.id),
family=Tweedie(p=1.5))
dsm.cor
intervals(ltdu.tw.cor$lme)
## Approximate 95% confidence intervals
##
## Fixed effects:
## lower est. upper
## X(Intercept) 4.0189 4.1296 4.240
## Xs(x,y)Fx1 -0.7741 0.2647 1.303
## Xs(x,y)Fx2 -0.5512 0.5989 1.749
## attr(,"label")
## [1] "Fixed effects:"
##
## Random Effects:
## Level: g
## lower est. upper
## sd(Xr - 1) 1368 1991 2893
##
## Correlation structure:
## lower est. upper
## Phi1 0.10547 0.13736 0.149715
## Phi2 0.02723 0.06401 0.089353
## Phi3 0.06255 0.10842 0.147595
## Phi4 -0.01678 0.02502 0.063891
## Phi5 -0.09576 -0.04454 0.006907
## attr(,"label")
## [1] "Correlation structure:"
##
## Within-group standard error:
## lower est. upper
## 4.730 4.881 5.038
mgcv terms)select, paraPen and other “cool stuff”select, select response distn)dsm: github.com/dill/dsm