Open creutzml opened 2 years ago
The first issue is avoided relatively easy, with using eval.fd
and specifying the grid points manually to match the length of grid.size
. But it may be useful to add a helpful error for this issue.
Haven't fully investigated the plot issue
In my own iteration, I moved rownames(band) <- seq(from = 0, to = 1, len = nrow(band))
under the first if (type=="vector")
block of code.
However, the next issue was that the code produced a plot with only the upper band plotted. This comes from line 58 in the original code. Changing this to be
fda::plot.fd(band,col=col[1],lwd=lwd[1],lty=lty[1],add=TRUE)
plots everything (removed the [1]
indexing on band
), but then color schemes don't quite work out well. I will play with this some, but another concern is for when there's just a single sided band plotted.
In my own iteration, I moved
rownames(band) <- seq(from = 0, to = 1, len = nrow(band))
under the firstif (type=="vector")
block of code.However, the next issue was that the code produced a plot with only the upper band plotted. This comes from line 58 in the original code. Changing this to be
fda::plot.fd(band,col=col[1],lwd=lwd[1],lty=lty[1],add=TRUE)
plots everything (removed the[1]
indexing onband
), but then color schemes don't quite work out well. I will play with this some, but another concern is for when there's just a single sided band plotted.
This issue is compounded... plot.fd
from the fda
package has an error in its plotting that needs to be corrected. When the fd
object has coefficients of dimension 2, ndim==2
, plot.fd
does not allow the user to change the color at all. I submitted a Pull request for that function. However, the changes to plot.confidence_band
cannot really be made until plot.fd
is corrected.
grid.size
, else the estimated mean will be of different length than the band created, and an error will be tripped: for exampleError in cbind(result, x.v + FFSCB.t, x.v - FFSCB.t) : dims [product 200] do not match the length of object [14400]
tt
is set equal tolength(tau)
and then used inufun
to determine the length of the bandsfd
objects to create the band, then an error is tripped byplot.confidence_band
: for exampleError in seq.default(from = 0, to = 1, len = nrow(band)) : argument 'length.out' must be of length 1
NULL
when returned as anfd
object, yet line two in the body of the function isrownames(band) <- seq(from = 0, to = 1, len = nrow(band))
Thus, it immediately trips an error and does not execute anything more