Description Usage Arguments Value Examples
View source: R/Fitting_algorithm.R
Main fitting algorithm of FSPDM method
| 1 2 3 | train_function(Data_generated, Eig_num, k, beta, theta, sigma2,
  lambda1 = 0, lambda2 = 0, lambda3 = 0, lambda4 = 0,
  testIndexes = NULL, sigma2_list = NULL, maxout = 1)
 | 
| Data_generated | a list constaining the observed value of functional data, covariates and penalty matrix | 
| Eig_num | the number of eigenfunction users want to use | 
| k | dimension of spline basis with respect to covariate in eigenfunctions | 
| beta | the start point of beta parameters, can be set with all zeros | 
| theta | the start point of theta parameters, can be set with all zeros | 
| sigma2 | the start point of sigma2 parameters, can be set with small positive value | 
| lambda1 | the tuning parameters of smoothness penalty with respect to t in mean function | 
| lambda2 | the tuning parameters of smoothness penalty with respect to covariate in mean function | 
| lambda3 | the tuning parameters of smoothness penalty with respect to t in eigenfunction | 
| lambda4 | he tuning parameters of smoothness penalty with respect to covariate in eigenfunction | 
| testIndexes | test Index if use cv | 
| sigma2_list | measurement error if have | 
| maxout | algorithm setting, default 1 | 
a list constains all estimator of SFPDM method
| 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 | tmin = 0 # the start point of the curve
tmax = 1 # the end point of the curve, i.e. the cuvre's regin is from tmin to tmax
ymin = 0 # the minimum of the covariates
ymax = 1 # the maximum of the covariate
num_bin = 20 # number of bin in initial steps of our algorithm
order = 4 # spline order
nknots =8 # number of knots
splineObj_t = new(orthoSpline,tmin,tmax,order,nknots)
# degree freedom of spline basis
M1 = splineObj_t$getDoF()
## basis with respect to y to get the tensor product basis
yknots = 3
splineObj_y = new(orthoSpline,ymin,ymax,order,(yknots))
# degree freedom of spline basis
M2 = splineObj_y$getDoF()
## basis with d that is in matrix C
# basis with respect y (d^T), in C matrix
dknots = 5
splineObj_d = new(orthoSpline,ymin,ymax,order,dknots)
# degree freedom of spline basis
M3 = splineObj_d$getDoF()
k = M3
Spline_func = c(splineObj_t,splineObj_d,splineObj_y)
## set the number of principle components
Eig_num = r =  3
## the the number of spline basis used
## spline basis for t
M1 = 10
M2 = 5
M3 = k = 7
theta = rep(0,M1*M2)
sigma2 = 0.01
beta = rep(0,r*M1*M3)
parameter_best = train_function (Data_generated = Data_generated,Eig_num = Eig_num,k = k, beta = beta,theta = theta,sigma2 = sigma2)
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.