MaternSpline
a position-error and low-pass correlated velocity smoothing model
Declaration
classdef MaternSpline < BSplineOverview
The BSpline
Topics
- Initializing
MaternSplinecompute the solution to the position-error velocity model
- Primary attributes
noiseDistributiondistribution of the noisetobservation times (array of values for the independent axis)xobserved positions (array of values for the dependent axis)
- Manipulating model parameters
Mnumber of low-pass splineslambdavelocity penaltymaternAlphamatern slope parametermaternTmatern time scale
- Accessing model properties
LCholesky decomposition of the velocity covariancePhfhigh-frequency projection operatorPlflow-frequency projection operatorUMatern-correlated high-pass-filtered velocity of N splines at points tqVVvelocity penalty matrixVhfhigh-pass filtered velocity of N splines at points tqVqvelocity (first derivative) of N splines at points tqWweight matrix for the position errorsXN splines at the N observations time (t)XmM low-pass splines at the N observations time (t)hfSplinespline representation of the high-frequency part of the solutionlfSplinespline representation of the low-frequency part of the solutionmaxLambdalargest value of lambda different from infinity for double precisionmidLambdaa good starting value for lambdaminLambdalowest value of lambda different from zero for double precisiontKnotMknot points for the M low-pass splinestqthe (t)ime (q)uadrature grid
- Estimating error and likelihood
epsilondifferences between the observed positions (x) and the model positionsepsilonInRangedifferences between the observed positions (x) and the model positionsexpectedMeanSquareErrorThe expected mean-square error normalized by theexpectedMeanSquareErrorFromCVCross-validation (CV) estimate for the mean square errorexpectedMeanSquareErrorFromGCVGeneralized cross-validation (GCV) estimate for the mean-square errorexpectedMeanSquareErrorInPercentileRangeThe expected mean-square error within an expected percentile range, normalized by the variance.logLikelihoodlikelihood that the observed data fits the modelsmoothingMatrixsmoothing matrix maps observations to their smoothed values
- Minimizing error
minimizeOnLambdaminimize a penalty function by performing a search on lambdaminimizeOnMminimize a penalty function by performing a grid search on MminimizeOnMaternTminimize a penalty function by performing a search on maternTminimizeOnParametersminimize a penalty function by performing a search a defined set of parameter values- Parameter structure
appendParametersWithPenaltyappend parameter struct with current valuesparametersparameter struct with current valuesparametersForGridparameter struct with current valuesparametersWithPenaltyparameter struct with current valuessetParametersset parameters to new values
- Searching parameter space (Static methods)
appendParametersToParametersappend a parameter structure to another structuregridSearchOnLambdaperform a grid search on lambdagridSearchOnMperform a grid search on MgridSearchOnMaternTperform a grid search on maternTlogWrapperwraps a penalty function to take log10(lambda)minimizeOnLambdaBoundedminimize a penalty function by performing a bounded search on lambdasearchOnLambdaperform a search on lambda, returning penalty function valuessearchOnParametersevaluate penalty functions at each set of parameter values
- Methodology (Static methods)
knotPointsForDataPointscreate knot points appropriate for observation times tpevModelLambdaRangerange of lambda values for position-error velocity modelpevModelLogLikelihoodlog-likehood of the position-error-velocity modelpevModelSmoothingMatrixsmoothing matrix of the position-error velocity modelpevModelSolutioncompute the solution to the position-error velocity model
- Caching variables
LFromCachereturn a Cholesky autocovariance from the cache for given maternLMaternTMapcache of computation of the Matern Cholesky matrixaddLToCacheadd a Cholesky autocovariance to the cache for given maternsanitizeCacheForKclears the self.variableCache of any variables depedent on spline order KsanitizeCacheForMclears the self.variableCache of any variables depedent on MsanitizeCacheForMaternParametersclears the self.variableCache of any variables depedent on the maternvariableCachecache of computational expensive variables
- Internal
didSetMultipleParameterscalled after setting multiple parameterskParameterDidChangenotification that K changed and opportunity to clear caches,lambdaParameterDidChangenotification that M changed and opportunity to clear caches,mParameterDidChangenotification that M changed and opportunity to clear caches,maternParametersDidChangenotification that maternT or maternAlpha changed andrecomputeSolutionrecompute the solution the position-error velocity modelshouldRecomputeSolutionboolean indicating whether or not to compute solutionswillSetMultipleParameterscalled before setting multiple parameters to prevent
- Other