Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error was encountered while running the function "fregre.basis.cv()" #5

Open
Mozzie626 opened this issue Aug 23, 2022 · 1 comment
Open

Comments

@Mozzie626
Copy link

Mozzie626 commented Aug 23, 2022

When running the example with the function "fregre.basis.cv()", errors arise as follows. Please contact me if you have any solution to this issue. Thank you very much.

【codes】

data(tecator)
x<-tecator$absorp.fdata[1:129]
y=tecator$y$Fat[1:129]
b1<-c(15,21,31)
b2<-c(7,9)
res1=fregre.basis.cv(x,y,basis.x=b1)
res2=fregre.basis.cv(x,y,basis.x=b1,basis.b=b2)
res1$gcv
res2$gcv
l=2^(-4:10)
res3=fregre.basis.cv(x,y,basis.b=b1,type.basis="fourier",
lambda=l,type.CV=GCV.S,par.CV=list(trim=0.15))
res3$gcv

【errors】
Error in if (class(Minv) != "try-error") { : the condition has length > 1

@Mozzie626
Copy link
Author

The source of this error has been located and I have found a solution to this already. The problem is that the function "Minverse()" used in "fregre.basis.cv()" is wrongly used in R, it should be replaced by the function "solve()".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant