ts2func
Convert time series arrays to functions of time and state
Description
Examples
Input Arguments
Output Arguments
Algorithms
When you specify
Array
as a scalar or a vector (row or column),ts2func
assumes that it represents a univariate time series.F
returns an array with one less dimension than the input time series arrayArray
with whichF
is associated. Thus, whenArray
is a vector, a 2-dimensional matrix, or a three-dimensional array,F
returns a scalar, vector, or 2-dimensional matrix, respectively.When the scalar time t at which
ts2func
evaluates the functionF
does not coincide with an observation time inTimes
,F
performs a zero-order-hold interpolation. The only exception is if t precedes the first element ofTimes
, in which case F(t) = F(Times(1)).To support Monte Carlo simulation methods, the output function
F
returns anNVars
-by-1
column vector or a two-dimensional matrix withNVars
rows.The output function
F
is always a deterministic function of time, F(t), and may always be called with a single input regardless of theDeterministic
flag. The distinction is that whenDeterministic
is false, the functionF
may also be called with a second input, anNVars
-by-1
state vector X(t), which is a placeholder and ignored. While F(t) and F(t,X) produce identical results, the former specifically indicates that the function is a deterministic function of time, and may offer significant performance benefits in some situations.
References
[1] Ait-Sahalia, Y. “Testing Continuous-Time Models of the Spot Interest Rate.” The Review of Financial Studies, Spring 1996, Vol. 9, No. 2, pp. 385–426.
[2] Ait-Sahalia, Y. “Transition Densities for Interest Rate and Other Nonlinear Diffusions.” The Journal of Finance, Vol. 54, No. 4, August 1999.
[3] Glasserman, P. Monte Carlo Methods in Financial Engineering. New York, Springer-Verlag, 2004.
[4] Hull, J. C. Options, Futures, and Other Derivatives, 5th ed. Englewood Cliffs, NJ: Prentice Hall, 2002.
[5] Johnson, N. L., S. Kotz, and N. Balakrishnan. Continuous Univariate Distributions. Vol. 2, 2nd ed. New York, John Wiley & Sons, 1995.
[6] Shreve, S. E. Stochastic Calculus for Finance II: Continuous-Time Models. New York: Springer-Verlag, 2004.
Version History
Introduced in R2008a