[R-sig-Geo] how can I add back transformation for ploting

Paulo Justiniano Ribeiro Jr paulojus at c3sl.ufpr.br
Thu Jan 12 12:42:42 CET 2012


A general approach is by using the (conditional) simulations

  - perform prediction obtaining conditional simulations
  - back transform the simulations (inverse box-cox transform)
  - obtains the summaries from the transformed values (such as the mean for 
the "kriged"map on the original scale

P.J.


On Thu, 12 Jan 2012, Saman Monfared wrote:

> Hi.
> How can I add back a transformation in cokriging??
>
> dd<-read.table("besss.txt",header=TRUE)
> summary(dd)
>
> *my target variable is B*
>
> I used box-cox transformation by lambda=-.14
>
> d<-((dd$B)^-.14-1)/-.14 then used transformed data to cross variography:
>
> m<-vgm( 0.22493303,"Gau",78006.24,0,cutoff=100607.2, width = 100607.2/12)
> g <- gstat(NULL, id = " d", form =  d ~1,data=dd,fill.cross = F)
> g <- gstat(g, id = "A", form = A~1,data=dd,fill.cross = F)
> g <- gstat(g, id = "T", form =  T~ 1,data=dd,fill.cross = F)
> vm <- variogram(g,covariance=F)
> plot(vm)
> vm.fit <- fit.lmc(vm, g, model=m,fit.ranges =F)
> nc.sids <- readShapePoly("City Boundary.shp")
> pts <- spsample(nc.sids, n=3000, type="regular")
> grd<-data.frame(pts)
> gridded(grd)<-~x1+x2
> pp<-predict(vm.fit,grd)
>
> pp is prediction for transformed data
> how can I add back the transformation for ploting by
>
> image(pp,1) and countour(pp,1,add=T)??
>
> Thanks.
>
> -- 
>
> Saman Monfared
> Msc Student,
> Department of Statistics, Shiraz University,
> Shiraz 71454, Iran
> Email: Samanmonfared1 at gmail.com
>
> Tel: +98 917 5305167
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>



More information about the R-sig-Geo mailing list