Linear and nonlinear models for the analysis of the relationship between stock market prices and macroeconomic and financial factors