[Depmix-commits] r637 - in pkg: . cusp cusp/R cusp/data cusp/inst cusp/man cusp/src cusp/vignettes cusp/vignettes/plaatjes

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Sep 29 14:59:45 CEST 2014


Author: ingmarvisser
Date: 2014-09-29 14:59:44 +0200 (Mon, 29 Sep 2014)
New Revision: 637

Added:
   pkg/cusp/
   pkg/cusp/DESCRIPTION
   pkg/cusp/MD5
   pkg/cusp/NAMESPACE
   pkg/cusp/R/
   pkg/cusp/R/between.R
   pkg/cusp/R/confint.cusp.R
   pkg/cusp/R/cusp.Like.R
   pkg/cusp/R/cusp.R
   pkg/cusp/R/cusp.bifset.R
   pkg/cusp/R/cusp.curve.R
   pkg/cusp/R/cusp.expected.R
   pkg/cusp/R/cusp.extrema.R
   pkg/cusp/R/cusp.fit.R
   pkg/cusp/R/cusp.inflexions.R
   pkg/cusp/R/cusp.logLike.R
   pkg/cusp/R/cusp.logist.R
   pkg/cusp/R/cusp.logist.fit.R
   pkg/cusp/R/cusp.logist.objf.R
   pkg/cusp/R/cusp.logist.objf.old.R
   pkg/cusp/R/cusp.nc.C.R
   pkg/cusp/R/cusp.nc.R
   pkg/cusp/R/cusp.nc.c_1.R
   pkg/cusp/R/cusp.nc.vec.R
   pkg/cusp/R/cusp.nlogLike.R
   pkg/cusp/R/cusp.nlogLike.c.R
   pkg/cusp/R/cusp.nlogLike.c2.R
   pkg/cusp/R/cusp.probeersel.R
   pkg/cusp/R/cusp.subspacerss.R
   pkg/cusp/R/cusp.support.R
   pkg/cusp/R/cusp3d.R
   pkg/cusp/R/cusp3d.surface.R
   pkg/cusp/R/cuspfit.R
   pkg/cusp/R/cuspian.R
   pkg/cusp/R/dcusp.R
   pkg/cusp/R/dcusp.unnorm.R
   pkg/cusp/R/draw.cusp.bifset.R
   pkg/cusp/R/format.perc.R
   pkg/cusp/R/pcusp.R
   pkg/cusp/R/plot.cusp.R
   pkg/cusp/R/plotCuspBifurcation.R
   pkg/cusp/R/plotCuspDensities.R
   pkg/cusp/R/plotCuspResidfitted.R
   pkg/cusp/R/print.cusp.R
   pkg/cusp/R/print.summary.cusp.R
   pkg/cusp/R/qcusp.R
   pkg/cusp/R/rcusp.R
   pkg/cusp/R/seq_range.R
   pkg/cusp/R/summary.cusp.R
   pkg/cusp/R/vcov.cusp.R
   pkg/cusp/data/
   pkg/cusp/data/attitudeStartingValues.rda
   pkg/cusp/data/attitudes.rda
   pkg/cusp/data/oliva.rda
   pkg/cusp/data/zeeman1.rda
   pkg/cusp/data/zeeman2.rda
   pkg/cusp/data/zeeman3.rda
   pkg/cusp/inst/
   pkg/cusp/inst/CITATION
   pkg/cusp/inst/doc/
   pkg/cusp/man/
   pkg/cusp/man/attitudes.Rd
   pkg/cusp/man/cusp-package.Rd
   pkg/cusp/man/cusp.Rd
   pkg/cusp/man/cusp.bifset.Rd
   pkg/cusp/man/cusp.extrema.Rd
   pkg/cusp/man/cusp.logist.Rd
   pkg/cusp/man/cusp.nc.Rd
   pkg/cusp/man/cusp.nlogLike.Rd
   pkg/cusp/man/cusp3d.Rd
   pkg/cusp/man/cusp3d.surface.Rd
   pkg/cusp/man/dcusp.Rd
   pkg/cusp/man/draw.cusp.bifset.Rd
   pkg/cusp/man/oliva.Rd
   pkg/cusp/man/plot.cusp.Rd
   pkg/cusp/man/plotCuspBifurcation.Rd
   pkg/cusp/man/plotCuspDensities.Rd
   pkg/cusp/man/plotCuspResidfitted.Rd
   pkg/cusp/man/summary.cusp.Rd
   pkg/cusp/man/vcov.cusp.Rd
   pkg/cusp/man/zeeman.Rd
   pkg/cusp/src/
   pkg/cusp/src/cusp.nc.c
   pkg/cusp/vignettes/
   pkg/cusp/vignettes/Cusp-JSS.Rnw
   pkg/cusp/vignettes/Cusp-JSS.pdf
   pkg/cusp/vignettes/DSC02462.JPG
   pkg/cusp/vignettes/cusp-hands-on-examples.Rnw
   pkg/cusp/vignettes/cusp-hands-on-examples.pdf
   pkg/cusp/vignettes/cusp_papers_jss.bib
   pkg/cusp/vignettes/plaatjes/
   pkg/cusp/vignettes/plaatjes/attudefitplot.pdf
   pkg/cusp/vignettes/plaatjes/cusp-surface-R.pdf
   pkg/cusp/vignettes/plaatjes/cuspdens-JSSv2.pdf
   pkg/cusp/vignettes/plaatjes/oliva3Dplot-new.pdf
   pkg/cusp/vignettes/plaatjes/oliva3Dplot.pdf
   pkg/cusp/vignettes/plaatjes/olivabifurcationplot.pdf
Log:
Cusp package added

Added: pkg/cusp/DESCRIPTION
===================================================================
--- pkg/cusp/DESCRIPTION	                        (rev 0)
+++ pkg/cusp/DESCRIPTION	2014-09-29 12:59:44 UTC (rev 637)
@@ -0,0 +1,13 @@
+Package: cusp
+Type: Package
+Title: Cusp Catastrophe Model Fitting Using Maximum Likelihood
+Version: 2.3
+Date: 2014-09-29
+Author: Raoul P. P. P. Grasman
+Maintainer: Raoul Grasman <rgrasman at uva.nl>
+Suggests: onion
+Description: Package for cusp catastrophe modeling using Cobb's maximum
+        likelihood method. Contains several utility functions for
+        plotting, and for comparing the model to linear regression and
+        logistic curve models.
+License: GPL-2


Property changes on: pkg/cusp/DESCRIPTION
___________________________________________________________________
Added: svn:eol-style
   + native

