cusp-package {cusp} | R Documentation |
Cusp Catastrophe Modeling
Description
Fits cusp catastrophe to data using Cobb's maximum likelihood method with a different algorithm. The package contains utility functions for plotting, and for comparing the model to linear regression and logistic curve models. The package allows for multivariate response subspace modelling in the sense of the GEMCAT software of Oliva et al.
Details
Package: | cusp |
Type: | Package |
Version: | 2.0 |
Date: | 2008-02-14 |
License: | GNU GPL v2 (or higher) |
This package helps fitting Cusp catastrophy models to data, as advanced in Cobb et al. (1985). The main functions are
cusp | Fit Cobb's Cusp catastrophe model; see example below. |
summary.cusp | Summary statistics of cusp model fit. |
confint.cusp | Confidence intervals for parameter estimates |
plot.cusp | Diagnostic plots for cusp model fit |
cusp3d | 3D graphical display of cusp model fit (experimental). |
dcusp | Density of Cobb's cusp distribtution |
pcusp | Cumulative probability function of Cobb's cusp distribution |
qcusp | Quantile function of Cobb's cusp distribution |
rcusp | Sample from Cobb's cusp distribution. |
cusp.logist | Fit logistic model for bifurctation testing (experimental) |
Author(s)
Raoul Grasman <rgrasman@uva.nl>
References
L. Cobb and S. Zacks (1985) Applications of Catastrophe Theory for Statistical Modeling in the Biosciences (article), Journal of the American Statistical Association, 392:793–802.
P. Hartelman (1996). Stochastic Catastrophy Theory. Unpublished PhD-thesis.
H. L. J. van der Maas, R. Kolstein, and J van der Pligt (2003). Sudden Transitions in Attitudes, Sociological Methods and Research, 32:125-152.
Oliva, DeSarbo, Day, and Jedidi. (1987) GEMCAT : A General Multivariate Methodology for Estimating Catastrophe Models, Behavioral Science, 32:121-137.
R. P. P. P. Grasman, H. L. J. van der Maas, and E-J. Wagenmakers (2009). Fitting the Cusp Catastrophe in R: A cusp Package Primer. Journal of Statistical Software 32(8), 1-28. URL https://www.jstatsoft.org/v32/i08/.
Examples
set.seed(123)
# fitting cusp to cusp data
x <- rcusp(100, alpha=0, beta=1)
fit <- cusp(y ~ x, alpha ~ 1, beta ~ 1)
print(fit)
# example with regressors
## Not run:
x1 = runif(150)
x2 = runif(150)
z = Vectorize(rcusp)(1, 4*x1-2, 4*x2-1)
data <- data.frame(x1, x2, z)
fit <- cusp(y ~ z, alpha ~ x1+x2, beta ~ x1+x2, data)
print(fit)
summary(fit)
plot(fit)
cusp3d(fit)
## End(Not run)
# use of OK
npar <- length(fit$par)
## Not run:
while(!fit$OK) # refit if necessary until convergence is OK
fit <- cusp(y ~ z, alpha ~ x1+x2, beta ~ x1+x2, data, start=rnorm(npar))
## End(Not run)
## Not run:
# example 1 from paper
data(attitudes)
data(attitudeStartingValues)
fit.attitudes <- cusp(y ~ Attitude, alpha ~ Orient + Involv, beta ~ Involv,
data = attitudes, start=attitudeStartingValues)
summary(fit.attitudes)
plot(fit.attitudes)
cusp3d(fit.attitudes, B = 0.75, Y = 1.35, theta = 170, phi = 30, Yfloor = -9)
## End(Not run)