Knowee
Questions
Features
Study Tools

Use data s256i from the package geoR. This is the simulated data set with the coordinates of data locations and numeric data at them.a. Produce a sample variogram on the interval [0,1] using 20 bins.(0.5 mark)b. Fit the spherical variogram to the sample variogram by using ordinary least squares. Use the initial values (1, 0.5) and nugget = 0.5.(0.5 mark)c.   Consider the location (1, 0.5). Plot locations of the data in black and this location in red in the same image.(0.5 mark)d. Use the kriging method to compute the predicted value and the variance at the point (1, 0.5). Round the answers with 4 decimal places. (0.5 mark)e. Perform a prediction(kriging) on a grid covering the area [0,2]x[0,2].  Plot the result.(0.5 mark)f. Explain the obtained plot.(1 mark)g. To prepare your data for cross-validation, use the R commands> a <- as.data.frame(s256i$data)> s <- SpatialPointsDataFrame(s256i$coords, a, proj4string=CRS(projargs=as.character(NA)), match.ID=TRUE)> v.fit <- as.vgm.variomodel(ols.n)where ols.n is the variogram fitted by the ordinary least squares method.Cross-validate your model by using leave-one-out cross-validation and a bubble plot of the result.

Question

Use data s256i from the package geoR. This is the simulated data set with the coordinates of data locations and numeric data at them.a. Produce a sample variogram on the interval [0,1] using 20 bins.(0.5 mark)b. Fit the spherical variogram to the sample variogram by using ordinary least squares. Use the initial values (1, 0.5) and nugget = 0.5.(0.5 mark)c.   Consider the location (1, 0.5). Plot locations of the data in black and this location in red in the same image.(0.5 mark)d. Use the kriging method to compute the predicted value and the variance at the point (1, 0.5). Round the answers with 4 decimal places. (0.5 mark)e. Perform a prediction(kriging) on a grid covering the area [0,2]x[0,2].  Plot the result.(0.5 mark)f. Explain the obtained plot.(1 mark)g. To prepare your data for cross-validation, use the R commands> a <- as.data.frame(s256idata)>s<SpatialPointsDataFrame(s256idata)> s <- SpatialPointsDataFrame(s256icoords, a, proj4string=CRS(projargs=as.character(NA)), match.ID=TRUE)> v.fit <- as.vgm.variomodel(ols.n)where ols.n is the variogram fitted by the ordinary least squares method.Cross-validate your model by using leave-one-out cross-validation and a bubble plot of the result.

...expand
🧐 Not the exact question you are looking for?Go ask a question

Solution 1

This question seems to be about spatial data analysis using the R programming language and the geoR package. Here's how you can perform each step:

a. To produce a sample variogram, you can use the variog function in the geoR package. Here's an example:

library(geoR)
data(s256i)
vario <- variog(s256i, max.dist=1, breaks=seq(0, 1, length.out=20))
plot(vario)

b. To fit the spherical variogram, you can use the variofit function:

fit <- variofit(vario, ini.cov.pars=c(1, 0.5), nugget=0.5, cov.model="spherical")
plot(vario, fit)

c. To plot the data locations and the specific location (1, 0.5), you can use the plot function:

plot(s256i$coords, col="black")
points(1, 0.5, col="red")

d. To compute the predicted value and the variance at the point (1, 0.5), you can use the krige.bayes function:

kriging_result <- krige.bayes(s256i, newdata=data.frame(coords=matrix(c(1, 0.5), ncol=2)), krige=krige.control(obj.m=fit))
round(kriging_result$predict, 4)
round(kriging_result$kr.var, 4)

e. To perform a prediction on a grid covering the area [0,2]x[0,2], you can use the expand.grid and krige.bayes functions:

grid <- expand.grid(x=seq(0, 2, length.out=100), y=seq(0, 2, length.out=100))
kriging_grid <- krige.bayes(s256i, newdata=data.frame(coords=grid), krige=krige.control(obj.m=fit))
image(kriging_grid)

f. The obtained plot shows the predicted values at each point in the grid. The color of each point represents the predicted value, with a color scale usually provided.

g. To prepare your data for cross-validation, you can use the following commands:

a <- as.data.frame(s256i$data)
s <- SpatialPointsDataFrame(s256i$coords, a, proj4string=CRS(projargs=as.character(NA)), match.ID=TRUE)
v.fit <- as.vgm.variomodel(ols.n)

To cross-validate your model, you can use the leave-one-out cross-validation method and a bubble plot of the result:

cv_result <- krige.cv(s, model=v.fit)
bubble(cv_result)

Please note that you need to replace ols.n with the actual fitted variogram model.

This problem has been solved

Solution 2

This question seems to be about spatial data analysis using the R programming language and the geoR package. Here's how you can approach each part:

a. To produce a sample variogram, you can use the variog function in the geoR package. Here's an example:

