All, I am new to using R and know some basics. I wish to use kriging in R to do the following: given data Y =f(X1,X2,X3,.....,Xn) --1000+ irregular measured data set. I would like to be able to get a single value y given sinle input set (x1,x2,x3,...xn) A google search on this takes me lierally to the same example on involving analysis with soil sampling and I cannot figure out how to extract single point interpolant. Any examples or pointers appreciated, Numeris. [[alternative HTML version deleted]]
I am no expert on kriging, but I do know that your question desperately needs a reproducible example [1] that illustrates the actual problem you are encountering. [1] http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example --------------------------------------------------------------------------- Jeff Newmiller The ..... ..... Go Live... DCN:<jdnewmil at dcn.davis.ca.us> Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/Batteries O.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --------------------------------------------------------------------------- Sent from my phone. Please excuse my brevity. Alfred Oswago <numeros2005 at gmail.com> wrote:>All, >I am new to using R and know some basics. I wish to use kriging in R >to >do the following: > >given data Y =f(X1,X2,X3,.....,Xn) --1000+ irregular measured data >set. > >I would like to be able to get a single value y given sinle input set >(x1,x2,x3,...xn) > >A google search on this takes me lierally to the same example on >involving >analysis with soil sampling and I cannot figure out how to extract >single >point interpolant. > >Any examples or pointers appreciated, >Numeris. > > [[alternative HTML version deleted]] > >______________________________________________ >R-help at 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.
You may want to look at a GIS related package in R. The soil sampling example makes sense. Anupam. On 4/4/13, Jeff Newmiller <jdnewmil at dcn.davis.ca.us> wrote:> I am no expert on kriging, but I do know that your question desperately > needs a reproducible example [1] that illustrates the actual problem you are > encountering. > > [1] > http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example > --------------------------------------------------------------------------- > Jeff Newmiller The ..... ..... Go Live... > DCN:<jdnewmil at dcn.davis.ca.us> Basics: ##.#. ##.#. Live Go... > Live: OO#.. Dead: OO#.. Playing > Research Engineer (Solar/Batteries O.O#. #.O#. with > /Software/Embedded Controllers) .OO#. .OO#. rocks...1k > --------------------------------------------------------------------------- > > Sent from my phone. Please excuse my brevity. > > Alfred Oswago <numeros2005 at gmail.com> wrote: > >>All, >>I am new to using R and know some basics. I wish to use kriging in R >>to >>do the following: >> >>given data Y =f(X1,X2,X3,.....,Xn) --1000+ irregular measured data >>set. >> >>I would like to be able to get a single value y given sinle input set >>(x1,x2,x3,...xn) >> >>A google search on this takes me lierally to the same example on >>involving >>analysis with soil sampling and I cannot figure out how to extract >>single >>point interpolant. >> >>Any examples or pointers appreciated, >>Numeris. >> >> [[alternative HTML version deleted]] >> >>______________________________________________ >>R-help at 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. > > ______________________________________________ > R-help at 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. >
I am not sure which soil example you refer to (meuse?), but it should anyway be fairly easy to get a single interpolation, just give a single point as the prediction location. The easiest is probably to start with the automap package or the intamap package, where the variogram fitting etc is done automatically. If this doesnt work out, you have to describe better what you are looking for. You will usually get more answers to questions about geostatistics on the r-sig-geo mailinglist. Cheers, Jon On 04-Apr-13 7:09, Alfred Oswago wrote:> All, > I am new to using R and know some basics. I wish to use kriging in R to > do the following: > > given data Y =f(X1,X2,X3,.....,Xn) --1000+ irregular measured data set. > > I would like to be able to get a single value y given sinle input set > (x1,x2,x3,...xn) > > A google search on this takes me lierally to the same example on involving > analysis with soil sampling and I cannot figure out how to extract single > point interpolant. > > Any examples or pointers appreciated, > Numeris. > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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.-- Jon Olav Sk?ien Joint Research Centre - European Commission Institute for Environment and Sustainability (IES) Land Resource Management Unit Via Fermi 2749, TP 440, I-21027 Ispra (VA), ITALY jon.skoien at jrc.ec.europa.eu Tel: +39 0332 789206 Disclaimer: Views expressed in this email are those of the individual and do not necessarily represent official views of the European Commission.
Take a look at package geoR. ---------------------------------------------- David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-4352> -----Original Message----- > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r- > project.org] On Behalf Of Jon Olav Skoien > Sent: Thursday, April 04, 2013 6:57 AM > To: Alfred Oswago > Cc: r-help at r-project.org > Subject: Re: [R] help with kriging interpolation > > I am not sure which soil example you refer to (meuse?), but it should > anyway be fairly easy to get a single interpolation, just give a single > point as the prediction location. The easiest is probably to start with > the automap package or the intamap package, where the variogram fitting > etc is done automatically. If this doesnt work out, you have to > describe > better what you are looking for. > > You will usually get more answers to questions about geostatistics on > the r-sig-geo mailinglist. > > Cheers, > Jon > > On 04-Apr-13 7:09, Alfred Oswago wrote: > > All, > > I am new to using R and know some basics. I wish to use kriging in > R to > > do the following: > > > > given data Y =f(X1,X2,X3,.....,Xn) --1000+ irregular measured data > set. > > > > I would like to be able to get a single value y given sinle input > set > > (x1,x2,x3,...xn) > > > > A google search on this takes me lierally to the same example on > involving > > analysis with soil sampling and I cannot figure out how to extract > single > > point interpolant. > > > > Any examples or pointers appreciated, > > Numeris. > > > > [[alternative HTML version deleted]] > > > > ______________________________________________ > > R-help at 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. > > > -- > Jon Olav Sk?ien > Joint Research Centre - European Commission > Institute for Environment and Sustainability (IES) > Land Resource Management Unit > > Via Fermi 2749, TP 440, I-21027 Ispra (VA), ITALY > > jon.skoien at jrc.ec.europa.eu > Tel: +39 0332 789206 > > Disclaimer: Views expressed in this email are those of the individual > and do not necessarily represent official views of the European > Commission. > > ______________________________________________ > R-help at 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.
Hei, Non-parametric linear spatial interpolation algorithm Ordinary Kriging using geoR package library(geoR) # 1. Create a geodata object (wMatrix contains coords and data # ? as.geodata ---> for more info my_geoData <- as.geodata(wMatrix, coords.col=1:2, data.col=3); # 2. Create a variogram objects . # ? variog ---> for more info my_variog <- variog(my_geoData , estimator.type = c("modulus"), max.dist= 28, uvec=seq(0,60,by=3 ), messages=FALSE); # 3. Try to delete all dupl. in you data my_dup = dup.coords(my_geoData$coords); # 4. Parameter Estimation: sill, range and the nugget # Use MLE or WLS (?likfit OR ?variofit) reml <- likfit(my_geoData, cov.model = "wave", trend "cte",ini=c(my_sigmaSqrt,my_phi), fix.nugget=T, nugget=my_nygget,lik.method = "REML",messages=F); wls <- variofit(my_variog, ini = c(0.185, 4.05), cov.model = "mat", kap = .5, fix.nugget=T,nug = my_nygget); # IMPORTENT : before calling variofit() OR likfit() # eyefit() to get appropriate init. value and covariance # function # 5. Perform geostatistical spatial interpolation Ord. Krig (OK) # myPredArea: can be a single point OR a matrix ordKrig <- krige.conv(my_geoData, locations=myPredArea,krige=krige.control(obj.m=wls, type.krige = "ok")); # 6. Get the predicted value and corresponding variance. ok_pred <- cbind(myPredArea,ordKrig$predict, ordKrig$krige.var); Mohammed Ouassou On to., 2013-04-04 at 00:37 -0700, Jeff Newmiller wrote:> I am no expert on kriging, but I do know that your question desperately needs a reproducible example [1] that illustrates the actual problem you are encountering. > > [1] http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example > --------------------------------------------------------------------------- > Jeff Newmiller The ..... ..... Go Live... > DCN:<jdnewmil at dcn.davis.ca.us> Basics: ##.#. ##.#. Live Go... > Live: OO#.. Dead: OO#.. Playing > Research Engineer (Solar/Batteries O.O#. #.O#. with > /Software/Embedded Controllers) .OO#. .OO#. rocks...1k > --------------------------------------------------------------------------- > Sent from my phone. Please excuse my brevity. > > Alfred Oswago <numeros2005 at gmail.com> wrote: > > >All, > >I am new to using R and know some basics. I wish to use kriging in R > >to > >do the following: > > > >given data Y =f(X1,X2,X3,.....,Xn) --1000+ irregular measured data > >set. > > > >I would like to be able to get a single value y given sinle input set > >(x1,x2,x3,...xn) > > > >A google search on this takes me lierally to the same example on > >involving > >analysis with soil sampling and I cannot figure out how to extract > >single > >point interpolant. > > > >Any examples or pointers appreciated, > >Numeris. > > > > [[alternative HTML version deleted]] > > > >______________________________________________ > >R-help at 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. > > ______________________________________________ > R-help at 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.