View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Random Field Simulation

4.8 | 8 ratings Rate this file 48 Downloads (last 30 days) File Size: 6.52 KB File ID: #27613 Version: 1.5
image thumbnail

Random Field Simulation



14 May 2010 (Updated )

Generate multivariate conditional random fields given a mesh and covariance information.

| Watch this File

File Information

Given a list of d-dimensional points -- typically, though not necessarily, representing a mesh -- and correlation information, the function randomfield.m returns realizations of a corresponding random process. These fields may be conditioned on known data values.

The correlation information can be:
- one of three parameterized models,
- a given correlation matrix with dimensions corresponding to the number of mesh points,
- a matrix of "snapshots" of an unknown process.

The function can also return a struct with the Karhunen-Loeve bases for further field generation and filtering. See the options described in the help for more details.

When data is given for the field realizations to interpolate, the returned mean is the ordinary kriging approximation.

If you have the parallel computing toolbox and more than one core, this will go faster.

Copyright Paul G. Constantine and Qiqi Wang.


This file inspired Pm Pack Parameterized Matrix Package.

MATLAB release MATLAB 7.13 (R2011b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (11)
31 Jan 2017 Martin Hofmann

Really useful, thanks a lot!! just one thing, the default value for spthresh is set to 0.01, shouldn't it be set to 0 ?

19 May 2016 JING CHENG

Thanks very much. Now I do the project related the 2d random field simulation involving K-L expansion

11 Feb 2016 Pramudita Satria Palar

Hi Paul, nice code.

I tried to generate a random field with correlation length 0.2, and sigma value of 0.03 (Gaussian correlation). I varied the mesh size by 100 and 500, and I obtained different realization with similar parameters (including the weights). Is the random field sensitive to the mesh size?


18 Dec 2015 Chao Zhuang

It's very helpful. Thanks!

27 Apr 2015 Alecia Cassidy

01 Oct 2014 JINGLAI

Thanks very much

Comment only
05 Nov 2013 nacim Debabi

nice trick

Comment only
26 Apr 2012 Paul Constantine

Just fixed a few bugs. It should respect the data points now.

Comment only
12 Apr 2012 Songhun

16 Sep 2011 João

João (view profile)

01 Apr 2011 Felipe G. Nievinski

14 May 2010 1.1

Fixed a bug when computing the covariance matrix from snapshots.

05 Dec 2011 1.2

Latest version incorporates a low-memory option for large meshes. However, it is slow.

Performance is substantially improved when using the Parallel Computing Toolbox. The scripts use parfor to construct the correlation matrix.

26 Apr 2012 1.5

Learned to use zip.

Contact us