I agree with Paul that kriging might be a better option, but if you want
to use IDW, the intamap package includes a function for optimizing the
power based on cross-validation. In the example for the function
interpolate, replace the penultimate line with:
x = interpolate(meuse, meuse.grid, lis
Hi Erik,
IDW does not include a formal interpretation of the inverse distance
power. You could seperate your dataset into a validation and
interpolation set and try different idp's and see which one preforms best.
Another option would be to use kriging. Kriging fits the spatial
dependence vs
I used the gstat package to interpolate measurements of eight environmental
variables in a square 15.4 m x 15.4 m, and then I used model selection from
another package to build models of dependence of plant population locations on
those environmental variables. I used the idw() function to int
On 08/23/2010 05:45 PM, Kerry Ritter wrote:
Hi. I am using library "gstat" in R. My question is why do I get
different SSErr's when I fit the variogram model using fit.variogram
than when I fix the parameters in fit.variogram using the exact same
parameters obtained from the first fit. My exp
Hi. I am using library "gstat" in R. My question is why do I get
different SSErr's when I fit the variogram model using fit.variogram
than when I fix the parameters in fit.variogram using the exact same
parameters obtained from the first fit. My expectation is that these
would be the same. W
Forget it, I got it.
Pete
On 2010/07/26 18:29, Jonathan Greenberg wrote:
r-sig-geo'ers:
Quick question: is there an easy way to have a flag to tell if a
dataset is NOT supported, e.g. when GDALinfo(fname) is in error? I'd
like something like "GDALinfo(fname)" to return "FALSE" if its an
unsup
Dear Zev, thanks for reminding me about his (off-line).
I looked into this issue, and found that predict.ns (the predict method
that comes with ns usage in predict mode) simply calls ns, and so
re-computes the whole spline with predict data ranges. As the spline
fitted depends on the data that is
Lukas Brodsky wrote:
> Hello,
> is there any example on indicator co-kriging in gstat/R?
demo(cokriging)
> Any suggestion for creating a map (e.g. indicator) of binary variable
> for which I have co-variable that is co-located and is known at each
> prediction location? The binary variable has
Hi Lukas,
If you feel like being Bayesian, you might want to check out the spMvGLM
function in spBayes. Please let me know if it works for you or if you
have any questions.
Andy
Lukas Brodsky wrote:
Hello,
is there any example on indicator co-kriging in gstat/R?
Any suggestion for creating a
Hello,
is there any example on indicator co-kriging in gstat/R?
Any suggestion for creating a map (e.g. indicator) of binary variable
for which I have co-variable that is co-located and is known at each
prediction location? The binary variable has also known property (in
sampled limited points)
Hi All,
Sorry for the re-post, I didn't get an answer the first time around and
thought I'd give it another try. I am noticing in GSTAT that if I
include a spline as part of the drift in an external drift kriging model
that the prediction, oddly, depends on how many observations I have in
the
Hi All,
I am getting inconsistent predictions from GSTAT when I have a spline as
part of the external drift while kriging.Can anyone explain why this
might be?
In particular, I noticed that the predictions at a particular point will
depend upon how many observations I have in the "newdata" a
On Sunday 22 November 2009 06:38:53 Julius Tesoro wrote:
> Hello R-People,
>
> I always read about importing DEM to R but how about converting R data to
> DEM? I have an interpolated SpatialPixelsDataFrame generated by gstat and
> want to export this as a DEM file. Are there tutorials for these?
Hello R-People,
I always read about importing DEM to R but how about converting R data to DEM?
I have an interpolated SpatialPixelsDataFrame generated by gstat and want to
export this as a DEM file. Are there tutorials for these?
Advanced thanks for the help.
Cheers,
Julius Tesoro
_
Dear Murray and list,
repairing the memory leaks turned out to be a more fun job than I
thought it would be. Memory leakage mainly took place in the
neighbourhood search algorithm (nsearch.c) which uses a quadtree for 2
and octtree (octree?) for 3-dimensional data. As you can guess, the code
is fu
On Friday 30 October 2009, Murray Richardson wrote:
> Hello R-SIG-GEO list,
>
> I know this has come up before but I am having an ongoing memory problem
> with the gstat package (gstat out of dynamic memory) that I can't seem
> to solve.
>
> I am using R to interpolate DEMs from LiDAR xyz point fil
Murray Richardson wrote:
> Hello R-SIG-GEO list,
>
> I know this has come up before but I am having an ongoing memory
> problem with the gstat package (gstat out of dynamic memory) that I
> can't seem to solve.
>
> I am using R to interpolate DEMs from LiDAR xyz point files and mosaic
> them togeth
Hello R-SIG-GEO list,
I know this has come up before but I am having an ongoing memory problem
with the gstat package (gstat out of dynamic memory) that I can't seem
to solve.
I am using R to interpolate DEMs from LiDAR xyz point files and mosaic
them together via RSAGA. The script uses a l
Edzer,
Glad to hear that I wasn't crazy -- thanks so much for looking into this
(and so quickly). For now I'll divide by 1000 and use KM which is an
easy and reasonable solution. Zev
Edzer Pebesma wrote:
Zev, if you do a
v.fit<-fit.variogram(v, vgm(0.0005, "Sph", 4,
0.1),debug.leve
Zev, if you do a
v.fit<-fit.variogram(v, vgm(0.0005, "Sph", 4, 0.1),debug.level=32)
you'll see that the X matrix of the Gauss-Newton iteration with the
derivatives of the parameters to the error sum of squares is nearly
singular. The condition number of this matrix is so large that it
Thanks for the reproducalbe example, Zev;
the whole thing looks very strange to me; it seems to be the combination
of very large distance values and very small semivariance values that
triggers this -- when I multiply v$gamma with 1000, many different
initial variogram values are fit without p
Edzer (and all),
I don't think that it's related to an unrealistic range. I've tried a
lot of different realistic and non-realistic values and get singular
results each time. If I divide the X and Y coordinates by 10, 100, 1000
or 1 I don't get singularity. Using Lat and Long works fine. C
Hi Zev, it is hard to see what happens without seeing your data or R
commands.
Is it possible that you passed an unrealistic value for the range
parameter, as starting value for the variogram model argument of
fit.variogram?
--
Edzer
Zev Ross wrote:
Hi All,
I'm fitting variograms in GSTAT
Hi All,
I'm fitting variograms in GSTAT with fit.variogram and I was surprised
to find that all my fits were singular. I experimented with converting
the data to unprojected data (decimal degrees) and with dividing my X
and Y coordinates, which are in meters, by 1000 (to get KM). In both
case
I find it hard to believe that you did a thorough online search.
Googling on "kriging spherical distance" gave me the following as first hit:
https://stat.ethz.ch/pipermail/r-sig-geo/2008-October/004457.html
and then there the search facility for the archives of this list,
referenced at the en
Dear all,
Does anyone know if the Gstat package in r offers kriging using
spherical geometry rather than euclidean distances?
I couldn't find anything in ?krige or online, but I've heard that the
general gstat package includes this option. From comparisons with a
different kriging code out
Just a quick question re: memory sizes.
Is it possible to quickly estimate the amount of RAM needed to do
ordinary kriging given a dataset of 14000 records for 2 variables?
--
David Depew
PhD Candidate
Department of Biology
University of Waterloo
200 University Ave W.
Waterloo, ON. Canada
N2L 3
Zev Ross wrote:
Hi All,
ArcGIS has a nice little button that calculates the optimal power
value to use for inverse distance weighting based on cross-validation
and RMSPE. Just wondering if anyone had written something similar in R
-- I'm using GSTAT and I'd like to avoid back and forth with A
Zev Ross schreef:
Hi All,
ArcGIS has a nice little button that calculates the optimal power
value to use for inverse distance weighting based on cross-validation
and RMSPE. Just wondering if anyone had written something similar in R
-- I'm using GSTAT and I'd like to avoid back and forth with
Hi All,
ArcGIS has a nice little button that calculates the optimal power value
to use for inverse distance weighting based on cross-validation and
RMSPE. Just wondering if anyone had written something similar in R --
I'm using GSTAT and I'd like to avoid back and forth with ArcGIS (and
obvio
directly export the resulting maps to Google Earth.
cheers,
Tom Hengl
http://spatial-analyst.net
-Original Message-
From: [EMAIL PROTECTED] on behalf of Greg Lee
Sent: Fri 31/10/2008 9:45 AM
To: Edzer Pebesma
Cc: r-sig-geo@stat.math.ethz.ch
Subject: Re: [R-sig-Geo] gstat::variogram
No sign of sp 0.9-27 at this end (Melbourne, Australia) yet. Interesting
that it should take so long.
I temporarily reset my repository to access the updates. Croatia already has
sp 0.9-28, along with gstat 0.9-53. (Does Tomislav receive special
treatment?)
Your example now works perfectly. Thank
That's right; my fault that I sent the email and updated the sp package
on CRAN almost at the same time. The new sp (0.9-27 would suffice)
should now have propagated to your mirror, simply update your sp package
again and it should work. Let me know if it doesn't.
--
Edzer
Greg Lee wrote:
Hel
Hello Edzer,
I was curious to run the example you provided (using the latest CRAN
versions of all packages), but as written the line
> idw.spdf = as(idw.out, "SpatialPolygonsDataFrame")
produces
Error in as(idw.out, "SpatialPolygonsDataFrame") : no method or default for
coercing "SpatialPixels
Dear all,
In continuation of this thread, I've spent some time looking at kriging
on the sphere, corrected some bugs, and need further help.
First of all, distances for covariances on the sphere were computed
incorrectly as well in gstat, so I hope not too many people have been
relying on th
Dave Depew wrote:
A late follow up question to this thread
What if the local neighbor hood was restricted to the range of
autocorrelation? My impression was that values beyond that have little
weight in the interpolation anyways.
Often, yes. Three exceptions are (i) when the nugget forms
A late follow up question to this thread
What if the local neighbor hood was restricted to the range of
autocorrelation? My impression was that values beyond that have little
weight in the interpolation anyways.
I realize that this is of course not statistically optimal, but for
those with
Thanks for the bug report; indeed, distance computation for longlat data
variograms went wrong so far. I just uploaded a new gstat version to
/incoming on CRAN that seems to repair this bug.
Next thing I'm not 100% sure of is the direction selections for
directional variograms of longlat data.
Hello,
I am trying to use 'variogram' from the gstat package to compute an empirical
semivariogram for a dataset that spans the North American continent. I have
been unable to get gstat to calculate the great circle distances correctly.
For example, in the example below, the first two lines o
Dear Radim, Edzer,
I was thinking about the same problem few years ago (I assume that you work
with auxiliary maps and
not only coordinates).
I think (have a feeling) that local and global Universal kriging should be
treated as two things
(especially if you put a very narrow search radius). T
Good question, I'll include r-sig-geo as well.
actually the prediction equations you end up with are kind of funny, and
I've never seen them written out. Two different covariance matrices
being inversed.
Package gstat can do the two-step approach: global BLUE, then simple
kriging of residual
Thanks,
A good way of incorporating it.
Paul
Edzer Pebesma schreef:
(I'm adding r-sig-geo to this thread)
Paul/Ashton,
I included your code, Paul; I also added the option (with the same
argument name) to variogramLine so you can now also do e.g. a
variogramLine(vgm(1, "Sph", 1, anis=c(0,
(I'm adding r-sig-geo to this thread)
Paul/Ashton,
I included your code, Paul; I also added the option (with the same
argument name) to variogramLine so you can now also do e.g. a
variogramLine(vgm(1, "Sph", 1, anis=c(0, 0.5)), dir =
c(1/sqrt(c(2,2)),0), dist_vector = c(0, 0.1, 0.5, 1, 2))
(t
Dave Depew wrote:
I suppose it might be, although I expanded the neighborhood just to be
sure. I wonder if it isn;t the NA values that are in the grid
I'd expect a different error message, or that the location gets ignored.
To select non-missing valued pixels, you can select cells if the grid
I suppose it might be, although I expanded the neighborhood just to be
sure. I wonder if it isn;t the NA values that are in the grid
Edzer Pebesma wrote:
Is it possible that you're using kriging in a local neighbourhood
where the predictor is constant?
--
Edzer
Dave Depew wrote:
Hi
I'm tryin
Is it possible that you're using kriging in a local neighbourhood where
the predictor is constant?
--
Edzer
Dave Depew wrote:
Hi
I'm trying to run some universal kriging, and have not experienced
this error before.
I've removed duplicate data locations using the remove.duplicates
command. The
> I think I know what the issue isI have some NA cells in the
prediction grid. trying to do UK with NA cells may be the problem. IS
there a way to exclude these or remove them? I think they are present
due to transect spacing and the short range of the original OK done for
the covariate...
Hi
I'm trying to run some universal kriging, and have not experienced this
error before.
I've removed duplicate data locations using the remove.duplicates
command. The data set runs fine if the formula is set as ordinary
kriging, but adding in a predictor (which is already known at each grid
l
Ashton, I found it worth dropping at r-sig-geo. And did so.
Thanks, and best wishes,
--
Edzer
Ashton Shortridge wrote:
Hi all,
Not a question, but hopefully a contribution. I have been messing around with
normal scores, which are trivial in R, and back transforms, which are
anything but triv
Hi Edzer,
I am still having some trouble with the great distance calculations in
'variogram'. Your suggestion below works, but the distances are not correct
(at least, not in kilometers, meters, or miles). I do not have proj.4 or gdal
libraries installed, nor do I have the R packages proj4 or
This works great, Edzer. I expected there was a simple solution. Many thanks!
-Tim
On Wed, Apr 2008, 30 at 07:42:36AM +0200, Edzer Pebesma wrote:
> Timothy, for some reason the projected argument was not meant to be set
> by users at this level of abstraction; I'll look into it. The following
Timothy, for some reason the projected argument was not meant to be set
by users at this level of abstraction; I'll look into it. The following
seems to work:
> proj4string(foo)=CRS("+longlat")
> proj4string(foo)
[1] "+longlat"
> variogram(z~1,foo)
np distgamma dir.hor dir.ver i
Hello,
I am trying to use gstat to compute a semivariogram for data whose coordinates
are latitude/longitude pairs. I would like to use the great circle distance
between pairs. The documentation implies that gstat can do this, but I am not
having any success. If anyone could suggest the corr
On Thu, 13 Dec 2007, Edzer Pebesma wrote:
> I guess then that is the issue: cygwin is not well supported, or causing
> trouble, for reasons beyond my comprehension. Why not use the standard
> windows distribution?
It looks like a cygwin/WIN32 crash - the lines given try to call R
functions onl
I guess then that is the issue: cygwin is not well supported, or causing
trouble, for reasons beyond my comprehension. Why not use the standard
windows distribution?
--
Edzer
Edward Tomlinson schrieb:
> Hi Edzer and Roger,
>
> The R ./configure was taken from the Installation and Administratio
You can.
It is a bit of a hack, but predict.gstat() has a BLUE=TRUE optional
argument, to return the trend component only rather than trend +
predicted residual as kriging does. Then, if you specify the predictor
values for the new location as c(1,0,0,... etc), you get out the trend
coefficien
Edzer,
Thanks again. If both effects (microscale variation and measurement
error) are collinear in the fit should one not try to include both?
Perhaps it's simply better to jitter by a centimeter. And by the way,
I'm doing universal kriging with the krige function, is there a way to
get out th
Zev Ross wrote:
> Hi Edzer,
>
> Very useful, thank you. You might be able to tell from my posts that
> I'm running these in parallel in GSTAT and geoR and comparing. It
> seems from your note and example that it might simply be easier to add
> a centimeter (provided a centimeter doesn't matter i
Hi Edzer,
Very useful, thank you. You might be able to tell from my posts that I'm
running these in parallel in GSTAT and geoR and comparing. It seems from
your note and example that it might simply be easier to add a centimeter
(provided a centimeter doesn't matter in the real world) to all th
Zev,
you can use the "Err" variogram model to denote micro variation as
opposed to nugget. The only effect it has is that for a new prediction
on an observation location the measurement error-free process is
predicted, and not the observation process itself. Semivariance of an
observation with
Hi All,
I folded this question into a previous post, but I think it may have gotten
missed. Just wondering if someone could tell me how, in GSTAT, one would specify
the nugget as measurement error vs microscale variation in kriging. I have
multiple measurements at the same location and I'd like to
[EMAIL PROTECTED] wrote:
>When performing ordinary kriging under gstat in R I received the following
>error after the program had stopped.
>
>---R output
>vert.ok <- krige(vert~1, em38a, SPDF, model=vert.fit)
>[using ordinary kriging]
>
>"chfactor.c", line 130: singular matrix in function LDLfacto
A simple work around is to just add some random noise to the points with
jitter.
?jitter
--
Dr Duncan Golicher
Ecologia y Sistematica Terrestre
Conservación de la Biodiversidad
El Colegio de la Frontera Sur
San Cristobal de Las Casas,
Chiapas, Mexico
Email: [EMAIL PROTECTED]
Tel: 967 674 9
When performing ordinary kriging under gstat in R I received the following
error after the program had stopped.
---R output
vert.ok <- krige(vert~1, em38a, SPDF, model=vert.fit)
[using ordinary kriging]
"chfactor.c", line 130: singular matrix in function LDLfactor()
gstat caught an error that oc
[EMAIL PROTECTED] wrote:
> Hello list
>
> In the gstat R package tutorial that accompanies the latest version of
> GSTAT 0.9-29 it is pointed out that the function coordinates, when assigned
> (on the left-hand side of an = or <- sign) promotes the data.frame meuse
> into a SpatialPointsDataFrame.
Hello list
In the gstat R package tutorial that accompanies the latest version of
GSTAT 0.9-29 it is pointed out that the function coordinates, when assigned
(on the left-hand side of an = or <- sign) promotes the data.frame meuse
into a SpatialPointsDataFrame. Is there a function that does the o
Zev Ross wrote:
> Hi All,
>
> Can anyone tell me what GSTAT variogram fit method most closely
> resembles that used in S-PLUS. I'd like to try to come as close as I
> can to matching some analysis that was done with the variogram.fit
> function in S-PLUS.
>
> In S-PLUS the WLS function used is |
Title: Untitled Document
Hi All,
Can anyone tell me what GSTAT variogram fit method most closely
resembles that used in S-PLUS. I'd like to try to come as close as I
can to matching some analysis that was done with the variogram.fit
function in S-PLUS.
In S-PLUS the WLS function used is objec
68 matches
Mail list logo