# NOT RUN {
###############################################################################
## Petro data:
library(NGSSEML)
#### Inputs:
data(Rt)
Ytm=Rt$Rt
Date=Rt$Date
Xtm=NULL
Ztm=NULL
model="GED"
LabelParTheta=c("W","nu")
StaPar=c(0.9,1)
p=length(StaPar)
nn=length(Ytm)
a0=0.01
b0=0.01
pointss= 4 ### points
nsamplex=25 ## Sampling posterior
ci=0.95 # Cred. level
fitbayes<-ngssm.bayes(Ytm~1,data=data.frame(Ytm),model=model,pz=NULL,
StaPar=StaPar,a0=a0,b0=b0,prw=c(1,1),
prnu=c(0.01,0.01),ci=ci,pointss=pointss,nsamplex=nsamplex,
postplot=FALSE,contourplot=FALSE,LabelParTheta=LabelParTheta)
#postaux<-fitbayes$samplepost[,]
posts<-fitbayes$samplepost
############
#Smoothing:
############
#PlotF function:
PlotF(Ytm~1,data=data.frame(Ytm),model=model,pz=NULL,plotYt=FALSE,
transf=-0.5,Proc="Smooth",Type="Marg",distl="PRED",a0=a0,b0=b0,
ci=ci,posts=posts,startdate=NULL,enddate=NULL,Freq="days",Typeline='l',
cols=c("black","blue","lightgrey"),xxlab="t",yylab=expression(paste(hat(sigma)[t])),
yylim=c(0.02,0.10),Lty=c(1,2,1),Lwd=c(2,2,2),Cex=0.68)
# dev.new()
###############################################################################
# }
Run the code above in your browser using DataLab