#### Set of global parameters ####
m<-25; M<-60
p<-.4; p_prime<-.2; k<-2
t1<-1; t2<-2
NmonteC<-5e1
S<-c(1e2,3e2)
alpha<-1.8; H<-0.8; sigma<-0.3
# How to plot empirical density
# \donttest{
theor_3_1_H_clt<-MCestimLFSM(s=S,fr='H',Nmc=NmonteC,
m=m,M=M,alpha=alpha,H=H,
sigma=sigma,ContinEstim,
t1=t1,t2=t2,p=p,k=k)
l_plot<-Plot_dens(par_vec=c('sigma','alpha','H'),
MC_data=theor_3_1_H_clt, Nnorm=1e7)
# }
# For MCestimLFSM() it is vital that the estimator returns a list of named parameters
H_hat_f <- function(p,k,path) {hh<-H_hat(p,k,path); list(H=hh)}
theor_3_1_H_clt<-MCestimLFSM(s=S,fr='H',Nmc=NmonteC,
m=m,M=M,alpha=alpha,H=H,
sigma=sigma,H_hat_f,
p=p,k=k)
# The estimator can return one, two or three of the parameters.
est_1 <- function(path) list(H=1)
theor_3_1_H_clt<-MCestimLFSM(s=S,fr='H',Nmc=NmonteC,
m=m,M=M,alpha=alpha,H=H,
sigma=sigma,est_1)
est_2 <- function(path) list(H=0.8, alpha=1.5)
theor_3_1_H_clt<-MCestimLFSM(s=S,fr='H',Nmc=NmonteC,
m=m,M=M,alpha=alpha,H=H,
sigma=sigma,est_2)
est_3 <- function(path) list(sigma=5, H=0.8, alpha=1.5)
theor_3_1_H_clt<-MCestimLFSM(s=S,fr='H',Nmc=NmonteC,
m=m,M=M,alpha=alpha,H=H,
sigma=sigma,est_3)
Run the code above in your browser using DataLab