# Draw sample functions from Gaussian Process prior [closed]

Previously, I have written implementation codes of Gaussian Process regression in Python and Matlab. However, for better interaction and visualisation, I am currently working on implementation in Mathematica, but I am really a beginner in Mathematica.

Different from Python and Matlab, Mathematica is not using something like linspace in plotting functions. Instead, we enter the range to Plot such that it can generate continuous function itself. This makes me confused about how to generate sample functions given Gaussian Process prior. Let say my prior is distributed with zero mean and Squared Exponential kernel. I have

seKern[x1_,x2_,params_List]:=params[[1]]*Exp[-(Norm[x1-x2]^2/(2*params[[2]]))]

Knowing that $$\mathbf{f}\sim\mathcal{GP}(0,\,k(\mathbf{x},\,\mathbf{x}'))$$ I am trying to sample the functions from

RandomVariate[MultinormalDistribution[0, seKern[i, j, {1, 20}]], 1]

But, here, I don't know how to express this sample function in Plot such that I can generate functions as

• Welcome to Mathematica.SE! I suggest the following: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Read the faq! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! – Michael E2 Apr 11 '15 at 20:31