Added: pkg/cusp/MD5
===================================================================
--- pkg/cusp/MD5	                        (rev 0)
+++ pkg/cusp/MD5	2014-09-29 12:59:44 UTC (rev 637)
@@ -0,0 +1,87 @@
+d7a207ac66f2730c5303bf32f06e7bb2 *DESCRIPTION
+30e3ca570fe02bdb2c10faf47d6be599 *NAMESPACE
+6af85237c4dc397cdcc16e33f3be092a *R/between.R
+0039db26b6cdebba2e04c3106314911e *R/confint.cusp.R
+e5bef8c9c080e1db34977aa252b37cd7 *R/cusp.Like.R
+3f461bd3debc8224ad858c9e792d7abb *R/cusp.R
+c112bf96c26a9e6b558a301b58385726 *R/cusp.bifset.R
+68e7c3a4cd0027458a1307fc2cf0c3ae *R/cusp.curve.R
+b0850ada91baa52e1906c7f8e42e4023 *R/cusp.expected.R
+3c80f210bbaac7d846d1265d49be5f33 *R/cusp.extrema.R
+a4b292fbd18d32b8a644fb8a38b81aaa *R/cusp.fit.R
+bd6e5dd34e8666c5dfe1503c81be1f61 *R/cusp.inflexions.R
+ba2cf4d4e07b28ee853f363f634a6a13 *R/cusp.logLike.R
+776893958dba4553029754ebf58ed3c1 *R/cusp.logist.R
+4fe5dd01c02aab385c2ec1a4a7a3416d *R/cusp.logist.fit.R
+62c0d40dc3afcbe74ed14305d2837f6b *R/cusp.logist.objf.R
+3ac7ea0166c96c1309d603bd3f7b13ef *R/cusp.logist.objf.old.R
+7a780c98a50a41b16715eb438a74ce7c *R/cusp.nc.C.R
+e9f4321c2d17a00dda865a88a27d95c1 *R/cusp.nc.R
+7e5482b0181e991db94a4965b33dde74 *R/cusp.nc.c_1.R
+94b100a39a456a2065f1d04dbe82b67f *R/cusp.nc.vec.R
+5830676529f7b89bd30079ef7b1248c7 *R/cusp.nlogLike.R
+a69cb5a9c35ec8424a0863baba704b24 *R/cusp.nlogLike.c.R
+4c6b895217f09e62ef3a6ed3f5e6058c *R/cusp.nlogLike.c2.R
+b8d26a4d86a3aeee3575efd958b6c75a *R/cusp.probeersel.R
+464fe3eafb6cbfdf4a408358ab1e217f *R/cusp.subspacerss.R
+dcd16e0252324fe4f8100de7bf1de192 *R/cusp.support.R
+798ae82ed08d4edfdd592e5cbd870bd4 *R/cusp3d.R
+7f946211443ab58d6264e5c7736eabb4 *R/cusp3d.surface.R
+0e7151b5c14ff65ca77a64fed5f758d8 *R/cuspfit.R
+fdc863f1b383fde4b3b86f6d0713f863 *R/cuspian.R
+3105add45d46ed27bc43d3f9df176503 *R/dcusp.R
+f88a4bc6cc84ba0088c75f1565a051f5 *R/dcusp.unnorm.R
+bd84f636068d03bf05d5439ff5770104 *R/draw.cusp.bifset.R
+b46826785c1259e6c138a2f074725065 *R/format.perc.R
+72bed47032e0de1591d52f55e67a2eb5 *R/pcusp.R
+e8236361d9263639175a43b8b04cc916 *R/plot.cusp.R
+c2588f9c0ac394d913afa2602adf91e2 *R/plotCuspBifurcation.R
+7a42fcdab586b2d85278f160c70ee8ba *R/plotCuspDensities.R
+a54cda3175ba4611256a9e20024932cb *R/plotCuspResidfitted.R
+ad5d889fb4fbdbb3ff9de637e0ea2860 *R/print.cusp.R
+876bc887953e74566442ed1233967ef0 *R/print.summary.cusp.R
+b1bc345ba03541b5aad925c8e3c7692a *R/qcusp.R
+d93d30f6c32c0346b300736c10b1c076 *R/rcusp.R
+df56b5335568c284521197dea41aaacd *R/seq_range.R
+a42df0cf7a3d9c6854cb39587c6a34e6 *R/summary.cusp.R
+7886ccc06eb317167371f6b31e42f1b8 *R/vcov.cusp.R
+a235944724d814f2e8d62a260b653445 *data/attitudeStartingValues.rda
+38fd93969aad854c808a2ed0d9cd060f *data/attitudes.rda
+bbb1c3c55b771844c5d0a9c7b6e9f4b6 *data/oliva.rda
+3561b82bf5e41d6b8518fd93bc6fedd2 *data/zeeman1.rda
+6d34ac9455e33cbb7abb598a02c9a6db *data/zeeman2.rda
+02d3b988c034d9ceadb5c79f4f617e1f *data/zeeman3.rda
+d64a1170e2540d029523dcbff7517629 *inst/CITATION
+4e767ee0f3d44ee790b93028cfe35dc4 *inst/doc/Cusp-JSS.Rnw
+7cf892d0c459e1e258a8827305623797 *inst/doc/Cusp-JSS.pdf
+710a4ccafefc50e43ee37da3b5804123 *inst/doc/DSC02462.JPG
+7a694d6c87a45a76af9c70b9aa889c1b *inst/doc/cusp-hands-on-examples.Rnw
+5befe51e36737ae556417c9ed99f8f99 *inst/doc/cusp-hands-on-examples.pdf
+f0a34681e56ae1fe02322e20b577ec6c *inst/doc/cusp_papers_jss.bib
+9aa985c4630dfe5aa69776dfffa828cb *inst/doc/plaatjes/attudefitplot.pdf
+c8c5d74ea2a43f9519c315eafc93b058 *inst/doc/plaatjes/cusp-surface-R.pdf
+5246468faadebfc7ea8608a808e380ca *inst/doc/plaatjes/cuspdens-JSSv2.pdf
+032770df01c18cc587918a37e9ecd1aa *inst/doc/plaatjes/oliva3Dplot-new.pdf
+7163e072672fda7c4a415917434bfb8d *inst/doc/plaatjes/oliva3Dplot.pdf
+01af9daae04902a4f0b9162f6abeb51e *inst/doc/plaatjes/olivabifurcationplot.pdf
+2af0d4e92853f598d942d7a3892fa586 *man/attitudes.Rd
+605d1d1b9a5041487122d5172788c3d9 *man/cusp-package.Rd
+d6afedd1eb452d54cae03b0df9bd21e5 *man/cusp.Rd
+6342aaf1b720e812b4752a83bb2e1a0f *man/cusp.bifset.Rd
+4a11fe8ba919939f84c24b26570d18bd *man/cusp.extrema.Rd
+a390c650309dc329c4046a1964483dfe *man/cusp.logist.Rd
+5ca7c2528eee4c42d1c0e336f3789f5f *man/cusp.nc.Rd
+f8df0eb46e470c581a55464dd28df237 *man/cusp.nlogLike.Rd
+bcbc86389f9334799d1bc90a6715a947 *man/cusp3d.Rd
+660cc41742720d97e575ff7cae9fa2cb *man/cusp3d.surface.Rd
+34173040e3b9ec6bfe661b32e56807e5 *man/dcusp.Rd
+fe3c7a467493b009ed678533177afc39 *man/draw.cusp.bifset.Rd
+50862af035552d43b16aec2e17434809 *man/oliva.Rd
+271dd0582e2e3c8b0abdb56daff69f98 *man/plot.cusp.Rd
+78796a92d562a01958829c20f2fba2eb *man/plotCuspBifurcation.Rd
+87aa8dca548e28e77dbdc04ac321852a *man/plotCuspDensities.Rd
+7c9f07239a43065e1ef608b1f7204019 *man/plotCuspResidfitted.Rd
+0708d7b367362d4a101b6d47bb863932 *man/summary.cusp.Rd
+2971335ea9e032b890c1cfbbaf9f4e72 *man/vcov.cusp.Rd
+4c0ab1b47eaefe34c8596814014a2ce1 *man/zeeman.Rd
+9aecdf836047c79b466bcf08c6ed2de3 *src/cusp.nc.c


