Quantitative finance collector
C++ Matlab VBA/Excel Java Mathematica R/Splus Net Code Site Other
Oct 1
Using Kalman Filter for CIR interest rate model parameter estimation was introduced at my previously post Kalman Filter finance, soon after that I got a few comments saying the final results are unstable and highly depend on the initial values, that's true, local vs global minimum is never ending.

This post is therefore a sample test of the optimization functions in R as I started to move from Matlab to R recently, and R allows us to choose the method we'd like to use for minimization.
Purpose: to estimate the parameters for Vasicek interest rate model;
Function to be minimized: similar as in Kalman Filter finance, where a CIR model is used instead;
Number of Parameters: 8
Data: two years time series of 3 month, 6 month, 1 year and 5 year US interest rate;
R function to be tested: nlm, optim(Nelder-Mead), optim(BFGS), optim(SANN), nlminb, optim (L-BFGS-B)

The true values are listed in the paper "estimating and testing exponential-affine term structure models by kalman filter", abs.tol and rel.tol are set to be 1e-6 wherever possible, derivative is not given and unconstrained optimization is prefered
Tags: , ,
Sep 29
The Matlab conference this year will be host at Wembley Stadium in London on September 30. If you happen to be in London that day, this is great chance to join hundreds of engineers, financial professionals, and scientists from leading companies and financial institutions to learn about the newest features and latest functionality of the MATLAB® product family. The conference is free, but registration is required.

You can view the agenda and register online at http://www.mathworks.com/company/events/conferences/mc2010-linkedin/index.html, a few possible interesting events are:

Incorporating Symbolic Calculations into MATLAB with Symbolic Math Toolbox
This master class will show how you can take advantage of symbolic calculations within the MATLAB environment for modelling, simulation, and design tasks. Using the latest features in Symbolic Math Toolbox™, including the new MuPAD notebook interface, two case studies will be examined. A wind turbine model will be developed, documented, and integrated with MATLAB as part of a design optimization study. We will also examine the use of MathWorks tools for symbolic and numeric calculations using an example from the BLOODHOUND Project, which involves a World Land Speed Record attempt and aims to inspire young people to pursue careers in science, technology, engineering, and mathematics.
Sep 17
Quantivity introduced an interesting article a few days ago Combined Regression and Ranking that may be interesting to some of you.

The basic idea of Combined Regression and Ranking is to optimize regression and ranking objectives simultaneously. Generally we are trying to keep the predicted values as close as possible to the true target value for regression based method, such as minimizing the mean square error (MSE), however, besides accurately producing values, in some circumstances we are more interested in a model able to predict the ranking as well. A good example in the paper is: considering nearly all observations have target value y=0 and only a small fraction have value y=1, therefore a model predicting 0 for all cases is good enough using regression, however, it failes to return a useful & meaningful ranking.

The objective funtion for combined regression and ranking is given by
objective function
where the first part is for regression loss, the second part is for pairwise ranking loss, and the parameter alpha intuitively trades off between optimizing regression loss and optimizing pairwise loss.
Sep 15
AAN left comments yesterday at the post Download historical stock price saying the methods I shared are either only for a single stock historical prices, such as Yahoo chinese historical stock data, or for multiple stocks quotes of the latest trading day, like Excellent Yahoo Finance Data Downloader, however, what he (and many others I guess) wants is an Excel to download multiple stocks historical quotes from Yahoo finance, fair enough.

Although I don't recommend to do this in Excel as it becomes messy with more and more stocks added, I attach a sample excel with Macro for multiple stocks quotes downloading.
PS: the main part of the macro is from http://www.mrexcel.com/forum/showthread.php?t=66516&page=2, what I did was modifying the code, allowing users to re-load data, which isn't permitted and returns an error in the original code.

1, download the attached excel, open it and enable data connections if your excel warns you for security reason;
2, fill in the stocks symbols, start & end date you need in the sheet "Input",
yahoo finance download table
Tags: ,
Sep 14
Nonlinear principal component analysis (NLPCA) is commonly seen as a nonlinear generalization of standard principal component analysis (PCA). It generalizes the principal components from straight lines to curves (nonlinear). Thus, the subspace in the original data space which is described by all nonlinear components is also curved.
Nonlinear PCA can be achieved by using a neural network with an autoassociative architecture also known as autoencoder, replicator network, bottleneck or sandglass type network. Such autoassociative neural network is a multi-layer perceptron that performs an identity mapping, meaning that the output of the network is required to be identical to the input. However, in the middle of the network is a layer that works as a bottleneck in which a reduction of the dimension of the data is enforced. This bottleneck-layer provides the desired component values (scores).

Interested readers shall download the Nonlinear PCA Matlab Toolbox at http://www.nlpca.de/matlab.html
Tags: ,
Pages: 9/69 First page Previous page 4 5 6 7 8 9 10 11 12 13 Next page Final page [ View by Articles | List ]