Skip to content
Prev 366974 / 398506 Next

Help with implementing Whittaker-Henderson graduation for raw-data

Good day!

I eventually was able to make the code anyway. Here it is:

getwd()
setwd("C:/R")
datafile <- read.table("test_file.txt", header = TRUE)
library(SparseM)
var2 = datafile$y
d = 2
lambda = 1600
    require(SparseM, warn.conflicts = FALSE)
    m <- length(var2)
    E <- as(m, "matrix.diag.csr")
    class(E) <- "matrix.csr"
    Dmat <- diff(E, differences = d)
    B <- E + (lambda * t(Dmat) %*% Dmat)
    z <- solve(B, var2)
    z
write.table(z, "C:/R/test.txt", sep="\t")  

(then transfer the results to Excel and that's it)

Now, my problem is: 

I'd like to use the following command:
    z2 <- whittaker(var2, lambda, d)
    z2
which will reveal the results using the whittaker function itself. 

However, when I use this command
    library(pracma)
I get the following error:
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck =
vI[[j]]) : 
  there is no package called 'quadprog'
Error: package or namespace load failed for 'pracma'

So this must mean that I should have quadprog, but when I tried
    library(quadprog)
before library(pracma), I get the following error:
Error in library(quadprog) : there is no package called 'quadprog'

I'd like to get around these so I can use the whittaker function itself. How
can I do this? Thank you very much.

Regards,

Percy

-----Original Message-----
From: Berend Hasselman [mailto:bhh at xs4all.nl] 
Sent: Friday, February 3, 2017 2:08 AM
To: Percival Bueser
Cc: r-help at r-project.org
Subject: Re: [R] Help with implementing Whittaker-Henderson graduation for
raw-data


Why don't you just try the function whittaker from the pracma R package?
There is an example which should be adequate for finding out what to do.

Berend Hasselman
wrote:
y's
which
http://www.R-project.org/posting-guide.html