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

if result is 1-row data.table, use those as more.units #44

Closed
tdhock opened this issue Apr 16, 2024 · 1 comment · Fixed by #47
Closed

if result is 1-row data.table, use those as more.units #44

tdhock opened this issue Apr 16, 2024 · 1 comment · Fixed by #47

Comments

@tdhock
Copy link
Owner

tdhock commented Apr 16, 2024

https://github.com/tdhock/angular-change-paper/blob/main/figure-geodesicFPOP-robseg-data.R

@tdhock
Copy link
Owner Author

tdhock commented Apr 16, 2024

library(data.table)
expr.list <- atime::atime_grid(
  list(penalty=10^seq(-1,2)),
  Poisson={
    fit <- PeakSegOptimal::PeakSegFPOP(count.vec, penalty=penalty)
    with(fit, data.table(
      segments=sum(ends.vec >= 0),
      mean.intervals=mean(intervals.mat),
      max.intervals=max(intervals.mat)))
  })
atime.result <- atime::atime(
  verbose=TRUE,
  N=2^seq(2,100),
  setup={
    set.seed(1)
    count.vec <- rpois(N, 50)
  },
  seconds.limit=0.01,
  expr.list=expr.list,
  result=TRUE)

more.dt <- rbindlist(atime.result$meas$result)
atime.result$measurements <- data.table(
  atime.result$measurements,
  more.dt)
plot(atime.result)
atime.refs <- atime::references_best(
  atime.result,
  more.units=names(more.dt))

also integer columns should be acceptable

> atime.refs <- atime::references_best(
+ atime.result,
+ more.units=names(more.dt))
Error in `[.data.table`(data.table(fun.latex = names(fun.list)), , { : 
  Column 2 of result for group 7 is type 'double' but expecting type 'integer'. Column types must be consistent for each group.

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

Successfully merging a pull request may close this issue.

1 participant