VectorSymbol
VectorSymbol[v]
represents a vector with name v.
VectorSymbol[v,d]
represents a vector of length d.
VectorSymbol[v,d,dom]
represents a vector with elements in the domain dom.
Details
- The name v in VectorSymbol[v,d,dom] can be any expression.
- A valid dimension specification d in VectorSymbol[v,d,dom] is any positive integer. It is also possible to work with symbolic dimension specifications.
- Element domain specifications dom in VectorSymbol[v,d,dom] include:
-
Complexes complex numbers Integers integers Reals real numbers NonNegativeReals real numbers x with x≥0 PositiveReals real numbers x with x>0 - In arithmetic and many other functions that work with lists, VectorSymbol objects do not automatically combine with other list arguments.
- Optimization functions, equation solvers and D recognize that VectorSymbol objects represent vector variables.
Examples
open allclose allBasic Examples (1)
Assign the value of the variable v to represent a length n vector with name "v":
Arithmetic operations recognize that v is not a scalar:
D recognizes that v is a vector variable:
Scope (5)
Applications (7)
Use a symbolic vector as a variable for optimization:
Find the vector that has the smallest sum of elements with a constraint:
Using a variable y treated by default as a scalar does not work since Total[y + {1,2,3}] expands:
Find the radius and center of a minimal enclosing ball that encompasses a set of k points in n dimensions:
The ball encloses point if Norm[pi-c]<=r:
Visualize the sphere and points:
The optimization works in any dimension:
Solve a differential equation for a vector-valued function:
Check that the residual is small:
Approximate the variance for a perturbed vector:
Since the second derivative does not depend on , the order-two approximation equals the exact value:
Find GammaDistribution parameters that best fit the given data using the maximum likelihood method:
Maximize the log-likelihood function :
Find a zero of the gradient, with replaced by :
Compare with the result computed using EstimatedDistribution:
Find an optimality condition for a portfolio optimization problem with the expected return and standard deviation :
The goal is to maximize when the vector of asset weights satisfies . The constraint can be used to represent , where the unconstrained vector variable consists of the first coordinates of :
The maximum occurs at a critical point of :
Express the condition in terms of :
Compute the gradient of the log-likelihood function of the linear regression model represented by the equation , where are normally distributed random variables with mean zero and variance :
The log-likelihood function is given by:
Text
Wolfram Research (2024), VectorSymbol, Wolfram Language function, https://reference.wolfram.com/language/ref/VectorSymbol.html.
CMS
Wolfram Language. 2024. "VectorSymbol." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/VectorSymbol.html.
APA
Wolfram Language. (2024). VectorSymbol. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/VectorSymbol.html