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

tfb edge cases #139

Open
m-muecke opened this issue Nov 10, 2024 · 1 comment
Open

tfb edge cases #139

m-muecke opened this issue Nov 10, 2024 · 1 comment
Assignees

Comments

@m-muecke
Copy link
Collaborator

  • the printer with length one seems wrong (nothing comes after using)
  • length one tfb can't be created
  • length two tfb gives an error from another package
tf::tfb()
#> tfb[0] on (0,0) in basis representation:
#>  using
tf::tfb(1)
#> Error in new_tfb_spline(data, domain = domain, penalized = penalized, : Assertion on 'domain' failed: Contains duplicated values, position 2.
tf::tfb(1:2)
#> Warning in smooth.construct.cr.smooth.spec(s_spec, data = data_frame(arg = arg_u$x, : basis dimension, k, increased to minimum possible
#> Error in smooth.construct.cr.smooth.spec(s_spec, data = data_frame(arg = arg_u$x, : arg has insufficient unique values to support 3 knots: reduce k.
tf::tfb(1:3)
#> Percentage of input data variability preserved in basis representation
#> (per functional observation, approximate):
#> Min. 1st Qu.  Median Mean 3rd Qu.  Max.
#> 100 100 100 100 100 100
#> tfb[1] on (1,3) in basis representation:
#>  using  s(arg, bs = "cr", k = 3, sp = -1)  
#> 1: (1,1);(2,2);(3,3)

Created on 2024-11-10 with reprex v2.1.1

@fabian-s fabian-s self-assigned this Nov 11, 2024
@fabian-s
Copy link
Contributor

🙈 thanks!

  • re print statement for empty tfb: I can live with that.

  • re tfb of length 1 with just 1 or 2 args: a basis rep just can't make sense for these/can't be computed sensibly.
    inclined towards returning an error here, even if this looks superficially inconsistent with allowing empty tfbs.
    I'll take a closer look at this myself.

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

2 participants