Property changes on: pkg/cusp/MD5
___________________________________________________________________
Added: svn:eol-style
   + native

Added: pkg/cusp/NAMESPACE
===================================================================
--- pkg/cusp/NAMESPACE	                        (rev 0)
+++ pkg/cusp/NAMESPACE	2014-09-29 12:59:44 UTC (rev 637)
@@ -0,0 +1,12 @@
+useDynLib(cusp)
+
+export(cusp.bifset, cusp.extrema, cusp.logist, cusp, cusp3d, cusp3d.surface, dcusp, draw.cusp.bifset, pcusp,
+       plotCuspBifurcation, plotCuspResidfitted, plotCuspDensities, qcusp, rcusp)
+
+S3method(confint, cusp)
+S3method(plot, cusp)
+S3method(print, cusp)
+S3method(print, summary.cusp)
+S3method(summary, cusp)
+S3method(vcov, cusp)
+


Property changes on: pkg/cusp/NAMESPACE
___________________________________________________________________
Added: svn:eol-style
   + native

Added: pkg/cusp/R/between.R
===================================================================
--- pkg/cusp/R/between.R	                        (rev 0)
+++ pkg/cusp/R/between.R	2014-09-29 12:59:44 UTC (rev 637)
@@ -0,0 +1,6 @@
+`between` <-
+function (x, lower, upper = if (length(lower) > 1 && NCOL(lower) == 
+    2) lower[, 2], right.open = TRUE, left.open = FALSE) 
+((if (left.open) lower <= x else lower < x) & (if (right.open) x <= 
+    upper else x < upper))[seq_along(x)]
+


Property changes on: pkg/cusp/R/between.R
___________________________________________________________________
Added: svn:eol-style
   + native

Added: pkg/cusp/R/confint.cusp.R
===================================================================
--- pkg/cusp/R/confint.cusp.R	                        (rev 0)
+++ pkg/cusp/R/confint.cusp.R	2014-09-29 12:59:44 UTC (rev 637)
@@ -0,0 +1,22 @@
+`confint.cusp` <-
+function (object, parm, level = 0.95, ...) 
+{
+    cf <- coef(object)
+    pnames <- names(cf)
+    v <- vcov(object)
+    pnames <- colnames(v)
+    if (missing(parm)) 
+        parm <- seq_along(pnames)
+    else if (is.character(parm)) 
+        parm <- match(parm, pnames, nomatch = 0)
+    a <- (1 - level)/2
+    a <- c(a, 1 - a)
+    pct <- format.perc(a, 3)
+    fac <- qnorm(a)
+    ci <- array(NA, dim = c(length(parm), 2), dimnames = list(pnames[parm], 
+        pct))
+    ses <- sqrt(diag(v))[parm]
+    ci[] <- cf[pnames[parm]] + ses %o% fac
+    ci
+}
+


Property changes on: pkg/cusp/R/confint.cusp.R
___________________________________________________________________
Added: svn:eol-style
   + native

Added: pkg/cusp/R/cusp.Like.R
===================================================================
--- pkg/cusp/R/cusp.Like.R	                        (rev 0)
+++ pkg/cusp/R/cusp.Like.R	2014-09-29 12:59:44 UTC (rev 637)
@@ -0,0 +1,7 @@
+`cusp.Like` <-
+function (p, x) 
+{
+    print(p)
+    -2 * sum(log(dcusp((x - p[3])/p[4], p[1], p[2])/p[4]))
+}
+


Property changes on: pkg/cusp/R/cusp.Like.R
___________________________________________________________________
Added: svn:eol-style
   + native

