Extreme Optimization™: Complexity made simple.

Math and Statistics
Libraries for .NET

  • Home
  • Features
    • Math Library
    • Vector and Matrix Library
    • Statistics Library
    • Performance
    • Usability
  • Documentation
    • Introduction
    • Math Library User's Guide
    • Vector and Matrix Library User's Guide
    • Data Analysis Library User's Guide
    • Statistics Library User's Guide
    • Reference
  • Resources
    • Downloads
    • QuickStart Samples
    • Sample Applications
    • Frequently Asked Questions
    • Technical Support
  • Order
  • Company
    • About us
    • Testimonials
    • Customers
    • Press Releases
    • Careers
    • Partners
    • Contact us
Introduction
Deployment Guide
Nuget packages
Configuration
Using Parallelism
Expand Mathematics Library User's GuideMathematics Library User's Guide
Expand Vector and Matrix Library User's GuideVector and Matrix Library User's Guide
Expand Data Analysis Library User's GuideData Analysis Library User's Guide
Expand Statistics Library User's GuideStatistics Library User's Guide
Expand Data Access Library User's GuideData Access Library User's Guide
Expand ReferenceReference

Skip Navigation LinksHome»Documentation»Reference»Extreme.DataAnalysis»VectorExtensions Class»Methods»Lag Method Overloads»Lag(T) Method (Vector(T), Int32)

VectorExtensionsLagT Method (VectorT, Int32)

Extreme Optimization Numerical Libraries for .NET Professional
Returns a vector whose observations are moved ahead by the specified number of observations.

Namespace:  Extreme.DataAnalysis
Assembly:  Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.1
Syntax

C#
VB
C++
F#
Copy
public static Vector<T> Lag<T>(
	this Vector<T> vector,
	int lag
)
<ExtensionAttribute>
Public Shared Function Lag(Of T) ( 
	vector As Vector(Of T),
	lag As Integer
) As Vector(Of T)
public:
[ExtensionAttribute]
generic<typename T>
static Vector<T>^ Lag(
	Vector<T>^ vector, 
	int lag
)
[<ExtensionAttribute>]
static member Lag : 
        vector : Vector<'T> * 
        lag : int -> Vector<'T> 

Parameters

vector
Type: Extreme.MathematicsVectorT
The vector to transform.
lag
Type: SystemInt32
The number of observations to shift the series by.

Type Parameters

T

Return Value

Type: VectorT
A vector.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type VectorT. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Remarks

A positive value of lag indicates that the observations are shifted forward. If lag equals 1, then each new observation is the observation before the current observation. The first lag observations are set to NaN. If lag equals -1, then each new observation is the observation after the current observation. The last abs(lag) observations are set to NaN.

The name of the new vector depends on whether lag is positive or negative. If lag is positive, the new vector gets the name lag<n>(<name>), where <n> is the lag and <name> is the name of the original vector. If lag is positive, the new vector gets the name lead<abs(n)>(<name>).

See Also

Reference

VectorExtensions Class
Lag Overload
Extreme.DataAnalysis Namespace

Copyright (c) 2004-2023 ExoAnalytics Inc.

Send comments on this topic to support@extremeoptimization.com

Copyright © 2004-2023, Extreme Optimization. All rights reserved.
Extreme Optimization, Complexity made simple, M#, and M Sharp are trademarks of ExoAnalytics Inc.
Microsoft, Visual C#, Visual Basic, Visual Studio, Visual Studio.NET, and the Optimized for Visual Studio logo
are registered trademarks of Microsoft Corporation.