Skip to content

Commit

Permalink
correction uneven space
Browse files Browse the repository at this point in the history
  • Loading branch information
william-denault committed Aug 22, 2024
1 parent a2d8af6 commit bd75659
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Encoding: UTF-8
Type: Package
Package: fsusieR
Version: 0.2.78
Version: 0.2.79
Date: 2024-07-11
Title: Sum of Single Functions
Authors@R: person("William R. P.","Denault",role = c("aut","cre"),
Expand Down
8 changes: 6 additions & 2 deletions R/operation_on_susiF_obj.R
Original file line number Diff line number Diff line change
Expand Up @@ -1028,6 +1028,8 @@ name_cs.susiF <- function(obj,X,...){
#' @param filter_cs logical, if TRUE filter the credible set (removing low purity cs and cs with estimated prior equal to 0)
#
#' @param outing_grid grid use to fit fsusie
#'
#' @param pos the original position of the Y column
#' @return susiF object
#
#' @export
Expand Down Expand Up @@ -1056,6 +1058,7 @@ out_prep.susiF <- function(obj ,
HMM=FALSE,
tidx =NULL ,
names_colX =NULL,
pos,
...)
{

Expand Down Expand Up @@ -1098,8 +1101,9 @@ out_prep.susiF <- function(obj ,
obj <- rename_format_output (obj = obj,
names_colX = names_colX,
tidx = tidx)
obj$outing_grid <- outing_grid
obj$purity <- cal_purity(l_cs= obj$cs, X=X)
obj$outing_grid <- outing_grid
obj$purity <- cal_purity(l_cs= obj$cs, X=X)
obj$original_grid <- pos
return(obj)
}

Expand Down
3 changes: 2 additions & 1 deletion R/susiF.R
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,8 @@ susiF <- function(Y, X, L = 2,
TI = TI,
HMM = HMM,
tidx = tidx,
names_colX = names_colX
names_colX = names_colX,
pos = pos
)
obj$runtime <- proc.time()-pt
return(obj)
Expand Down
4 changes: 2 additions & 2 deletions R/wavelet_utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ interpol_mat <- function(Y, pos, max_scale=10)
y = 1:dim(Y)[2],
gridn = min( 2^max_scale,
2^(floor(log(length(pos)-1,2)) + 1) )
)$gridy
grid <- (grid - min(grid) )*length(grid)/(max(grid)- min(grid))# * (max(bp)- min(bp))/ (max(grid)- min(grid))
)$gridt
grid <- (grid - min(grid) )*length(grid)/(max(grid)- min(grid)) #* (max(bp)- min(bp))/ (max(grid)- min(grid))
out <- list(Y = Y_new,
grid = grid,
bp = bp)
Expand Down
3 changes: 3 additions & 0 deletions man/out_prep.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified tests/testthat/Rplots.pdf
Binary file not shown.
4 changes: 2 additions & 2 deletions vignettes/fsusie_intro.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ set.seed(2)
data(N3finemapping)
f1 <- simu_IBSS_per_level(9)$sim_func
f2 <- simu_IBSS_per_level(9)$sim_func
pos <- sort(sample(512,36))
pos <- sort(sample(512,130))
par(mar = c(2,2,2,2))
plot(f2,type = "l",lwd = 1.25)
points(pos,f2[pos],col = "black",pch = 20,cex = 0.75)
Expand All @@ -235,7 +235,7 @@ The only change to the call to susiF is that we now also provide the
sampling positions:

```{r run-susiF-uneven, results="hide"}
fit <- susiF(Y,X,L = 10,pos)
fit <- susiF(Y,X,L = 10,pos=pos)
```

To visualize the estimated effects, again we can use the
Expand Down

0 comments on commit bd75659

Please sign in to comment.