Added: pkg/cusp/R/cusp.R
===================================================================
--- pkg/cusp/R/cusp.R	                        (rev 0)
+++ pkg/cusp/R/cusp.R	2014-09-29 12:59:44 UTC (rev 637)
@@ -0,0 +1,81 @@
+`cusp` <-
+function (formula, alpha, beta, data, weights, offset, ..., control = glm.control(), 
+    method='cusp.fit', optim.method='L-BFGS-B', model = TRUE, contrasts = NULL) 
+{
+    call <- match.call()
+    if (missing(data)) 
+        data <- environment(formula)
+    # model matrix y
+    mf <- match.call(expand.dots = FALSE)
+    m <- match(c("formula", "data", "subset", "weights", "na.action", 
+        "offset"), names(mf), 0)
+    mf <- mf[c(1, m)]
+    mf$drop.unused.levels <- TRUE
+    mf[[1]] <- as.name("model.frame")
+    if(length(mf[[2]])>2) { mf[[2]][[2]] <- NULL }
+    mf <- eval(mf, envir = parent.frame())
+    Y <- model.response(mf, "any")
+    mt <- attr(mf,'terms')
+    X <- if (!is.empty.model(mt)) 
+        model.matrix(mt, mf, contrasts)
+    else matrix(, NROW(Y), 0)
+    
+    # model matrix alpha
+    formula.alpha <- alpha
+    mfa = match.call(expand.dots=FALSE)
+    m <- match(c("alpha","data","subset","weights","na.action","offset"), names(mfa), 0)
+    mfa <- mfa[c(1,m)]
+    mfa$drop.unused.levels <- TRUE
+    mfa[[1]] <- as.name("model.frame")
+    mfa[[2]] <- update(alpha, paste(attr(terms(formula),'term.labels')[1],"~ ."))
+    names(mfa) <- c('','formula',names(mfa)[-(1:2)])
+    mfa <- eval(mfa, envir = parent.frame()) # is nodig als data argument niet is mee gegeven lijkt me...
+    mta <- attr(mfa,'terms')
+    X.alpha <- if (!is.empty.model(mta)) 
+        model.matrix(mta, mfa, contrasts)
+ 
+    # model matrix beta
+    formula.beta <- beta
+    mfb = match.call(expand.dots=FALSE)
+    m <- match(c("beta","data","subset","weights","na.action","offset"), names(mfb), 0)
+    mfb <- mfb[c(1,m)]
+    mfb$drop.unused.levels <- TRUE
+    mfb[[1]] <- as.name("model.frame")
+    mfb[[2]] <- update(beta, paste(attr(terms(formula),'term.labels')[1],"~ ."))
+    names(mfb) <- c('','formula',names(mfb)[-(1:2)])
+    mfb <- eval(mfb, envir = parent.frame()) # is nodig als data argument niet is mee gegeven lijkt me...
+    mtb <- attr(mfb,'terms')
+    X.beta <- if (!is.empty.model(mtb)) 
+        model.matrix(mtb, mfb, contrasts)
+    
+    weights <- as.vector(model.weights(mf))
+    if (!is.null(weights) && !is.numeric(weights)) 
+        stop("'weights' must be a numeric vector")
+    offset <- as.vector(model.offset(mf))
+    if (!is.null(weights) && any(weights < 0)) 
+        stop("negative weights not allowed")
+    if (!is.null(offset)) {
+        if (length(offset) == 1) 
+            offset <- rep(offset, NROW(Y))
+        else if (length(offset) != NROW(Y)) 
+            stop(gettextf("number of offsets is %d should equal %d (number of observations)", 
+                length(offset), NROW(Y)), domain = NA)
+    }
+    fit <- cusp.fit(y = Y <- X, x.alpha = X.alpha, x.beta = X.beta, ..., method=optim.method)
+    if (model){
+        fit$model <- list(y = mf, alpha = mfa, beta  = mfb)
+    }
+    fit$na.action <- attr(mf, "na.action")
+    fit$x <- list(X.y = X, X.alpha = X.alpha, X.beta = X.beta); 
+        
+    fit <- c(fit, list(call = call, formula = list(y=formula, alpha=formula.alpha, 
+        beta=formula.beta), terms = list(y = mt, alpha = mta, beta = mtb),
+        OK = all(eigen(fit$hess, symmetric=TRUE, only.values=TRUE)$values>0),
+        data = data, offset = offset, control = control, method = method,
+        contrasts = list(y=attr(X, "contrasts"), alpha=attr(X.beta, "contrasts"),
+        beta=attr(X.beta, "contrasts")), xlevels = list(y=.getXlevels(mt, mf),
+        alpha=.getXlevels(mta, mfa), beta=.getXlevels(mtb, mfb))))
+    class(fit) <- c("cusp","glm","lm")
+    fit
+}
+


Property changes on: pkg/cusp/R/cusp.R
___________________________________________________________________
Added: svn:eol-style
   + native

Added: pkg/cusp/R/cusp.bifset.R
===================================================================
--- pkg/cusp/R/cusp.bifset.R	                        (rev 0)
+++ pkg/cusp/R/cusp.bifset.R	2014-09-29 12:59:44 UTC (rev 637)
@@ -0,0 +1,7 @@
+`cusp.bifset` <-
+function (beta) 
+{
+    alpha = 2 * (beta/3)^(3/2)
+    cbind(beta = beta, alpha.l = -alpha, alpha.u = alpha)
+}
+


Property changes on: pkg/cusp/R/cusp.bifset.R
___________________________________________________________________
Added: svn:eol-style
   + native

Added: pkg/cusp/R/cusp.curve.R
===================================================================
--- pkg/cusp/R/cusp.curve.R	                        (rev 0)
+++ pkg/cusp/R/cusp.curve.R	2014-09-29 12:59:44 UTC (rev 637)
@@ -0,0 +1,11 @@
+`cusp.curve` <-
+function (alpha, beta) 
+{
+    roots <- polyroot(c(beta + alpha^2, 2 * alpha * beta, beta^2 - 
+        3, -2 * alpha, -2 * beta, 0, 1))
+    real <- abs(Im(roots)) < .Machine$double.eps^0.5
+    if (all(real)) 
+        sort(Re(roots))
+    else rep(Re(roots[real]), 1)
+}
+


Property changes on: pkg/cusp/R/cusp.curve.R
___________________________________________________________________
Added: svn:eol-style
   + native

Added: pkg/cusp/R/cusp.expected.R
===================================================================
--- pkg/cusp/R/cusp.expected.R	                        (rev 0)
+++ pkg/cusp/R/cusp.expected.R	2014-09-29 12:59:44 UTC (rev 637)
@@ -0,0 +1,30 @@
+`cusp.expected` <-
+function (alpha, beta, y, method = c("delay", "maxwell", "expected")) 
+{
+    method <- match.arg(method[1], c("maxwell", "delay", "expected"))
+    if (method %in% c("maxwell", "delay")) 
+        modi <- t(Vectorize(cusp.extrema)(alpha, beta))
+    if (missing(y) && method == "delay") 
+        stop("Observations y have to be provided for method=\"delay\"")
+    val <- switch(method, expected = {
+        .v <- t(Vectorize(function(alpha, beta) {
+            val <- Vectorize(cusp.nc)(alpha, beta, 0:2)
+            val <- val/c(1, val[0], val[0] * 2)
+            val
+        })(alpha, beta))
+        colnames(.v) = c("norm.const", "E(Y)", "E(Y^2)/2")
+        .v[, 2:3]
+    }, delay = {
+        .v <- ifelse(y < modi[, 2], modi[, 1], modi[, 3])
+        .v <- as.matrix(.v)
+        colnames(.v) <- "Delay"
+        .v
+    }, maxwell = {
+        .v <- ifelse(alpha < 0, modi[, 1], modi[, 3])
+        .v <- as.matrix(.v)
+        colnames(.v) <- "Maxwell"
+        .v
+    })
+    val
+}
+


