statsmodels.tsa.statespace.tools.validate_vector_shape¶
- statsmodels.tsa.statespace.tools.validate_vector_shape(name, shape, nrows, nobs)[source]¶
Validate the shape of a possibly time-varying vector, or raise an exception
- Parameters:
- name
str
The name of the vector being validated (used in exception messages)
- shapearray_like
The shape of the vector to be validated. May be of size 1 or (if the vector is time-varying) 2.
- nrows
int
The expected number of rows (elements of the vector).
- nobs
int
The number of observations (used to validate the last dimension of a time-varying vector)
- name
- Raises:
ValueError
If the vector is not of the desired shape.