Friday, September 23, 2011

Optimize portfolio with solver

Linear Programming

The most basic form of optimization programming is to write a linear program (LP) to find an answer that is based on a set of decision variables, linear constraints, and limited ranges. For example, a petroleum refinery could procure crude oil from two sources, minimize the purchase costs of crude oils that differ in quality, and meet minimum production levels of gasoline, jet fuel, and machine lubricant. You can use Solver Foundation to solve this problem by using variables, bounds, and the simplex solver. You can construct the model by using the AddVariable, AddRow, and AddGoal methods. For more information, see How to: Use Linear Programming using the Solver Foundation Solver APIs.
Quadratic Programming

You can use quadratic programs to solve economics problems such as optimizing a portfolio. A quadratic portfolio is a technique that economist Harry Markowitz developed to balance risk and return by mixing alternative investments. In this technique, the initial data is the performance history of a set of different investments. Linear calculations are performed on this data to determine the average rates of gain or loss, and then quadratic calculations are performed to determine the covariances, which are the amounts by which the average rates vary from one another over time. By using the Markowitz formulation, you can calculate a mix of investments to lower risk and achieve a relatively high average rate of return. For example, you could solve a portfolio to determine the lowest risk given a specific rate of return. For more information, see How to: Use Quadratic Programming to Optimize a Stock Portfolio.

Mixed Interger Linear Programming

Linear programs where some or all variables are required to be integers are known as mixed integer linear programs (MILP). This is applicable to problems where decisions are binary such as yes/no or items cannot be fractional. MILP problems can take an exponential time to solve due to the combinatorial solving process. To reduce the complexity, you can change the algorithm heuristics or use techniques such as branch-and-bound, efficient restarts, feasibility pumps, and cutting planes.

You can also use solution quality, or the gap, to reduce the time required to find a solution. A solve that is configured to find the best strict solution may take a long time, whereas a relaxed solution is one where not all the integer constraints are satisfied. The difference between the best strict solution and a relaxed solution is known as the gap, which can be adjusted to an acceptable tolerance level.

Cutting planes can be used to remove solutions that are not integer feasible and reduce the search space. You can enable this ability by setting the MixedIntegerGenerateCuts property to true. For more information, see How to: Make Investment Decisions using Mixed Integer Linear Programming.

Unconstraing Non-Linear Programming

To find the local optimum of a general unbound and unconstrained objective function, you can use the compact quasi-newton (CQN) solver. It uses a variant of Newton’s method by twice differentiating the function to find the local optimum most steeply connected to the starting point. The solver stops computation when the ToleranceDifference and Tolerance properties are equal. For more information, see How to: Use Unconstrained Non-Linear Programming.

Parameter management

better than many flat files but much simpler than RDBMS. redundant, local, cached and available on all platforms and programming languages.

http://couchdb.apache.org/
http://net.tutsplus.com/tutorials/getting-started-with-couchdb/

mapping JSON protocol by JSon.net
http://james.newtonking.com/projects/json-net.aspx

C# persistence mapper
https://github.com/foretagsplatsen/Divan



Thursday, September 22, 2011

LitJSON lib C#

to map C# objects from and to JSON this little library is all you need:

http://litjson.sourceforge.net/doc/manual.html#quickstart.mapping
http://litjson.sourceforge.net
    public static void PersonToJson ()
{
Person bill = new Person ();

bill.Name = "William Shakespeare";
bill.Age = 51;
bill.Birthday = new DateTime (1564, 4, 26);

string json_bill = JsonMapper.ToJson (bill);

Console.WriteLine (json_bill);
// {"Name":"William Shakespeare","Age":51,"Birthday":"04/26/1564 00:00:00"}
}

Parameter storage technology

In the search for the right technology, I identified a compromize between SQL based datastorage and flat files.

even so, parameters are many and multidimensional, also genetically evolving - they are not massive, like test results so the performance of a SQL db is not required.

in opposition, what is required and seems to be covered by NoSQL database approaches like CouchDB. http://wiki.apache.org/couchdb/
- autrak server to server communication. not  always - on philosophy allows redundancy and loose connection between systems but being able to use a common repository.
- easy changing structure of storage. strategies with an evolutionary approach develop own models and therefore extend or reduce dimensions of data. this means - the storage model is dynamic. that is more important than high-throughput.
- Mutli version concurrency control is the power I need here.
- the google patented Map-reduce method helps to maintain still performance.
- consistency and conflicts between storages can be covered by the system.

- REST protocoll based JSON-API which is close to other service based storages.
- document oriented file management system.
- accessible from all available programming languages and OS.
- functional programming language Erlang is used.
- master/slave replication and caching of remotely managed data.
- docuemnts have a unique ID
- queries can traverse any document which has the correct fieldname inside. anything else does not matter. - very flexible for changing structure.
- new views can be created from query results, and simply create new documents with the combined results. this makes it easy to summarize and merge different data and structures without excessive relational database modelling and mapping.
- distributed database system and fully redundant
- open source and cloud based.

final summary - fucking simple to use and really powerful. core technolgy used by Google, Amazon & Co

Wednesday, August 24, 2011

Wordpress

Slider image and text size:

Go to the includes/featured.php and edit this code:
Quote:
$width = 330;
$height = 220;

for text add this code to the end of the style.css:
Quote:
#featured-area .excerpt {
width: 300px !important;
}

Sunday, July 24, 2011

Always Learning

It feels like these days I am learning more than ever before in my life. It costs me a lot to keep up with all the stuff. Finally managed to complete my pre-thesis, a rough slide scheme for serge and could work over Jacks documentation for gator.


Presenter Media

browsed through the presenter media library to find nice images. Will use some ahere in this blog to keep them on the top of my mind.
www.presentermedia.com

Wednesday, June 29, 2011

Scrum Alliance - Transforming the World of Work

Scrum Alliance - Transforming the World of Work

Jeff Sutherland and myself on the Stuttgart SCRUM MASTER Training.

I were deeply impressed by receiving the vision behind the Agile methods from the Father of the SCRUM method personally.

Google Mail - FW: The surprising thruth about what motivates us - pressl.alex@googlemail.com

http://www.youtube.com/watch?v=u6XAPnuFjJc

Scrum Alliance - What Is Scrum?

Scrum Alliance - What Is Scrum?

  • Individuals and interactions over processes and tools
  • Completed functionality over comprehensive documentation
  • Customer collaboration over contract negotiation
  • Responding to change over following a plan

  1. Individuen und Interaktionen gelten mehr als Prozesse und Tools.
  2. Funktionierende Programme gelten mehr als ausführliche Dokumentation.
  3. Die stetige Zusammenarbeit mit dem Kunden steht über Verträgen.
  4. Der Mut und die Offenheit für Änderungen steht über dem Befolgen eines festgelegten Plans.

Monday, June 13, 2011

Citations are essential to link to great persons spirit

Not everything that can be counted counts, and not everything that counts can be counted.
Albert Einstein, (attributed)
 
 
Everything that is really great and inspiring is created by the individual who can labor in freedom.
[info][add][mail]
Albert Einstein (1879 - 1955), 'Out of My Later Years,' 1950
 
»Eine wirklich gute Idee erkennt man daran, dass ihre Verwirklichung von vorne herein ausgeschlossen erschien.« Albert Einstein