Property changes on: pkg/cusp/R/cusp.expected.R
___________________________________________________________________
Added: svn:eol-style
   + native

Added: pkg/cusp/R/cusp.extrema.R
===================================================================
--- pkg/cusp/R/cusp.extrema.R	                        (rev 0)
+++ pkg/cusp/R/cusp.extrema.R	2014-09-29 12:59:44 UTC (rev 637)
@@ -0,0 +1,10 @@
+`cusp.extrema` <-
+function (alpha, beta) 
+{
+    roots <- polyroot(c(alpha, beta, 0, -1))
+    real <- abs(Im(roots)) < .Machine$double.eps^0.5
+    if (all(real)) 
+        sort(Re(roots))
+    else rep(Re(roots[real]), 3)
+}
+


Property changes on: pkg/cusp/R/cusp.extrema.R
___________________________________________________________________
Added: svn:eol-style
   + native

Added: pkg/cusp/R/cusp.fit.R
===================================================================
--- pkg/cusp/R/cusp.fit.R	                        (rev 0)
+++ pkg/cusp/R/cusp.fit.R	2014-09-29 12:59:44 UTC (rev 637)
@@ -0,0 +1,153 @@
+`cusp.fit` <-
+function(y,x=rep(1,length(y)), x.alpha=x, x.beta=x.alpha, weights = rep(1, nobs), 
+    start=c(rep(0,qr(x.alpha)$rank),rep(1,qr(x.beta)$rank)/qr(x.beta)$rank,c(rep(0,qr(y)$rank-1),1)), 
+    ..., offset = rep.int(0, nobs), method='L-BFGS-B', optim.method='L-BFGS-B', expected.method = 'delay',
+    lower=if(method=='L-BFGS-B') c(rep(-5,qr(x.alpha)$rank+qr(x.beta)$rank),rep(-50,qr(y)$rank),1e-8) else -Inf, 
+    upper=if(method=='L-BFGS-B') c(rep(+5,qr(x.alpha)$rank+qr(x.beta)$rank),rep(+50,qr(y)$rank), Inf) else +Inf,
+    intercept = TRUE){
+    x <- as.matrix(x)
+    Qr <- qr(x)
+    Q  <- scale(zapsmall(qr.Q(Qr)[,1:Qr$rank]),center=FALSE)
+    Qscl = attr(Q,'scaled:scale')
+    R = diag(c(Qscl,rep(1,NCOL(x)-Qr$rank)), NCOL(x)) %*% qr.R(Qr)
+    if(Qr$rank < NCOL(x))
+        start <- c(start[1:(2*NCOL(Q))],start[c(length(start)-1,length(start))])
+    # regression matrix alpha
+    x.alpha <- as.matrix(x.alpha)
+    Qr.alpha <- qr(x.alpha)
+    ranka <- Qr.alpha$rank; idxa <- 1:ranka;
+    Q.alpha  <- scale(zapsmall(qr.Q(Qr.alpha)[,1:ranka]),center=FALSE)
+    Qscl.alpha = attr(Q.alpha,'scaled:scale')
+    R.alpha = diag(c(Qscl.alpha,rep(1,NCOL(x.alpha)-ranka)), NCOL(x.alpha)) %*% qr.R(Qr.alpha)
+    # regression matrix beta
+    x.beta <- as.matrix(x.beta)
+    Qr.beta <- qr(x.beta)
+    rankb <- Qr.beta$rank; idxb <- 1:rankb
+    Q.beta  <- scale(zapsmall(qr.Q(Qr.beta)[,1:rankb]),center=FALSE)
+    Qscl.beta = attr(Q.beta,'scaled:scale')
+    R.beta = diag(c(Qscl.beta,rep(1,NCOL(x.beta)-rankb)), NCOL(x.beta)) %*% qr.R(Qr.beta)
+    # dependents matrix
+    Y <- as.matrix(y)
+    Qr.y <- qr(Y)
+    ranky <- Qr.y$rank; idxy <- 1:ranky
+    Q.y <- scale(zapsmall(qr.Q(Qr.y)[,1:ranky]),center=FALSE)
+    Qscl.y <- attr(Q.y, 'scaled:scale')
+    R.y <- diag(c(Qscl.y, rep(1, NCOL(Y) - ranky)), NCOL(Y)) %*% qr.R(Qr.y)
+    w <- start[ranka+rankb+1:ranky]
+#    w <- c(-w[2:ranky - 1], 1) / w[ranky]
+    y <- Q.y %*% backsolve(R.y,w, k = ranky)
+
+    xnames <- dimnames(x)[[2]]
+    xnames.alpha <- dimnames(x.alpha)[[2]]
+    xnames.beta <- dimnames(x.beta)[[2]]
+    xnames.y    <- dimnames(Y)[[2]]
+    ynames <- if (is.matrix(y)) rownames(y) else names(y)
+    dev.resids <- function (y, mu, wt) if(NCOL(mu)==2) wt * ((cbind(y,y^2/2) - mu)^2) else wt * (y - mu)^2
+    nobs <- NROW(y)
+    nvars <- NCOL(x.alpha) + NCOL(x.beta) + NCOL(y)
+    EMPTY <- nvars == 0
+    if (is.null(weights)) 
+        weights <- rep.int(1, nobs)
+    if (is.null(offset)) 
+        offset <- rep.int(0, nobs)
+    if (EMPTY) {
+        eta <- mat.or.vec(nobs, 2) + offset
+        colnames(eta) <- c('alpha', 'beta')
+        mu <- cusp.expected(eta[,'alpha'], eta[,'beta'], y, method=expected.method)
+        dev <- sum(dev.resids(y, mu, weights))
+        w <- weights^0.5
+        residuals <- if(NCOL(mu)==2) (cbind(y,y^2/2) - mu) else (y - mu)
+        residuals <- as.matrix(residuals)
+        colnames(residuals) <- colnames(mu) 
+        good <- rep(TRUE, length(residuals))
+        boundary <- conv <- TRUE
+        coef <- numeric(0)
+        iter <- 0
+    }
+    else {
+        s <- 1
+
+		if(is.loaded("cuspnc")) {
+			fit <- optim(start, cusp.nlogLike.c, 
+    	    	y=Q.y, X.alpha=Q.alpha, X.beta=Q.beta,..., method=method, lower=lower, upper=upper, hessian=TRUE);
+		} 
+		else {
+			fit <- optim(start, cusp.nlogLike, 
+				y=Q.y, X.alpha=Q.alpha, X.beta=Q.beta,..., method=method, lower=lower, upper=upper, hessian=TRUE);
+		}
+    	w = backsolve(R.y, fit$par[1:ranky+ranka+rankb], k = ranky);
+    	sgn = sign(w[ranky]); # sign of a and w are arbitrary, last entry of w should be positive
+ # gaat niet goed zo! moet Qr.alpha$pivot en Qr.beta$pivot gebruiken om kolomen uit matrices te kiezen die de R(x.alpha) en R(x.beta) opspannen!!
+        ahat <- rep(NA, ncol(x.alpha))
+        ahat[Qr.alpha$pivot[idxa]] <- sgn * backsolve(R.alpha, fit$par[idxa], k = ranka);
+        bhat <- rep(NA, ncol(x.beta))
+        bhat[Qr.beta$pivot[idxb]] <- backsolve(R.beta, fit$par[idxb+ranka], k = rankb);
+        what <- rep(NA, ncol(Y))
+        what[Qr.y$pivot[idxy]] <- sgn * backsolve(R.y, fit$par[idxy+ranka+rankb], k = ranky);
+#    	coef <- coefold <- c( # sign of a and w are arbitrary, last entry of w should be positive
+#    	    a = sgn * backsolve(R.alpha, fit$par[1:ranka], k = ranka), rep.int(NA, NCOL(x.alpha)-ranka), 
+#    	    b = backsolve(R.beta,  fit$par[1:NCOL(Q.beta )+ranka], k = rankb), rep.int(NA, NCOL(x.beta)-rankb),
+#    	    w = sgn * backsolve(R.y, fit$par[1:ranky+ranka+rankb], k = ranky), rep.int(NA, NCOL(Y) - ranky))
+        coef <- coefold <- c(a = ahat, b = bhat, w = what)
+    	RR = matrix(0,ranka+rankb+ranky, ranka+rankb+ranky)
+    	RR[1:ranka, 1:ranka] <- R.alpha[1:ranka,1:ranka]
+    	RR[1:rankb+ranka, 1:rankb+ranka] <- R.beta[1:rankb,1:rankb]
+    	RR[1:ranky + rankb+ranka, 1:ranky + rankb+ranka] <- R.y[1:ranky,1:ranky]
+    	fit$Hessian <- t(RR) %*% fit$hessian %*% RR
+    	fit <- c(fit, qr(fit$Hessian))
+    	fit$rank <- qr(fit$hessian)$rank # Hessian may become quite 'big' which leads to ill rank estimates
+    	conv <- fit$convergence == 0
+#       if (!conv) 
+#           warning("algorithm did not converge")
+    	eps <- 10 * .Machine$double.eps
+        xxnames <- c(paste('a[',xnames.alpha[1:ranka],']',sep=''), 
+                     paste('b[',xnames.beta[1:rankb],']',sep=''), 
+                     paste('w[',xnames.y[1:ranky],']',sep=''))[fit$pivot]
+        eta <- cbind(`alpha`= sgn * Q.alpha %*% fit$par[1:ranka], `beta`=Q.beta %*% fit$par[1:rankb+ranka])
+        w <- fit$par[ranka+rankb+1:ranky]
+        y <- sgn * Q.y %*% w # the cusp variate that is embeded in the dependents, its sign depends on sgn = sign(w[length(w)])
+
+        colnames(eta) <- c('alpha', 'beta')
+        mu <- cusp.expected(eta[,'alpha'], eta[,'beta'], y, method=expected.method)        
+    	devold <- dev <- s^2 * sum(dev.resids(y, mu, weights))
+        residuals <- s * if(NCOL(mu)==2) (cbind(y,y^2/2)-mu) else (y - mu)
+        colnames(residuals) <- colnames(mu) 
+        fit$qr <- as.matrix(fit$qr)
+        nr <- nvars - ranka - rankb - ranky
+        Rmat <- as.matrix(fit$qr)
+        Rmat[row(Rmat) > col(Rmat)] <- 0
+        names(coef) <- c(paste('a[',xnames.alpha,']',sep=''), paste('b[',xnames.beta,']',sep=''), paste('w[',xnames.y,']',sep=''))
+        colnames(fit$qr) <- xxnames
+        dimnames(Rmat) <- list(xxnames, xxnames)
+    	fit$start <- start
+    	fit$algorithm <- method
+    }
+    names(residuals) <- ynames
+    names(mu) <- ynames
+    rownames(eta) <- ynames
+    wt <- weights
+    names(wt) <- ynames
+    names(weights) <- ynames
+    names(y) <- ynames
+    fit$effects <- double(nobs)
+    if (!EMPTY)
+        names(fit$effects) <- c(xxnames[seq_len(fit$rank)], rep.int("", nobs - fit$rank))
+    wtdmu <- if(intercept) sum(weights * y)/sum(weights) else offset    # (weighted) mean
+    nulldev <- s * sum(dev.resids(y, wtdmu, weights)) # (weighted) SS deviances around the (weighted) mean
+    n.ok <- nobs - sum(weights == 0)
+    nulldf <- n.ok - as.integer(intercept)
+    rank <- if (EMPTY) 0 else fit$rank
+    resdf <- n.ok - rank
+    aic.model <- 2 * fit$value + 2 * rank
+	list(coefficients = coef, residuals = residuals, fitted.values = mu,
+	    effects = if (!EMPTY) fit$effects, R = if (!EMPTY) Rmat,
+	    rank = rank, qr = if (!EMPTY) structure(fit[c("qr", "rank",
+	        "qraux", "pivot", "tol")], class = "qr"), family = quasi(),
+	    linear.predictors = eta, deviance = dev, aic = aic.model,
+	    null.deviance = nulldev, iter = if (!EMPTY) fit$counts[1], weights = wt, prior.weights = weights,
+	    df.residual = resdf, df.null = nulldf, y = y, converged = conv,
+	    boundary = FALSE, par = fit$par, Hessian = if (!EMPTY) fit$Hessian, 
+	    hessian.untransformed = if (!EMPTY) fit$hessian, 
+	    qr.transform= if (!EMPTY) RR, code= if (!EMPTY) fit$convergence, message= if (!EMPTY) fit$message)
+}
+