library(geoR)
data(s256i)
vario <- variog(s256i, max.dist = 1, breaks = seq(0, 1, length.out = 20))
plot(vario)

b. To fit the spherical variogram, you can use the variofit function:

fit <- variofit(vario, ini.cov.pars = c(1, 0.5), nugget = 0.5)
plot(vario, fit)

c. To plot the data locations and the specific location (1, 0.5), you can use the plot function:

plot(s256i$coords, col = "black")
points(1, 0.5, col = "red")

d. To compute the predicted value and the variance at the point (1, 0.5), you can use the krige.bayes function:

kriging_result <- krige.bayes(s256i, newdata = c(1, 0.5), krige = krige.control(obj.m = fit))
round(kriging_result$predict, 4)
round(kriging_result$kr.var, 4)

e. To perform kriging on a grid covering the area [0,2]x[0,2], you can use the expand.grid function to create the grid and then use the krige.bayes function:

grid <- expand.grid(x = seq(0, 2, length.out = 100), y = seq(0, 2, length.out = 100))
kriging_grid <- krige.bayes(s256i, newdata = grid, krige = krige.control(obj.m = fit))
image(kriging_grid)

f. The obtained plot shows the predicted values at each point in the grid. The color of each point represents the predicted value, with a color scale usually provided.

g. To prepare your data for cross-validation, you can use the following commands:

a <- as.data.frame(s256i$data)
s <- SpatialPointsDataFrame(s256i$coords, a, proj4string=CRS(projargs=as.character(NA)), match.ID=TRUE)
v.fit <- as.vgm.variomodel(fit)

Then, to cross-validate your model, you can use the leave-one-out cross-validation method and create a bubble plot of the result:

cv_result <- krige.cv(s, model = v.fit)
bubble(cv_result)

Please note that you may need to adjust the code to fit your specific needs.

This problem has been solved

Similar Questions

a. Produce a sample variogram on the interval [0,1] using 20 bins.(0.5 mark)b. Fit the spherical variogram to the sample variogram by using ordinary least squares. Use the initial values (1, 0.5) and nugget = 0.5.(0.5 mark)c.   Consider the location (1, 0.5). Plot locations of the data in black and this location in red in the same image.(0.5 mark)d. Use the kriging method to compute the predicted value and the variance at the point (1, 0.5). Round the answers with 4 decimal places. (0.5 mark)e. Perform a prediction(kriging) on a grid covering the area [0,2]x[0,2].  Plot the result.(0.5 mark)f. Explain the obtained plot.(1 mark)g. To prepare your data for cross-validation, use the R commands> a <- as.data.frame(s256i$data)> s <- SpatialPointsDataFrame(s256i$coords, a, proj4string=CRS(projargs=as.character(NA)), match.ID=TRUE)> v.fit <- as.vgm.variomodel(ols.n)where ols.n is the variogram fitted by the ordinary least squares method.Cross-validate your model by using leave-one-out cross-validation and a bubble plot of the result.(0.5 mark)h. Explain the obtained plot.(1 mark)i. Cross-validate your model by using 10-fold  cross-validation and a bubble plot of the result. Explain the obtained plot. and differences with leave-one-out cross-validation from f and g.(1 mark)j. Optimize the monitoring network using the criterion of minimum mean kriging variances.  Which data point has the maximum mean kriging variance?(0.5 mark)

Consider the location (1, 0.5). Plot locations of the data in black and this location in red in the same image.

variogram and how it is used in geospatial statistics

g. To prepare your data for cross-validation, use the R commands> a <- as.data.frame(s256i$data)> s <- SpatialPointsDataFrame(s256i$coords, a, proj4string=CRS(projargs=as.character(NA)), match.ID=TRUE)> v.fit <- as.vgm.variomodel(ols.n)where ols.n is the variogram fitted by the ordinary least squares method.Cross-validate your model by using leave-one-out cross-validation and a bubble plot of the result.(0.5 mark)h. Explain the obtained plot.(1 mark)i. Cross-validate your model by using 10-fold  cross-validation and a bubble plot of the result. Explain the obtained plot. and differences with leave-one-out cross-validation from f and g.(1 mark)j. Optimize the monitoring network using the criterion of minimum mean kriging variances.  Which data point has the maximum mean kriging variance?(0.5 mark)

g. To prepare your data for cross-validation, use the R commands> a <- as.data.frame(s256i$data)> s <- SpatialPointsDataFrame(s256i$coords, a, proj4string=CRS(projargs=as.character(NA)), match.ID=TRUE)> v.fit <- as.vgm.variomodel(ols.n)where ols.n is the variogram fitted by the ordinary least squares method.Cross-validate your model by using leave-one-out cross-validation and a bubble plot of the result.

1/1

Upgrade your grade with Knowee

Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.