Description Usage Arguments Details Examples
Takes a fitted plbpsm
object produced by plbpsm()
and plots the triangulation of
location data points, predicted surface of bivariate smooth function and optionally produces
histogram of residuals for the model.
1 2 3 4 |
x |
a fitted |
residuals |
If |
pages |
(default 0) the number of pages over which to spread the output. For example,
if |
select |
Allows the plot for a single model term to be selected for printing. e.g. if you
just want the plot for the second smooth term set |
xlab |
If supplied then this will be used as the x label for all plots. |
ylab |
If supplied then this will be used as the y label for all plots. |
main |
Used as title for plots if supplied. |
ylim |
If supplied then this pair of numbers are used as the y limits for each plot. |
xlim |
If supplied then this pair of numbers are used as the x limits for each plot. |
n1 |
number of points used in x axis in each plot. |
n2 |
number of points used in y axis in each plot. |
... |
other graphics parameters to pass on to plotting commands. See details for smooth plot specific options. |
Used R package fdaPDE
and plotly
to draw triangulation plot and predicted surfaces. See
plbpsm:::plot.plbpsm.smooth
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | library(MASS)
library(grpreg)
# irregular domain:
library(GgAM)
library(BPST)
data("eg1pop_dat")
eg1_V2=eg1pop_dat[['V2']]
eg1_T2=eg1pop_dat[['T2']]
eg1pop_rho03=eg1pop_dat[['rho03']]
n=1000
Npop=nrow(eg1pop_rho03)
# ind.pop=(1:Npop)[!is.na(eg1pop_rho03[,1])]
ind.pop=(1:Npop)
sam.ind=sort(sample(ind.pop,n,replace=FALSE))
sam=eg1pop_rho03[sam.ind,]
lambda=10^(seq(-2,5,by=1))
data=sam
formula=Y~z1+z2+z3+z4+z5+z6+z7+z8+b(x1,x2,V=eg1_V2,Tr=eg1_T2,d=2,r=1,lambda=lambda)
res=plbpsm(formula=formula,data=as.data.frame(data))
plot(res,residuals=TRUE,n1=80,n2=50)
### GGAM ###
data(dat_poi_ggams)
n=100
Npop=nrow(dat_poi_ggams)
# ind.pop=(1:Npop)[!is.na(eg1pop_poi2[,1])]
ind.pop=(1:Npop)
sam.ind=sort(sample(ind.pop,n,replace=FALSE))
sam=dat_poi_ggams[sam.ind,]
data=sam
formula=y~u(x1)+u(x2)+u(x3)+b(s1,s2,V=eg1_V2,Tr=eg1_T2,d=2,r=1)
res_eg1_poi_add=plbpsm(formula=formula,data=as.data.frame(data),family='poisson')
summary(res_eg1_poi_add)
plot(res_eg1_poi_add)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.