Property changes on: pkg/cusp/R/cusp.fit.R
___________________________________________________________________
Added: svn:eol-style
   + native

Added: pkg/cusp/R/cusp.inflexions.R
===================================================================
--- pkg/cusp/R/cusp.inflexions.R	                        (rev 0)
+++ pkg/cusp/R/cusp.inflexions.R	2014-09-29 12:59:44 UTC (rev 637)
@@ -0,0 +1,11 @@
+`cusp.inflexions` <-
+function (alpha, beta) 
+{
+    roots <- polyroot(c(beta + alpha^2, 2 * alpha * beta, beta^2 - 
+        3, -2 * alpha, -2 * beta, 0, 1))
+    real <- abs(Im(roots)) < .Machine$double.eps^0.5
+    if (all(real)) 
+        sort(Re(roots))
+    else rep(Re(roots[real]), 1)
+}
+


Property changes on: pkg/cusp/R/cusp.inflexions.R
___________________________________________________________________
Added: svn:eol-style
   + native

Added: pkg/cusp/R/cusp.logLike.R
===================================================================
--- pkg/cusp/R/cusp.logLike.R	                        (rev 0)
+++ pkg/cusp/R/cusp.logLike.R	2014-09-29 12:59:44 UTC (rev 637)
@@ -0,0 +1,12 @@
+`cusp.logLike` <-
+function (p, x, verbose = FALSE) 
+{
+    if (verbose) {
+        print(p)
+        flush.console()
+    }
+    z = (x - p[3])/p[4]
+    -2 * sum(p[1] * z + p[2] * z^2/2 - z^4/4) + 2 * length(x) * 
+        log(p[4] * cusp.nc(p[1], p[2]))
+}
+


