Simple Test Example for DLResid

Simple Example

> z<-1:5
> z
[1] 1 2 3 4 5
> DLResid(1/z, z)
Error: couldn't find function "DLResid"
> DLResiduals(1/z, z)
[1] 1.000000 1.732051 2.323790 2.861920 3.368777

Suggested Driver R Function

Obviously I can't test this until I have the DLL

> GetDLResid
function(r, z )
# vector of autocovariances
# vector of data
{
    if (length(r)!=length(z)) 
        stop("Error: arguments must be same length")
    n<-length(z)
    error<-numeric(n)
    out<-.C("DLResid", as.double(z), as.double(error), as.integer(length(n)), as.double(r), fault = as.integer(1) )
    fault<-out$fault
    if (fault == 1) 
            stop("error: sequence not p.d.")
    out$error
}

To Load DLL - Recall you need something like this:

dyn.load( "d:/r/2006/Trench/TrenchQFR/Release/TrenchQFR.dll" )