2

I have found the article by Fryzlewicz (2007) and his R package unbalhaar.

I do not understand well the outputs of his functions and in particular of the best.unbal.haar.bu() function. Here is the documentation of it : best.unbal.haar.bu.

From his article, I have understood that the $smooth argument is the constant factor, and that $detail[1,] is the location of the coefficients and $detail[3,] is the value of the coefficients.

But I do not see what could be $detail[2,] called "weights" in the documentation...

Does anyone know about this work and know what it is ?

Thank you for your help.

PS : I have not posted this question on stackoverflow because I think it is more about the maths than about the coding thing.

Pop
  • 1,446
  • 9
  • 21

1 Answers1

2

I don't know enough about the work to give a complete answer, but the number in detail[2,] is one of the numbers denoted $a_{p,q}$ or $b_{q+1,r}$ on page 17 of the paper. I am not sure which, but you should be able to find out by working through an example.

To get this, you can look at the reconstr.bu function, which reconstructs the original signal from the output of the best.unbal.haar.bu function. Say that your signal is x and y = best.unbal.haar.bu(x). Then the source code of reconstr.bu shows how x is recovered from y$smooth and y$detail

 function (buh.bu) 
        {
            y <- buh.bu
            n <- dim(y$detail)[2] + 1
                x <- y$smooth
            detail <- y$detail
            for (i in 1:(n - 1)) {
                ind <- round(detail[1, n - i])
                x[(ind + 2):n] <- x[(ind + 1):(n - 1)]
                new.left <- detail[2, n - i] * x[ind] + sqrt(1 - detail[2, 
                    n - i]^2) * detail[3, n - i]
                new.right <- sqrt(1 - detail[2, n - i]^2) * x[ind] - 
                    detail[2, n - i] * detail[3, n - i]
                x[ind] <- new.left
                x[ind + 1] <- new.right
            }

        return(x)
    }

You can see where detail[2, n - i] enters into the code, and its clear that one of detail[2, n - i] and sqrt(1 - detail[2, n - i]^2) is $a_{p,q}$ and the other is $b_{q+1,r}$. Only one of them needs to be stored in y because the sum of their squares is $1$. (See 2(b) on p17 of the paper.) The columns of y$detail are the detail filters into which the signal x is broken. The signal can be completely recovered from this set of detail filters.

I hope this is of some help. I made it an answer because it's too long to be a comment.

Flounderer
  • 9,575
  • 1
  • 32
  • 43
  • Thank you very much. Your answer helped mr but it is only a part of the answer I am searching for. – Pop Mar 18 '13 at 08:44