Property changes on: pkg/cusp/R/cusp.logLike.R
___________________________________________________________________
Added: svn:eol-style
   + native

Added: pkg/cusp/R/cusp.logist.R
===================================================================
--- pkg/cusp/R/cusp.logist.R	                        (rev 0)
+++ pkg/cusp/R/cusp.logist.R	2014-09-29 12:59:44 UTC (rev 637)
@@ -0,0 +1,79 @@
+`cusp.logist` <-
+function(formula, alpha, beta, data, ..., model = TRUE, x = FALSE, y = TRUE){
+    call <- match.call()
+    if (missing(data)) 
+        data <- environment(formula)
+    # model matrix y
+    mf <- match.call(expand.dots = FALSE)
+    m <- match(c("formula", "data", "subset", "weights", "na.action", 
+        "offset"), names(mf), 0)
+    mf <- mf[c(1, m)]
+    mf$drop.unused.levels <- TRUE
+    mf[[1]] <- as.name("model.frame")
+    if(length(mf[[2]])>2) {mf[[2]][[2]] <- NULL}
+    mf <- eval(mf, envir = parent.frame())
+    Y <- model.response(mf, "any")
+    mt <- attr(mf,'terms')
+    X <- if (!is.empty.model(mt)) 
+        model.matrix(mt, mf, contrasts)
+    else matrix(, NROW(Y), 0)
+    
+    # model matrix alpha
+    formula.alpha <- alpha
+    mfa = match.call(expand.dots=FALSE)
+    m <- match(c("alpha","data","subset","weights","na.action","offset"), names(mfa), 0)
+    mfa <- mfa[c(1,m)]
+    mfa$drop.unused.levels <- TRUE
+    mfa[[1]] <- as.name("model.frame")
+    mfa[[2]] <- update(alpha, paste(attr(terms(formula),'term.labels')[1],"~ ."))
+    names(mfa) <- c('','formula',names(mfa)[-(1:2)])
+    mfa <- eval(mfa, envir = parent.frame()) # is nodig als data argument niet is mee gegeven lijkt me...
+    mta <- attr(mfa,'terms')
+    X.alpha <- if (!is.empty.model(mta)) 
+        model.matrix(mta, mfa, contrasts)
+ 
+    # model matrix beta
+    formula.beta <- beta
+    mfb = match.call(expand.dots=FALSE)
+    m <- match(c("beta","data","subset","weights","na.action","offset"), names(mfb), 0)
+    mfb <- mfb[c(1,m)]
+    mfb$drop.unused.levels <- TRUE
+    mfb[[1]] <- as.name("model.frame")
+    mfb[[2]] <- update(beta, paste(attr(terms(formula),'term.labels')[1],"~ ."))
+    names(mfb) <- c('','formula',names(mfb)[-(1:2)])
+    mfb <- eval(mfb, envir = parent.frame()) # is nodig als data argument niet is mee gegeven lijkt me...
+    mtb <- attr(mfb,'terms')
+    X.beta <- if (!is.empty.model(mtb)) 
+        model.matrix(mtb, mfb, contrasts)
+
+    weights <- as.vector(model.weights(mf))
+    if (!is.null(weights) && !is.numeric(weights)) 
+        stop("'weights' must be a numeric vector")
+    offset <- as.vector(model.offset(mf))
+    if (!is.null(weights) && any(weights < 0)) 
+        stop("negative weights not allowed")
+    if (!is.null(offset)) {
+        if (length(offset) == 1) 
+            offset <- rep(offset, NROW(Y))
+        else if (length(offset) != NROW(Y)) 
+            stop(gettextf("number of offsets is %d should equal %d (number of observations)", 
+                length(offset), NROW(Y)), domain = NA)
+    }
+    fit <- cusp.logist.fit(Xa=X.alpha, Xb=X.beta, Y=Y <- X, ...)
+    fit$call <- call
+    if(model){
+        fit$model <- mf        
+    }
+    if(x) {
+        fit$x <- X
+    }
+    if(y) {
+        fit$y <- Y
+    }
+    fit$null.deviance = sum((Y-mean(Y))^2)
+    class(fit) <- c("cusp.logist","cusp","glm","lm")
+    fit
+}
+
+`summary.cusp.logist` <- function(x,...) .NotYetImplemented()
+`plot.cusp.logist` <- function(x,...) .NotYetImplemented()


Property changes on: pkg/cusp/R/cusp.logist.R
___________________________________________________________________
Added: svn:eol-style
   + native

