Learn R Programming

msr (version 0.4.4)

msc.slm: Morse Smale Complex Simultaneous Linear Regression

Description

Fit a simoultaneous linear model using the Morse-Smale decomposition of the domain. For each crystal a new varibale is introduced, each observation for the variables is weighted by the weight of belonging to that crystal. The weights are computed depening on the underlying Morse-Samle complex type (see msc.nn).

Usage

msc.slm(ms, nfold = 10, modelSelect = FALSE) msc.slm.elnet(ms, nfold = 10)

Arguments

ms
A Morse-Smale complex object, see msc.nn
nfold
Number of folds for crossvlaidation, used for selecting an appropriate persitence level if the underlying Morse-Smale complex objects has multiple levels.
modelSelect
Do a forward stepwise model selection for each linear model (for each parttion ther eis on linear model)

Value

An object of class c("msc.slm"), that can be used for prediction with predict.The object has the following components:
ms
The Morse-Smale complex, see msc.nn.kd
slm
The linear model based on the weighted observation and variables for each crystals.

References

[1] Samuel Gerber and Kristin Potter The Morse-Smale Complex for Data Analysis, Journal of Statistical Software, 2012, vol. 50, no. 2, pp 1-22 [2] Samuel Gerber, Oliver Ruebel Peer-Timo Bremer, Valerio Pascucci, Ross Whitaker, Morse-Smale Regression, Journal of Computational and Graphical Statistics, 2012

[3] Samuel Gerber, Peer-Timo Bremer, Valerio Pascucci, Ross Whitaker, Visual Exploration of High Dimensional Scalar Functions, IEEE Transactions on Visualization and Computer Graphics, vol. 16, no. 6, pp 1271-1280, Nov.-Dec. 2010.

See Also

predict.msc.slm msc.nn, glmnet

Examples

Run this code
#create Morse-Smale complex  regression of fourpeaks2d data set  
data(fourpeaks)
d <- fourpeaks()
#build Morse-Smale complex
ms <- msc.nn.svm(y=d[,1], x=d[, 2:3], pLevel=0.1, knn = 10)
#build model using Morse-Smale decomposition ms
msr <- msc.slm(ms)
#print simultaneous linear model cv error
msr$slm[[msr$ms$predictLevel]]$cv
#predict for all data points
fp <- predict(msr, d[, 2:3])

#use elastic net for fitting instead
msr <- msc.slm.elnet(ms)
fp <- predict(msr, d[, 2:3])

Run the code above in your browser using DataLab