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

ROBUSTNESS: Partial element names in jointseg:::ERMadjustment() #8

Open
HenrikBengtsson opened this issue Feb 12, 2018 · 0 comments
Open

Comments

@HenrikBengtsson
Copy link

Another one, cf #7;

> options(warnPartialMatchDollar = TRUE)
> library("c3co")
> library("c3co.data")
> data("PSCBSdata", package = "c3co.data")
> segDat <- PSCBSwrapper(PSCBSdata, stat = "C1C2")
Warning messages:
1: In model$coefficient : partial match of 'coefficient' to 'coefficients'
2: In dpseg$bkp : partial match of 'bkp' to 'bkpList'
3: In dpseg$bkp : partial match of 'bkp' to 'bkpList'
4: In model$coefficient : partial match of 'coefficient' to 'coefficients'
5: partial match of 'bkp' to 'bkpList' 
6: partial match of 'bkp' to 'bkpList' 

Troubleshooting

> options(warn = 2)
> segDat <- PSCBSwrapper(PSCBSdata, stat = "C1C2")
Error in model$coefficient : 
(converted from warning) partial match of 'coefficient' to 'coefficients'
> traceback()
9: doWithOneRestart(return(expr), restart)
8: withOneRestart(expr, restarts[[1L]])
7: withRestarts({
       .Internal(.signalCondition(simpleWarning(msg, call), msg, 
           call))
       .Internal(.dfltWarn(msg, call))
   }, muffleWarning = function() NULL)
6: .signalSimpleWarning("partial match of 'coefficient' to 'coefficients'", 
       quote(model$coefficient))
5: ERMadjustment(rse, n)
4: modelSelection(dpseg$rse, n = nDp, method = modelSelectionMethod)
3: jointSeg(Y = dataToSeg[ww, ], method = "RBS", K = 100, modelSelectionMethod = "Birge")
2: segmentData(dat, stat = stat)
1: PSCBSwrapper(PSCBSdata, stat = "C1C2")

This seems to be in:

> jointseg:::ERMadjustment
function (ERM, n) 
{
    D <- length(ERM)
    ind <- (D%/%2):D
    y <- ERM[ind]/n
    var <- ind
    model <- stats::lm(y ~ var)
    lambda <- -model$coefficient["var"] * n
    return(lambda)
}
<environment: namespace:jointseg>
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

No branches or pull requests

1 participant