est_cfarh: Estimation of a CFAR Process with Heteroscedasticity and...

Description Usage Arguments Value References Examples

Description

Estimation of a CFAR process with heteroscedasticity and irregualr observation locations.

Usage

1
2
est_cfarh(f, weight, p = 2, grid = 1000, df_b = 5, num_obs = NULL,
  x_pos = NULL)

Arguments

f

the functional time series.

weight

the covariance functions of noise process.

p

CFAR order.

grid

the number of gird points used to constrct the functional time series and noise process. Default is 1000.

df_b

the degrees of freedom for natural cubic splines. Default is 10.

num_obs

the numbers of observations. It is a t-by-1 vector, where t is the length of time.

x_pos

the observation location matrix. If the locations are regular, it is a t-by-(n+1) matrix with all entries 1/n.

Value

The function returns a list with components:

phi_coef

estimated spline coefficients for convluaional function(s).

phi_func

estimated convoluational function(s).

rho

estimated rho for O-U process (noise process).

sigma

estimated sigma for O-U process (noise process).

References

Liu, X., Xiao, H., and Chen, R. (2016) Convolutional autoregressive models for functional time series. Journal of Econometrics, 194, 263-282.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
phi_func1= function(x){
return(0.5*x^2+0.5*x+0.13)
}
phi_func2= function(x){
return(0.7*x^4-0.1*x^3-0.15*x)
}
grid=1000
testh=g_cfar2h(100,grid,1,40,5,phi_func1=phi_func1,phi_func2=phi_func2)
#obtain discret observations
f_grid=testh$cfar2h
num_obs=testh$num_obs
x_pos=testh$x_pos
t=dim(f_grid)[1]
n=max(num_obs)
index=matrix(0,t,n)
x_grid=seq(0,1,by=1/grid)
b_grid=seq(-1,1,by=1/grid)
f=matrix(0,t,n)
for(i in 1:t){
for(j in 1:num_obs[i]){
	index[i,j]=which(abs(x_pos[i,j]-x_grid)==min(abs(x_pos[i,j]-x_grid)))
}
f[i,1:num_obs[i]]=f_grid[i,index[i,1:num_obs[i]]];
}
weight0= function(w){
return((w<=0.6)*exp(-10*w)+(w>0.6)*(exp(-6)+0.2*(w-0.6))+0.1);
}
const=sum(weight0(x_grid)/(grid+1))
weight= function(w){
return(((w<=0.6)*exp(-10*w)+(w>0.6)*(exp(-6)+0.2*(w-0.6))+0.1)/const)
}
est=est_cfarh(f,weight,2,1000,5,num_obs,x_pos)
par(mfrow=c(1,2))
c1=range(est$phi_func)
plot(b_grid,phi_func1(b_grid),type='l',col='red',ylim=c1*1.05)
points(b_grid,est$phi_func[1,],type='l')
c1=range(est$phi_func)
plot(b_grid,phi_func2(b_grid),type='l',col='red',ylim=c1*1.05)
points(b_grid,est$phi_func[2,],type='l')
cat("rho: ",est$rho,"\n")
cat("sigma2: ",est$sigma2,"\n")

ConvFuncTimeSeries/test_t documentation built on May 29, 2019, 1:39 p.m.