0

I need to use MBD (modified band depth) in an fd object but it's getting complicated. I've been trying to extract data from my fd object but I can't find them although I get results when applying some functions. The issue is that I have two fd databases and I need to iteratively paste them, so fd data is not useful. Does anyone know how to turn a fd object into fData object.

Thank you so much.

  • 1
    Welcome to SO. Can you please provide some [example data and code](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) (and context) to illustrate the issue. I for one have no idea what an MBD is, nor do I know about `fd`/`fData` objects/databases. We're all here to give and seek help, so generally you'll be able to address many more potential helpers if you give context and code. – Maurits Evers Jun 03 '18 at 04:46

1 Answers1

0

Right. fd and fData are objects for functional data and I have two functional datasets in fd objects, say X and Y. I need to compute Modified Band Depth (MBD) of these data including each observation of the other. I mean, for each curve in X I have to create a functional dataset combining all the observations in Y with the observation in X. I need to do this several times, and the problem is that MBD function is only available for fData objects. I haven´t been able to make the conversion from fd to fData.

SE_hat_U<-fd(basisobj=BSpl)

for(i in 1:61){
SE_hat_U$coefs<-cbind(SE_hat_U$coefs, sm[[i]]$fd$coefs)
}

SE_hat_U$fdnames$reps<-(1:61)
X<-SE_hat_U[as.numeric(NT$Id)]
Y<-SE_hat_U[!datos$Id%in%(NT$Id)]

This is the code I have but i don't know how to turn SE_hat_U into a fData object instead of a fd one.

  • Did you ever resolve this? I'm in a similar situation at the moment, trying to convert fd object to fdata object – Betty Sep 01 '21 at 15:53