[R] Variogram (nlme) of a lme object - corSpatial element question
Dear Users, From previous analysis (semi-variograms using package gstat), I found spatial autocorrelation in my dataset. The best fitted model to this spatial correlation structure is the Gaussian model (Spherical, Exponential, Linear tested and comparison done by Sum of Square errors). So I used corGaus function to define this spatial autocorrelation in my lme model using the option correlation. The Variogram function (package nlme) used on a lme object calculates the semi-variogram for the within-group residuals and add the semi-variogram of the corSpatial element (corGaus in my case) included in my model ... so far no problem. I was surprised, however, to see on the plot of the semi-variogram issued from the Variogram function, (see figure at http://imm.io/3OLe) the low range value (~1600 meters) used in the corGaus structure included in the lme object. When I fitted the same corGaus structure manually or using the fit.variogram function (package gstat) on the data of each group defined in lme, it gaves me ranges between 2050 and 2700 meters (mean 2350 meters). Can anyone explain me those differences ? Note: As I mentioned in a previous message ( http://markmail.org/message/gjgag4ohjopevgax), I tried to define a different range in the corGaus function directly in the lme function, but it is not taken into account. Arnaud [[alternative HTML version deleted]] __ R-help@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.
Re: [R] variogram
It probably means that your data is not in the right format. PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. If you show the data, it might help. It sounds like something is empty, but it is hard to tell what from the information provided. On Thu, Oct 8, 2009 at 9:07 AM, JRE akun...@gmx.de wrote: Hello everybody, I want to run the following R-code, but it does'nt work. res.vgm = variogram(ertrag ~ rep, # !!! + loc = ~ xpos + ypos, # !!! + width = start.range / 10, + data = d) Error in vector(double, length) : element 2 is empty; the part of the args list of '.Internal' being evaluated was: (mode, length) What does the error message mean? Many thanks for your help! JRE -- View this message in context: http://www.nabble.com/variogram-tp25802976p25802976.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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. -- Jim Holtman Cincinnati, OH +1 513 646 9390 What is the problem that you are trying to solve? __ R-help@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] variogram
Hello everybody, I want to run the following R-code, but it does'nt work. res.vgm = variogram(ertrag ~ rep, # !!! + loc = ~ xpos + ypos, # !!! + width = start.range / 10, + data = d) Error in vector(double, length) : element 2 is empty; the part of the args list of '.Internal' being evaluated was: (mode, length) What does the error message mean? Many thanks for your help! JRE -- View this message in context: http://www.nabble.com/variogram-tp25802976p25802976.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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] Variogram fitted by Cauchy
Hi I'm using R(2.9.0) and gstat package under Windows to plot sample variograms. When I want to fit them, I don't have the possibility to choose Cauchy functions. Under Mathematica for example, we have it and it seems to be the best one to fit the variograms I have I tested the others functions, they can fit but I would,if possible, use the Cauchy one. If anybody knows something about it, I would know, even with another package To show what I want to do, here is my code mydata=read.table(97MHz_15cm_V3.txt) colnames(mydata)=c(x,y,z,E,taille) g=gstat(id=zinc,formula=mydata[,4]~1,locations=~x+y+z,data=mydata) g.var=variogram(g,cutoff=2500,width=100) modele=vgm(model=Exp,range=2000) vario=fit.variogram(g.var,modele) Thanks! Cordialement Damien Landais __ R-help@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] Variogram: Tollerance in lag and angle
Dear all, i have my dataset (x,y,zvalue) and I will change tollerance in lag and in angle of the variogram. I usa gtat and variogram. What I must change for the lag: width o cutoff?And for the angle tollerance? This is that i have: dati-read.table(a.dat) coordx-dati[,1] coordy-dati[,2] valuecd-dati[, 5] xycd-data.frame(x=coordx,y=coordy,z=valuecd) g-gstat(id=cd,formula=(z) ~1,locations=~x+y,data=xycd) cdvaromnidirectional=variogram(g) cdvardirectional=variogram(g,alpha=c(22.5,67.5,112.5,157.5),width=0.1) I must continue.. __ R-help@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] Variogram with Gstat
Dear all can you help me? i have this problem: i have a dataset in a text file in a matrix of 3 columns: x, y, z where x and y are the coordinates and Z are the mesurements. How can i do a variogram with R? __ R-help@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.
Re: [R] Variogram with Gstat
Have a look at the examples in the helpfile for variogram from the gstat package. data(meuse) # no trend: coordinates(meuse) = ~x+y variogram(log(zinc)~1, meuse) # residual variogram w.r.t. a linear trend: variogram(log(zinc)~x+y, meuse) # directional variogram: variogram(log(zinc)~x+y, meuse, alpha=c(0,45,90,135)) # GLS residual variogram: v = variogram(log(zinc)~x+y, meuse) v.fit = fit.variogram(v, vgm(1, Sph, 700, 1)) v.fit set = list(gls=1) v g = gstat(NULL, log-zinc, log(zinc)~x+y, meuse, model=v.fit, set = set) variogram(g) if (require(rgdal)) { proj4string(meuse) = CRS(+init=epsg:28992) meuse.ll = spTransform(meuse, CRS(+proj=longlat)) # variogram of unprojected data, using great-circle distances, returning km as units variogram(log(zinc) ~ 1, meuse.ll) } HTH, Thierry ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest Cel biometrie, methodologie en kwaliteitszorg / Section biometrics, methodology and quality assurance Gaverstraat 4 9500 Geraardsbergen Belgium tel. + 32 54/436 185 thierry.onkel...@inbo.be www.inbo.be To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of. ~ Sir Ronald Aylmer Fisher The plural of anecdote is not data. ~ Roger Brinner The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data. ~ John Tukey -Oorspronkelijk bericht- Van: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Namens giuseppef...@libero.it Verzonden: dinsdag 24 maart 2009 12:45 Aan: r-help@r-project.org Onderwerp: [R] Variogram with Gstat Dear all can you help me? i have this problem: i have a dataset in a text file in a matrix of 3 columns: x, y, z where x and y are the coordinates and Z are the mesurements. How can i do a variogram with R? __ R-help@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. Dit bericht en eventuele bijlagen geven enkel de visie van de schrijver weer en binden het INBO onder geen enkel beding, zolang dit bericht niet bevestigd is door een geldig ondertekend document. The views expressed in this message and any annex are purely those of the writer and may not be regarded as stating an official position of INBO, as long as the message is not confirmed by a duly signed document. __ R-help@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] Variogram problem
Hello, I'm french and I have some difficulties in carry out the semiones under R with an aim to carry out an interpolation by krigeage. My goal is to obtain a chart of the distribution of precipitations/temperatures in Europe starting from 73 different stations (and, of course, distributed irregularly on the chart, where use of the krigeage). Here, I carried out this to test to obtain semivariogram spherical by groping: x-ts(rnorm(73)) cs1-corSpher(form=~x) y-Variogram(cs1,2628) #2628 corresponding to the distance described in l' helps, that is to say the number of station* (the number of station -1) /2. But there does not go it misses apparently much d' information. Having begun under R for approximately one month, I have not controlled all his language yet, I am completely lost. Thank you for your answers, your assistance would facilitate the task largely to me! -- View this message in context: http://www.nabble.com/Variogram-problem-tp16953929p16953929.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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.
Re: [R] Variogram problem
Nicolas, I think you better have a look at the gstat package. install.packages(gstat) library(gstat) example(gstat) ?variogram ?krige HTH, Thierry ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest Cel biometrie, methodologie en kwaliteitszorg / Section biometrics, methodology and quality assurance Gaverstraat 4 9500 Geraardsbergen Belgium tel. + 32 54/436 185 [EMAIL PROTECTED] www.inbo.be To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of. ~ Sir Ronald Aylmer Fisher The plural of anecdote is not data. ~ Roger Brinner The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data. ~ John Tukey -Oorspronkelijk bericht- Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Namens Fritier Nicolas Verzonden: dinsdag 29 april 2008 9:53 Aan: r-help@r-project.org Onderwerp: [R] Variogram problem Hello, I'm french and I have some difficulties in carry out the semiones under R with an aim to carry out an interpolation by krigeage. My goal is to obtain a chart of the distribution of precipitations/temperatures in Europe starting from 73 different stations (and, of course, distributed irregularly on the chart, where use of the krigeage). Here, I carried out this to test to obtain semivariogram spherical by groping: x-ts(rnorm(73)) cs1-corSpher(form=~x) y-Variogram(cs1,2628) #2628 corresponding to the distance described in l' helps, that is to say the number of station* (the number of station -1) /2. But there does not go it misses apparently much d' information. Having begun under R for approximately one month, I have not controlled all his language yet, I am completely lost. Thank you for your answers, your assistance would facilitate the task largely to me! -- View this message in context: http://www.nabble.com/Variogram-problem-tp16953929p16953929.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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@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.
Re: [R] Variogram problem
Thanks for your help, It is definitely that it is needed to me in finale, I therefore did not use the package check. I am going to try to understand step how is that now. Still thanks for your help! -- View this message in context: http://www.nabble.com/Variogram-problem-tp16953929p16958219.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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.