@@ -70,14 +70,33 @@ fRegressArgCheck <- function(yfd, xfdlist, betalist, wt=NULL) {
70
70
# "variables are scalar."))
71
71
}
72
72
73
- # -------------------- check contents of XFDLIST -------------------
73
+
74
+
75
+ # -------------------- check contents of BETALIST -------------------
76
+
77
+ berror <- FALSE
78
+ for (j in 1 : p ) {
79
+ betafdParj <- betalist [[j ]]
80
+ if (inherits(betafdParj , " fd" ) || inherits(betafdParj , " basisfd" )) {
81
+ betafdParj <- fdPar(betafdParj )
82
+ betalist [[j ]] <- betafdParj
83
+ }
84
+ if (! inherits(betafdParj , " fdPar" )) {
85
+ print(paste(" BETALIST[[" ,j ," ]] is not a FDPAR object." ))
86
+ berror <- TRUE
87
+ }
88
+ }
89
+
90
+
91
+
92
+
93
+ # -------------------- check contents of XFDLIST -------------------
74
94
75
95
# If the object is a vector of length N,
76
96
# it is converted to a functional data object with a
77
97
# constant basis
78
98
79
- onebasis <- create.constant.basis(rangeval )
80
- onesfd <- fd(1 ,onebasis )
99
+
81
100
82
101
xerror <- FALSE
83
102
for (j in 1 : p ) {
@@ -106,30 +125,22 @@ fRegressArgCheck <- function(yfd, xfdlist, betalist, wt=NULL) {
106
125
print(paste(" Matrix in XFDLIST[[" ,j ," ]] has more than one column." ))
107
126
xerror = TRUE
108
127
}
109
- xfdlist [[j ]] <- fd(matrix (xfdj ,1 ,N ), onebasis )
128
+ xfdlist [[j ]] <- fd(matrix (xfdj ,1 ,N ), betalist [[ j ]] $ fd $ basis )
110
129
}
111
130
if (! (inherits(xfdlist [[j ]], " fd" ) ||
112
131
inherits(xfdlist [[j ]], " numeric" ) ||
113
132
inherits(xfdlist [[j ]], " matrix" ))) {
114
133
print(paste(" XFDLIST[[" ,j ," ]] is not an FD or numeric or matrix object." ))
115
134
xerror = TRUE
116
135
}
117
- }
136
+ }
137
+
138
+
139
+
140
+
141
+
118
142
119
- # -------------------- check contents of BETALIST -------------------
120
143
121
- berror <- FALSE
122
- for (j in 1 : p ) {
123
- betafdParj <- betalist [[j ]]
124
- if (inherits(betafdParj , " fd" ) || inherits(betafdParj , " basisfd" )) {
125
- betafdParj <- fdPar(betafdParj )
126
- betalist [[j ]] <- betafdParj
127
- }
128
- if (! inherits(betafdParj , " fdPar" )) {
129
- print(paste(" BETALIST[[" ,j ," ]] is not a FDPAR object." ))
130
- berror <- TRUE
131
- }
132
- }
133
144
134
145
if (xerror || berror ) stop(
135
146
" An error has been found in either XFDLIST or BETALIST." )
0 commit comments