How to use variogramfit function for my dataset?

22 views (last 30 days)
Hello
My data is:
semivariogram values=[0; 5.953452709; 3.819761106; 0.168685691; 2.300182045; 0.015065368]
lag distances=[ 0 ; 1.5; 3; 4.5; 6; 7.5]
How to use this recently developed function (https://uk.mathworks.com/matlabcentral/fileexchange/25948-variogramfit) to fit a spherical model to my experimental semivariogram (data above) and get the parameters of the theoretical model?

Answers (1)

Govind KM
Govind KM on 7 Jun 2023
Hi Pooneh,
An example code for you to use the function would be:
sgvalues=[0; 5.953452709; 3.819761106; 0.168685691; 2.300182045; 0.015065368];
ldist=[0; 1.5; 3; 4.5; 6; 7.5];
[a,c,n,S]=variogramfit(ldist,sgvalues);
The model is set as spherical by default.
The function also accepts three more optional arguments, initial value for range, initial value for sill variance and the number of observations per lag distance. The initial values will be taken as their specified defaults if not passed as arguments. The outputs are
a : Range
c : Sill
n : Nugget (empty if nugget variance is not applied)
S : structure array with additional information
You can get the parameters of the theoretical model from the output structure S.
You can download the variogramfit.m script from the functions tab of the link you provided. It is quite well commented and you can refer to it for further information.

Categories

Find more on Interpolation in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!