Dear all,
I'm trying to build some fda objects using smooth.pos() from fda package.
Here is what I try:
>X <-c(0.4541139, 0.4802537, 0.5091228, 0.3894931, 2.1512258,
>7.9301281, 62.3876109, 54.1168247, 67.8769904, 91.0670615, 20.0682440)
>basis <- create.bspline.basis(c(-100, 100), 7, 5)
>MDA.fdPar <- fdPar(basis, 2, 0.01)
>MDA.fda.joint <- smooth.pos(argvals=seq(from=-100, to=100, length=11),
>y=X, WfdParobj=MDA.fdPar)
Iter. PENSSE Grad Length
0 1780.78 -1780.78
1 1753.525 14.318
2 1749.296 15.0611
3 1747.625 15.3031
4 1739.389 16.6266
5 1737.713 16.8989
6 1729.524 18.3147
7 1727.862 18.5791
8 1719.89 19.9475
9 1718.21 20.2311
10 1710.436 21.6275
11 1708.752 21.9372
12 1702.136 23.2679
13 1700.604 23.1824
14 1697.774 23.8055
15 1696.296 23.944
16 1691.261 25.1618
17 1689.009 25.2832
18 1688.607 25.1727
19 1685.972 25.798
20 1685.278 25.6813Error in if (any(stepi[index] < bot[index]
- cvec[index]) & any(deltac[index] != :
missing value where TRUE/FALSE needed
Changing the parameters of the basis I can get a fit, but I'm trying to
fit thousands of objects and I haven't found a combination that works for
all of them.
Another question is how to fit simultaneously several fda objects. If I do
>X <- cbind(c(3, 5, 6, 7, 9, 5, 6, 4, 8, 3, 11), X)
>MDA.fda.joint <- smooth.pos(argvals=seq(from=-100, to=100, length=11),
>y=X, WfdParobj=MDA.fdPar)
Results for curve 1
Iter. PENSSE Grad Length
0 31.6364 -31.6364
1 23.6767 3.1061
2 15.9816 3.0551
3 14.4794 2.4754
4 10.2167 2.2024
5 8.462 1.8876
6 7.1204 1.8919
7 6.7124 1.8915
8 6.5114 1.9193
9 6.3748 1.864
Error: subscript out of bounds
Would someone in the list help me with these errors?
Cheers,
Oscar
Oscar M. Rueda, PhD.
Postdoctoral Research Fellow, Caldas Lab, Breast Cancer Functional
Genomics.
University of Cambridge. Cancer Research UK Cambridge Institute.
Li Ka Shing Centre, Robinson Way.
Cambridge CB2 0RE
England
Please note that my email address will be changing to:
Oscar.Rueda at cruk.cam.ac.uk