[SOLVED] Variogram Map

Here you can report the problems encountered when using a function relative to the variography:
- experimental variography (vario.calc, vario.grid, vmap.calc, ...)
- model fitting (model.auto)

Re: [SOLVED] Variogram Map

Postby Didier Renard » Sun Dec 16, 2012 9:50 am

The results are captured in the dbmap Grid Db.
This is a standard Db file on which all the Db* modules are available, such as:
db.write(), db.add, ...
including the generic functions (where db is not explicitely mentionned.

The generic plotting function for a Db is db.plot() which is automatically launched using the generic plot() function.
Didier Renard
 
Posts: 337
Joined: Thu Sep 20, 2012 4:22 pm

Re: [SOLVED] Variogram Map

Postby Celeste » Sun Dec 16, 2012 5:01 pm

plot() is what is crashing my computer. Does it take you a long time to get it to plot? I left mine running for 48 hours and still I just had a frozen screen.
Celeste
 
Posts: 20
Joined: Sun Oct 14, 2012 8:10 pm

Re: [SOLVED] Variogram Map

Postby Didier Renard » Mon Dec 17, 2012 6:41 pm

This is very strange.
There is no reason that you should have to wait for representing this grid graphically.
Something must have been going wrong there.

As a workaround, as the dbmap is a standard Grid DB, you can use any standard method
dedicated for the Db files (as I said in the previous post).
So, I suggest that you run your VMAP to create the Grid Db where the VMAP results are stored (say dbmap for example).
Then you should give me all the possible information concerning this file, by typing (for example):
- print(dbmap): this should give the general characteristics of the file
- print(dbmap,flag.stats=T): this should provide the statistics on the two variables which contain the VMAP results

These informations should help me in understanding what may have been going wrong
in the VMAP calculation.
As a preliminary quesiton: Does your variable (on which you tried to run VMAP) contain
some undefined values of a selection ?

Cheers
Didier Renard
 
Posts: 337
Joined: Thu Sep 20, 2012 4:22 pm

Re: [SOLVED] Variogram Map

Postby Celeste » Thu Dec 20, 2012 4:32 am

So here is my code:
#Variogram Maps
#set spatial coordinates
grid <- db.create(flag.grid=T,nx=c(100,100,100))
grid <- simtub(,grid,model=gold2.model,nbtuba=1000)
dbmap <- vmap.grid(grid,nx=30,ny=30)

And my output, I wanted to make sure the grid worked so I typed grid:
grid
Data Base Characteristics
=========================

Data Base Summary
-----------------
File is organized as a regular grid
Space dimension = 3
Number of fields = 5
Maximum Number of attributes = 5
Total number of samples = 1000000
Grid characteristics:
Origin : 0.000 0.000 0.000
Mesh : 1.000 1.000 1.000
Number : 100 100 100

Variables
---------
Field = 1 - Name = rank - Locator = rank
Field = 2 - Name = x1 - Locator = x1
Field = 3 - Name = x2 - Locator = x2
Field = 4 - Name = x3 - Locator = x3
Field = 5 - Name = Simu.V1.S1 - Locator = z1

print(grid,flag.stats=T)
Data Base Characteristics
=========================

Data Base Summary
-----------------
File is organized as a regular grid
Space dimension = 3
Number of fields = 5
Maximum Number of attributes = 5
Total number of samples = 1000000
Grid characteristics:
Origin : 0.000 0.000 0.000
Mesh : 1.000 1.000 1.000
Number : 100 100 100

Data Base Statistics
--------------------
1 - Locator Variable NA
Nb of data = 1000000
Nb of active values = 1000000
Minimum value = 1.000
Maximum value = 1000000.00
Mean value = 500000.500
Standard Deviation = 288675.135
Variance = 8333333333
2 - Locator Variable x1
Nb of data = 1000000
Nb of active values = 1000000
Minimum value = 0.000
Maximum value = 99.000
Mean value = 49.500
Standard Deviation = 28.866
Variance = 833.250
3 - Locator Variable x2
Nb of data = 1000000
Nb of active values = 1000000
Minimum value = 0.000
Maximum value = 99.000
Mean value = 49.500
Standard Deviation = 28.866
Variance = 833.250
4 - Locator Variable x3
Nb of data = 1000000
Nb of active values = 1000000
Minimum value = 0.000
Maximum value = 99.000
Mean value = 49.500
Standard Deviation = 28.866
Variance = 833.250
5 - Locator Variable z1
Nb of data = 1000000
Nb of active values = 1000000
Minimum value = -0.051
Maximum value = 0.114
Mean value = 0.013
Standard Deviation = 0.019
Variance = 0.000

Variables
---------
Field = 1 - Name = rank - Locator = rank
Field = 2 - Name = x1 - Locator = x1
Field = 3 - Name = x2 - Locator = x2
Field = 4 - Name = x3 - Locator = x3
Field = 5 - Name = Simu.V1.S1 - Locator = z1

I will post the vmap results in the next post, having a hard time getting it to run for some reason???
Celeste
 
Posts: 20
Joined: Sun Oct 14, 2012 8:10 pm

Re: [SOLVED] Variogram Map

Postby Celeste » Thu Dec 20, 2012 3:42 pm

Now I can't get it to run :( I will try restarting my computer when I get home and only running the code for it instead of all my code (plots, etc.).
Celeste
 
Posts: 20
Joined: Sun Oct 14, 2012 8:10 pm

Re: [SOLVED] Variogram Map

Postby Celeste » Sat Dec 22, 2012 1:27 am

It still won't run. Here is my code.
# RGeoS package

# 1.) Load RGeoS library

library(RGeoS)
library(e1071)
library(gstat)
library(fBasics)
library(R2HTML)
library(xtable)

# 2.) Set working directory
setwd("F:/laptop_07182012/masters")

# 3.) Build database from ASCII
gold1.table<-read.table("rbow_au.csv",header=T,na.strings="-1.00E+30",sep=",",colClasses="numeric")

#gold1.table<-read.table("rbow_au.csv",header=T,na.strings="-1.00E+30",sep=",",colClasses="numeric")
#gold1.table<-read.table("spur_box.csv",header=T,na.strings="-1.00E+30",sep=",",colClasses="numeric")
#gold1.table<-read.table("dstar_box.csv",header=T,na.strings="-1.00E+30",sep=",",colClasses="numeric")
head(gold1.table,n=10)

#Subset Data for variography
gold1.tablesub<-subset(gold1.table,AU>0.003)
head(gold1.tablesub,n=10)

# 4a.) First had to turn all znils into missing values that R could read
###Recode -1e+30 to missing = NA
#gold1.table[gold1$Au==-1e+30,"Au"] <- NA
#Don't need to do this due to the above step

# 4b.) Creating a database
gold1data.db<-db.create(gold1.table,flag.grid=FALSE,ndim=3,autoname=F)
gold1data.db

gold1.vario2<-vario.calc(gold1data.db,lag=100,nlag=8,tolang=15,dir=c(0,15,30,45,60,75,90),calcul="vg")

gold2.model<-model.auto(gold1.vario2,struct=c("Nugget Effect","Spherical"),
title="Modelling Variogram with Nugget Effect and Spherical Structure",xlab="Variance",
ylab="Distance")

#Variogram Maps
#set spatial coordinates
grid <- db.create(flag.grid=T,nx=c(100,100,100))
grid <- simtub(,grid,model=gold2.model,nbtuba=1000)
dbmap <- vmap.grid(grid,nx=30,ny=30)

The dbmap (vmap.grid) freezes my computer and I have a new Dell with 8 GB RAM.

Please let me know if you can help me. Thank you.
Celeste
 
Posts: 20
Joined: Sun Oct 14, 2012 8:10 pm

Previous

Return to Variography

Who is online

Users browsing this forum: No registered users and 2 guests

cron