I've tried grouping the real and imaginary parts as a single complex number,
e.g.

> z1 <- complex(real=r1, imaginary=i1)

Although complex variables are not allowed in lm, I can run regsubsets just
fine:

> z <- cbind(z1, z2, z3, ..., z10)
> bestsubs <- regsubsets(z, y, nbest=1, nvmax=5, intercept=T,
> method="exhaustive", names=dimnames(x)[2])

The problem is that the code is using only one coefficient for each "z"
(probably for the amplitude), and not one for the real part and one for the
imaginary part, as I'd like to.

> coef(bestsubs,3)
(Intercept)         z1         z3         z4 
 -397.43425   -35.86687   202.20521   716.02103 

Any suggestions?

Thanks
-- 
View this message in context: 
http://r.789695.n4.nabble.com/regsubsets-leaps-tp3318418p3319938.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to