Download - Curve Fitting Variations and Neural Data
![Page 1: Curve Fitting Variations and Neural Data](https://reader035.vdocuments.us/reader035/viewer/2022062411/568167d6550346895ddd2dc4/html5/thumbnails/1.jpg)
Curve Fitting Variations and Neural Data
Julie Michelman – Carleton College Jiaqi Li – Lafayette College Micah Pearce – Texas Tech University
Advisor: Professor Jeff Liebner – Lafayette College
![Page 2: Curve Fitting Variations and Neural Data](https://reader035.vdocuments.us/reader035/viewer/2022062411/568167d6550346895ddd2dc4/html5/thumbnails/2.jpg)
Neurological StatisticsStimulant
Neurons
Spikes
![Page 3: Curve Fitting Variations and Neural Data](https://reader035.vdocuments.us/reader035/viewer/2022062411/568167d6550346895ddd2dc4/html5/thumbnails/3.jpg)
Distribution of Spikes
![Page 4: Curve Fitting Variations and Neural Data](https://reader035.vdocuments.us/reader035/viewer/2022062411/568167d6550346895ddd2dc4/html5/thumbnails/4.jpg)
Yi = β0 + β1 xi + εi
Minimize RSS:
Simple Linear Regression
n
iii xfYRSS
1
2)(
![Page 5: Curve Fitting Variations and Neural Data](https://reader035.vdocuments.us/reader035/viewer/2022062411/568167d6550346895ddd2dc4/html5/thumbnails/5.jpg)
Polynomial Regression
![Page 6: Curve Fitting Variations and Neural Data](https://reader035.vdocuments.us/reader035/viewer/2022062411/568167d6550346895ddd2dc4/html5/thumbnails/6.jpg)
Polynomial RegressionYi = β0 + β1 xi + β2 xi
2 + β3 xi3 + εi
![Page 7: Curve Fitting Variations and Neural Data](https://reader035.vdocuments.us/reader035/viewer/2022062411/568167d6550346895ddd2dc4/html5/thumbnails/7.jpg)
Our Data
![Page 8: Curve Fitting Variations and Neural Data](https://reader035.vdocuments.us/reader035/viewer/2022062411/568167d6550346895ddd2dc4/html5/thumbnails/8.jpg)
Linear Fit
![Page 9: Curve Fitting Variations and Neural Data](https://reader035.vdocuments.us/reader035/viewer/2022062411/568167d6550346895ddd2dc4/html5/thumbnails/9.jpg)
Quadratic Fit
![Page 10: Curve Fitting Variations and Neural Data](https://reader035.vdocuments.us/reader035/viewer/2022062411/568167d6550346895ddd2dc4/html5/thumbnails/10.jpg)
Cubic Fit
![Page 11: Curve Fitting Variations and Neural Data](https://reader035.vdocuments.us/reader035/viewer/2022062411/568167d6550346895ddd2dc4/html5/thumbnails/11.jpg)
34-Degree Polynomial Fit
![Page 12: Curve Fitting Variations and Neural Data](https://reader035.vdocuments.us/reader035/viewer/2022062411/568167d6550346895ddd2dc4/html5/thumbnails/12.jpg)
An Alternative: SplinesSpline: piecewise function made
of cubic polynomialsPartitioned at knots
◦Evenly spaced … or not
![Page 13: Curve Fitting Variations and Neural Data](https://reader035.vdocuments.us/reader035/viewer/2022062411/568167d6550346895ddd2dc4/html5/thumbnails/13.jpg)
Spline - Underfit
![Page 14: Curve Fitting Variations and Neural Data](https://reader035.vdocuments.us/reader035/viewer/2022062411/568167d6550346895ddd2dc4/html5/thumbnails/14.jpg)
Spline - Overfit
![Page 15: Curve Fitting Variations and Neural Data](https://reader035.vdocuments.us/reader035/viewer/2022062411/568167d6550346895ddd2dc4/html5/thumbnails/15.jpg)
Balancing Fit and SmoothnessTwo alternative solutions
◦Regression Splines Use only a few knots Question: How many knots and where?
◦Smoothing Splines Penalty for overfitting Question: How much of a penalty?
![Page 16: Curve Fitting Variations and Neural Data](https://reader035.vdocuments.us/reader035/viewer/2022062411/568167d6550346895ddd2dc4/html5/thumbnails/16.jpg)
Regression SplinesSelect a few knot locations
◦Often chosen by hand, or evenly spaced
![Page 17: Curve Fitting Variations and Neural Data](https://reader035.vdocuments.us/reader035/viewer/2022062411/568167d6550346895ddd2dc4/html5/thumbnails/17.jpg)
BARS - Bayesian Adaptive Regression Splines
Goal:◦ Find best set of knots
Method:◦ Start with a set of knots◦ Propose a small modification◦ Accept or reject new knots◦ Repeat using updated knots
Compute posterior mean fit◦ Go to R for demo …
![Page 18: Curve Fitting Variations and Neural Data](https://reader035.vdocuments.us/reader035/viewer/2022062411/568167d6550346895ddd2dc4/html5/thumbnails/18.jpg)
Smoothing SplinesBest fit minimizes PSS
1st term◦ distance between data and fitted function
2nd term◦ penalty for high curvature
λ ◦weight of penalty
dxxfxfYfPSSn
iii
2
1
2 )](''[)]([)(
![Page 19: Curve Fitting Variations and Neural Data](https://reader035.vdocuments.us/reader035/viewer/2022062411/568167d6550346895ddd2dc4/html5/thumbnails/19.jpg)
Large λ – Smoother FitGood on sides, underfits peak
![Page 20: Curve Fitting Variations and Neural Data](https://reader035.vdocuments.us/reader035/viewer/2022062411/568167d6550346895ddd2dc4/html5/thumbnails/20.jpg)
Small λ – More Wiggly FitCaptures peak, overfits sides
![Page 21: Curve Fitting Variations and Neural Data](https://reader035.vdocuments.us/reader035/viewer/2022062411/568167d6550346895ddd2dc4/html5/thumbnails/21.jpg)
Smoothing Spline with Adjustable λ
Given λ, best fit minimizes PSS
But what is best λ, or best λ(x)?
dxxfxfYfPSSn
iii
2
1
2 )](''[)]([)(
dxxfxxfYfPSSn
iii
2
1
2 )]('')[()]([)(
![Page 22: Curve Fitting Variations and Neural Data](https://reader035.vdocuments.us/reader035/viewer/2022062411/568167d6550346895ddd2dc4/html5/thumbnails/22.jpg)
Cross Validation (CV)Goal: minimize CV score
n
iiii xfYCV
1
2)]([
blue – f – i (x)
![Page 23: Curve Fitting Variations and Neural Data](https://reader035.vdocuments.us/reader035/viewer/2022062411/568167d6550346895ddd2dc4/html5/thumbnails/23.jpg)
Ordinary smoothing splines:◦ Define “best” λ as minimizing CV
score
Our solution: ◦Define “best” λ (x) at xi as minimizing
CV score near xi
◦Combine local λ’s into λ(x)
Cross Validation
![Page 24: Curve Fitting Variations and Neural Data](https://reader035.vdocuments.us/reader035/viewer/2022062411/568167d6550346895ddd2dc4/html5/thumbnails/24.jpg)
Local Lambda– A graphic illustration
![Page 25: Curve Fitting Variations and Neural Data](https://reader035.vdocuments.us/reader035/viewer/2022062411/568167d6550346895ddd2dc4/html5/thumbnails/25.jpg)
Local Lambda– A graphic illustration
Window sizebandwidth = 31 points
![Page 26: Curve Fitting Variations and Neural Data](https://reader035.vdocuments.us/reader035/viewer/2022062411/568167d6550346895ddd2dc4/html5/thumbnails/26.jpg)
Local Lambda– A graphic illustration
Lambda chosen bycross validation
![Page 27: Curve Fitting Variations and Neural Data](https://reader035.vdocuments.us/reader035/viewer/2022062411/568167d6550346895ddd2dc4/html5/thumbnails/27.jpg)
Local Lambda– A graphic illustration
KeyRed - True FunctionBlack - Local Lambda Fit
![Page 28: Curve Fitting Variations and Neural Data](https://reader035.vdocuments.us/reader035/viewer/2022062411/568167d6550346895ddd2dc4/html5/thumbnails/28.jpg)
Showdown!!
Local Lambda Method Versus
Regular Smoothing Spline
![Page 29: Curve Fitting Variations and Neural Data](https://reader035.vdocuments.us/reader035/viewer/2022062411/568167d6550346895ddd2dc4/html5/thumbnails/29.jpg)
Step Function
KeyBlue - Constant LambdaBlack - Local Lambda Fit
![Page 30: Curve Fitting Variations and Neural Data](https://reader035.vdocuments.us/reader035/viewer/2022062411/568167d6550346895ddd2dc4/html5/thumbnails/30.jpg)
Mexican Hat Function
KeyBlue - Constant LambdaBlack - Local Lambda Fit
![Page 31: Curve Fitting Variations and Neural Data](https://reader035.vdocuments.us/reader035/viewer/2022062411/568167d6550346895ddd2dc4/html5/thumbnails/31.jpg)
Doppler’s Function
KeyBlue - Constant LambdaBlack - Local Lambda Fit
![Page 32: Curve Fitting Variations and Neural Data](https://reader035.vdocuments.us/reader035/viewer/2022062411/568167d6550346895ddd2dc4/html5/thumbnails/32.jpg)
ConclusionsHighly variable curvature:
◦Local Lambda beats regular smoothing spline
More consistent curvature:◦Regular smoothing spline as good or better
Final Assessment:◦Local Lamba Method is successful!
– It is a variation of smoothing spline for that works for highly variable curvature.
![Page 33: Curve Fitting Variations and Neural Data](https://reader035.vdocuments.us/reader035/viewer/2022062411/568167d6550346895ddd2dc4/html5/thumbnails/33.jpg)
Thank YouThanks to
◦Gary Gordon for running the Lafayette College Math REU
◦The National Science Foundation for providing funding
◦Our advisors Jeff Liebner, Liz McMahon, and Garth Isaak for their support and guidance this summer
◦Carleton and St. Olaf Colleges for hosting NUMS 2010
◦All of you for coming to this presentation!