Added: pkg/cusp/R/cusp.logist.fit.R
===================================================================
--- pkg/cusp/R/cusp.logist.fit.R	                        (rev 0)
+++ pkg/cusp/R/cusp.logist.fit.R	2014-09-29 12:59:44 UTC (rev 637)
@@ -0,0 +1,80 @@
+`cusp.logist.fit` <-
+function(Xa, Xb, Y, hessian=FALSE, use = 'new', nfits = 5, ndigit = 17, max.repeats = 4, 
+    gtol = .Machine$double.eps^(1/3), ...)
+{
+    qxa <- qr(Xa)
+    qxb <- qr(Xb)
+    qy  <- if(is.qr(Y)) {Y} else {qr(Y)}
+    
+    rxa  <- qxa$rank; ixa <- 1:rxa
+    rxb  <- qxb$rank; ixb <- 1:rxb
+    ry   <- qy$rank;  iy  <- 1:ry
+    Qxa <- qr.Q(qxa)[,ixa, drop = FALSE]
+    Qxb <- qr.Q(qxb)[,ixb, drop = FALSE]
+    Qy  <- qr.Q(qy)[,iy, drop = FALSE]
+    Rxa <- qr.R(qxa)[ixa,ixa]
+    Rxb <- qr.R(qxb)[ixb,ixb]
+    Ry  <- qr.R(qy)[iy,iy]
+    
+    objf <- switch(use,old=cusp.logist.objf.old, new=cusp.logist.objf)
+    fitq <- nlm(objf,rnorm(rxa+rxb-1), xa=Qxa, xb=Qxb, y=qr(Qy), ndigit=ndigit, ...)
+    j=1
+    repeat{
+        for(i in 1:nfits){
+            tmp <- nlm(objf,rnorm(rxa+rxb-1), xa=Qxa, xb=Qxb, y=Qy, ndigit=ndigit, ...)
+            if(tmp$min<fitq$min) {fitq <- tmp}
+        }
+        if(max(abs(fitq$gradient*ifelse(abs(fitq$est)<1.0, 1.0, fitq$est))) < gtol || j>max.repeats) {
+            break;
+        }
+        j <- j + 1
+    }
+    rss <- objf(fitq$est, xa=Qxa, xb=Qxb, y=Y)
+    rsq <- attr(rss, 'RSq')
+    ahat <- rep(NA, ncol(Xa))
+    ahat[qxa$pivot[ixa]] <- backsolve(Rxa, fitq$est[ixa]);
+    bhat <- rep(NA, ncol(Xb))
+    bhat[qxb$pivot[ixb]] <- backsolve(Rxb, c(1,fitq$est[rxa+ixb[-1]-1]))
+    if(bhat[1]){
+        ahat <- ahat / bhat[1]^2
+        bhat <- bhat / bhat[1]
+    }
+    # coefficients
+    coef <- c(ahat, bhat)
+    anames <- paste('a.', if(is.null(colnames(Xa))) {1:ncol(Xa)} else {colnames(Xa)}, sep='') 
+    bnames <- paste('b.', if(is.null(colnames(Xb))) {1:ncol(Xb)} else {colnames(Xb)}, sep='')
+    names(coef) <- c(anames, bnames)
+    fitq$coefficients <- coef
+    # predicted etc.
+    .alpha <- Xa %*% ifelse(is.na(ahat), 0, ahat) # == attr(rss, 'alpha') which is calculated differently!
+    .beta  <- Xb %*% ifelse(is.na(bhat), 0, bhat) # == attr(rss, 'beta')
+    fitq$linear.predictors <- cbind(alpha=.alpha, beta=.beta)
+    colnames(fitq$linear.predictors) <- c('alpha', 'beta')
+    rownames(fitq$linear.predictors) <- rownames(Y)
+    fitq$fitted.values <- drop((.alpha/.beta^2 > -50.0) / (1 + exp(-.alpha/.beta^2)))
+    names(fitq$fitted.values) <- rownames(Y)
+    res <- lm(fitq$fitted.values ~ Y-1)$resid
+    fitq$residuals <- sqrt(rss) * res/sqrt(sum(res^2))
+    names(fitq$residuals) <- rownames(Y)
+    # deviance & likelihood
+    nobs <- NROW(Y)
+    fitq$rank <- qxa$rank + qxb$rank + qy$rank - 1 # one restriction
+    fitq$deviance <- c(`Sum Sq. Err.` = rss) # drop attributes
+    fitq$logLik <- -0.5*nobs*(1+log(2*pi*sum(fitq$residuals^2)/nobs))
+    fitq$aic <- -2*fitq$logLik + 2*fitq$rank
+    fitq$rsq <- rsq
+    fitq$df.residual <- nobs - fitq$rank
+    fitq$df.null <- nobs - 1
+    # hessian
+    fitq$rss <- c(rss)
+    fitq$hessian <- if(hessian) {nlm(objf,fitq$est, xa=Qxa, xb=Qxb, y=Y, hessian=TRUE)$hessian} else {matrix(0,0,0)}
+    fitq$Hessian <- "Not implemented"
+    fitq$qr <- if(!is.null(fitq$hessian)) {qr(fitq$hessian)} else {"Not implemented"}
+    # convergence
+    fitq$converged <- fitq$code == 1 || max(abs(fitq$gradient*ifelse(abs(fitq$est)<1.0, 1.0, fitq$est))) < gtol
+    fitq$converged <- fitq$converged  && (!hessian || all(eigen(fitq$hessian,,only.values=TRUE)$values>0))
+    fitq$weights <- rep(1, NROW(Y))
+    fitq$boundary <- rep(NA, length(coef))
+    fitq
+}
+


Property changes on: pkg/cusp/R/cusp.logist.fit.R
___________________________________________________________________
Added: svn:eol-style
   + native

Added: pkg/cusp/R/cusp.logist.objf.R
===================================================================
--- pkg/cusp/R/cusp.logist.objf.R	                        (rev 0)
+++ pkg/cusp/R/cusp.logist.objf.R	2014-09-29 12:59:44 UTC (rev 637)
@@ -0,0 +1,20 @@
+`cusp.logist.objf` <-
+function(p, xa, xb, y, alpha = as.matrix(xa) %*% p[1:NCOL(xa)], 
+  beta = as.matrix(xb) %*% if(NCOL(xb)>1) {c(1,p[2:NCOL(xb)-1+NCOL(xa)])} else {c(1)}){
+    if(sum(diag(var(xa)))<.Machine$double.eps^0.5 && sum(diag(var(xa)))<.Machine$double.eps^0.5 ){
[TRUNCATED]

To get the complete diff run:
    svnlook diff /svnroot/depmix -r 637


More information about the depmix-commits mailing list