📄 demoxoto2.m
字号:
function demoxotO2(x,o,t,r,rbeta,S,movieS,memory,verbose)# O Hagan method for extrapolation usage # demoxot(x,o,t)# do a demo using inputs x, etc. if (nargin != 9 && nargin != 7 && nargin != 8) usage ("demoxotO(x,o,t,r,S,movieS[,memory[,verbose]])"); endif if (nargin != 7 && nargin != 9) memory = 0.8 ; endif if ( nargin != 9) verbose = 1 ; endifglobal jitter ;global alphaO ; global betaO ; # set in DEMO.mshowdataalone = 0 ;s=size(x); X=s(2);# S=10; # number of samples# movieS=3; # number of samplesstyle="@13";lstyle = "-@63" ; # style for line samplesplstyle = "-@53" ; # style for line samples, posteriormstyle = "-4" ; # style for mean # initgnu(); # set up graphics done elsewhere## Make covariance matrix#C=covO2(x,x,r,rbeta,alphaO,betaO,jitter) ;CIM ; # initialize one random sample and do a moviev=randn(size(x))*M ;if ( verbose ) # show this one sample plot ( x,v,lstyle) ; input("demoxotO : one sample : press return");endifif ( !((verbose <= 1) && (X==2)) ) # i.e. skip this if X==2 and not very verbose vl = bubblex( M , v , movieS , memory , x ) ; input("press return");endif# Make S samples and show them - from priorv=randn(S,X)*M ;infer();if ( showdataalone ) plot ( x,v,lstyle) input("press return"); plot ( xsub,t,style ) ; input("demoxotO : press return");endifplot ( x,v,lstyle, xsub,t,style) ;input("demoxotO : press return");gplot xmsd u 1:2:3 w error 4 2 , xmean u 1:2 w l 4 2 , xsubt u 1:2 w p 1 3 ;input("demoxotO : press return--");# straight away show the samples that go through the data points# --- make a load of independent samplesvv = randn(S,X) * pp ;posts = vv + ones(S,1) * mean ; plot ( x,posts,plstyle, xsub,t,"@13")input("demoxotO : press return"); # initialize a random deviation under the posteriordv = randn(size(x)) * pp ;if ( !((verbose <= 1) && (X==2)) ) # i.e. skip this if X==2 and not very verbose vl = bubblexmd( pp , dv , movieS , memory , x , mean,xsub,t ) ;endif# immediately show everything we have doneplot ( x,posts,plstyle,x,mean,mstyle, xsub,t,"@13")if ( verbose ) # show this one sample if ( X == 2 ) gset nolabel 5 gset nolabel 6endifendif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -