Description Usage Arguments Value References Examples
F test for a CFAR process with heteroscedasticity and irregular observation locations to specify the CFAR order.
1 2 | F_test_cfarh(f, weight, p.max = 3, grid = 1000, df_b = 10,
num_obs = NULL, x_pos = NULL)
|
f |
the functional time series. |
weight |
the covariance functions for noise process. |
p.max |
maximum CFAR order. Default is 3. |
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. |
The function outputs F test statistics and their p-values.
Liu, X., Xiao, H., and Chen, R. (2016) Convolutional autoregressive models for functional time series. Journal of Econometrics, 194, 263-282.
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 | 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)
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)
}
F_test_cfarh(f,weight,3,1000,5,num_obs,x_pos)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.