ゼロ平均と単位分散でMatlabを使用してガウスランダムプロセスを生成するにはどうすればよいですか?
ガウス確率変数は、次のように実装できます。
w=(1/sqrt(2*pi))*exp(-(t.^2)/2);
しかし、ガウスランダムプロセスはどうですか?
ゼロ平均と単位分散でMatlabを使用してガウスランダムプロセスを生成するにはどうすればよいですか?
ガウス確率変数は、次のように実装できます。
w=(1/sqrt(2*pi))*exp(-(t.^2)/2);
しかし、ガウスランダムプロセスはどうですか?
指定された相関長 (cl) と RMSE 高さ (hRMSE) を持つランダム ガウス プロセスは、ガウス フィルターを介して平均 0 と標準偏差 hRMSE を持つホワイト ノイズを渡すことによって生成できますg=exp(-(x.^2)/(cl^2/2))
。
さらに、以下のリンクで Matlab コードを見つけることができます: http://www.mysimlabs.com/matlab/surfgen/rsgeng1D.m
以下に転記したもの:
function [f,x] = rsgeng1D(N,rL,h,cl)
%
% [f,x] = rsgeng1D(N,rL,h,cl)
%
% generates a 1-dimensional random rough surface f(x) with N surface points.
% The surface has a Gaussian height distribution function and a Gaussian
% autocovariance function, where rL is the length of the surface, h is the
% RMS height and cl is the correlation length.
%
% Input: N - number of surface points
% rL - length of surface
% h - rms height
% cl - correlation length
%
% Output: f - surface heights
% x - surface points
%
% Last updated: 2010-07-26 (David Bergström).
%
format long;
x = linspace(-rL/2,rL/2,N);
Z = h.*randn(1,N); % uncorrelated Gaussian random rough surface distribution
% with mean 0 and standard deviation h
% Gaussian filter
F = exp(-x.^2/(cl^2/2));
% correlation of surface using convolution (faltung), inverse
% Fourier transform and normalizing prefactors
f = sqrt(2/sqrt(pi))*sqrt(rL/N/cl)*ifft(fft(Z).*fft(F));