Statistical Models

  1. Generative Models and Discrimative Models

Generative models try to maximum the joint probability of the whole sequence, while discrimitive models try to maximum the conditional probability of a single token.
HMM is a generative model; CRF is a discrimitive model.

2018年12月随笔

  1. Fundemental Issues of a Company
    Aside of earnings, many details are worth noting in the fundemental health of a company. Short-term liquidity issue is a typical case.

  2. The repayment of fixed income securities

The repayment is never guaranteed, but involves certain degree of defaults.

  1. Mutual Fund
    Mutual fund has two basic functions:
    a. pooling of risk
    b. agent of ownership

Through pooling, an investor of a mutual fund enjoys corresponding pieces of ownership of a varitiy of securities through the mutual fund.

  1. All other things equal
    The per share price of a stock will keep increasing if no dividend is paid from retained earnings. That is to say, the retained earnings kept pile up or reinvested into the business.

  2. The rise and falls of ETF fund prices

Prices tend to rise before the dividend distribution day. Then fall immediately after the dividend distribution day.

  1. Lending and Borrowing

Lending is a temporary surrender of control of economic resources so as to seek possible economic benefits.

Borrowing is acquire of control of economic resources so as to seek possible economic benefits.

Part of the value of a company are belong to the creditors.

  1. Future Value and Present Value
    The future value of certain amount of current cash depends largely on the realizable rate of return.

Normally speaking, the future value and present value are referring to a rate of return that is riskless.

Riskless time value of money refers to the discount rate (cut... that reflects a decline in buying power).
(Cut... Under current fiat monetary system, As riskless interest rate is set by the central bank, thus the riskless interest rate is actually the artificial decline in buying power enforced by central bank policy (Really SO ?)).

  1. Economic Value of Technology Breakthrough = Impact of Potential Application/Implementation Difficulity

  2. 债券发行时的Yield to Maturity由无风险利率+预期通胀率+预期风险溢价之和决定,然后YTM决定了债券发行价格(可能每个买家不同)
    之后YTM由债券的市场价格波动决定

The YTM is defined as the interest rate that makes the present value of a bond's payments equal to its price. (Assuming coupon payments are reinvested at the same rate as the YTM)

  1. High operating or financial leverage is the source of net earnings fluctuations.

  2. Corporate Intransic Value Discount Rate
    U.S. treasury bond rate; Federal Fund Target Rate; Federal Fund Rate

  3. 数量型宏观调控政策
    比如:以M2,M3等货币量为调控目标,调整存款准备金率

  4. Buffett's Oppertunity Cost
    Focusing on oppertunity cost is another way of maximizing the long-term return expectation.

  5. Political Conflicit
    The cause of political conflicit: Fight for benefits attached to the organizational power.

  6. The Central Position of Cash in Valuation
    Cash is the most generally accepted medium of exchange, which has the universal purchasing power. The nominal value of all other assets are measured and expressed in a certain amount of currency, which essentially is cash. In a boarder sense, in cash means realiable transaction (v.s. in credit).

Accounts receivables and payables are cash inflows and outflows that were to be realized in the near future. Other non-current assets and liabilities, excluding "accounting" assets (prepaid expense, etc), are cash inflows and outflows that were to be realized in further future, whether intended or forced.

Cash flow is systematically lagged behiend revenue expense flow in timing but they can reconcile in amount. Cash flow figures measure transactions that were realized but revenue expense figures measure past transactions that are both realized and unrealized, in actual or estimated number.

The earning performance is more accuratly demonstrated in cash flow than revenue expense, as cash flow is based on transactions that are realized.

  1. Ex-dividend Price Drop
    Cause: a. dividend distribution may decrease the ex-dividend future return of the security
    b. If the stock price was pushed up under the expectation of possible dividend distribution, it is natural for price to return after the distribution is realized.

Berkshire Hathaway Letter

Warren Buffet

According to related descriptions in wikipedia, buffet sold a co-owned business when he was a sophmore (year 1945) in high school for around $1000. If we assume his savings was 10 times of the business he sold 10 years later, then by 1955, his savings would be $10,000. A second description in wikipeida stated that buffet finished college (after 5 years) with a saving of $9,800, which collaborates with our first estimation in terms of magitude. A concervative estimation of buffet's wealth when he founded Buffett Partnership, Ltd would be around $100,000 (around 6.3 Million RMB)

1957 Letter

In buffet's view, the market is in general priced above intrinsic value. This view relates to blue-chip securities. Buffet stated that if this view is accurate, it is possible that a substantial decline in all stock prices, both overvalued and undervalued, is to happen. As it is very unlikely that current market level will be thought of as cheap 5 years from now. Even a full-scale bear market won't hurt the current work-out portfolio. In buffet's plan, if the general market were to return to an undervalued status, he would invest in the undervalued general issues. It should be noted that, for Buffett at this time, debt financing is an option for the fund needed for general issue investment under this condition. If the general market were to move to a higher level (overvaluation), Buffett plan to put more capital on work-outs.

In Buffett's view, a market decline followed by general decline in earning power is a normal market behavior and it should be. Any market decline not in the same magnitude with the decline in earning power can be considered as "moderate".

1958 Letter

1958 year, In Mr Buffett's view, is a year with huge number of amateurs entering into the market, pushing up the general market level. The public enthusiasm on stock market will eventually cause trouble, affecting even undervalued stocks. Commonwealth Trust Co. of Union City is the stock our partnerships has large stakes on, we hope its price to remain stable or even decline, so we can purchase more shares for a reasonable price. This would hold back our overall portfolio performance.

Buffett stated that the performance of thier portolio, due to their strategy, would be better in a bear market than in a bull market. He is well statisfied to match the advance of the general market in a bull year.

The partnership has large stake in the Commonwealth Trust Co. of Union City, New Jersey. For reasons including not paying dividends and etcs, the market price for the Comonwealth's stock is $50, while the intransic value of the company is $125 under Buffett's estimation.

1959 Letter

To the extent possible, invest in situations at least partially insulated from the behavior of the general market. This policy should lead to superior results in bear markets and average performance in bull markets. (In modern sense, a low beta, high potential alpha policy. By this policy, an investor can minimize the adverse influence of the general market which he cannot control, therefore the uncertainty of the investment is minimized.)

1977 Letter

  1. Capital Gain
    It is improper to include capital gains and losses when evaluating the performance of a company for a single year, they are an important component of the longer term record.

Buffet admits that

Apache Spark Note

  1. spark-submit提交有第三方依赖的python脚本
    First off, I'll assume that your dependencies are listed in requirements.txt. To package and zip the dependencies, run the following at the command line:

pip install -t dependencies -r requirements.txt
cd dependencies
zip -r ../dependencies.zip .
Above, the cd dependencies command is crucial to ensure that the modules are the in the top level of the zip file. Thanks to Dan Corin's post for heads up.

Next, submit the job via:

spark-submit --py-files dependencies.zip spark_job.py
The --py-files directive sends the zip file to the Spark workers but does not add it to the PYTHONPATH (source of confusion for me). To add the dependencies to the PYTHONPATH to fix the ImportError, add the following line to the Spark job, spark_job.py:

sc.addPyFile("dependencies.zip")

2018年11月随笔

  1. Share-based compensation (options, etc)
    不消耗公司资金,但增加了流通股数量,降低公司EPS, 同时增大了股票下行压力(被奖励人套现)

  2. FCF (Free Cash Flow) Formula
    FCF = (Sales - OPEXP - DEPEXP)(1-tao) + DEPEXP - Delta WC - CAPEXP

  3. 宏观经济的研究框架
    以利率为出发点,通过把握整体信贷环境、银根的松紧程度、宏观信用和债务风险来评估当前所处的债务周期阶段;进一步引申出制造业和第三产业的投资以及扩张意愿。
    制造业和第三产业的投资及扩张意愿会直接影响中产收入增长和消费意愿,从而引导下游终端企业的生产和投资计划,形成闭环。

  4. Marketable Securities: Intransic Value v.s. Market Price
    The intransic value of a stock often reveals when negotiated at a merger or acquisition.

  5. Buffet's long-term value investing is under the assumption that excellent business results by corporations will translate over the long term into correspondingly excellent market value and dividend results for owners, minority as well as majority. This assumption is very unlikely to be true for most public companies in China.

  6. Price Volatility can be represented by Coefficient of Variance, which avoids the maginitude effect when using std/variance as measurement. Price Volatility can be compared over an aggregated long-term period, or over the average of the separate daily cov result.

Moreover, the price volatility is shown by observing the daily percentage change of the quote.

Std/Variance or cov is designed to measure a statistical population which may or may not observed from a single entity. When the research objective is a single entity with periodically continueous value (hourly, daily, etc), percentage change is a more understandable measurement.

  1. Non-voting shares as the certificate of beneficial interest
    As opposed to controlling interest.

  2. 价值观和评价体系与客观物质环境紧密相关,中西方的贫富差异决定了国内更注重金钱等物质财富的创造和积累,而西方注重文化、体育等非物质财富的创造。在这种背景下,中西方社会群体对个体行为选择的评价方式也产生了极大差异

  3. 赚钱的几种方式:
    跪着赚钱、躺着赚钱、站着赚钱

  4. Bargin Purchase

A typical bargin purchase targets a company for which the future appears neither distinctly promising nor distinctly unpromising. Uncertainty can be avoid by making decisions other than the future growth of the company. In addition, a good bargin purchase only considers company which is unlikely to have a substantialy decline in earning power. Combing the two previous criteria with a bargin price under conservative evaluation of the intranic value, a margin of safty can be established in the investment.

  1. Earning Power
    Earning Power of the Company = EBIT (Earnings excluding interest and taxes)
    Earning Power of common shares = Net Income

  2. G20 Observation

President Xi seems to be short in personal connections with other world learders. One evidence will be the lack of casual conversations while wating for the class photo taking.

My Investment Philosophy

Intransic Value

Intransic value only concerns about the earning power of the business, not including the growth potential. Value investing is about buying at a bargin price (compared to intransic value) with enough margin of safety. Invest in certainty.

Investing in growth potential is speculation and add more factors on top of the intransic value and current price level (bargin or not). More factors, higher uncertainties.

Evaluation of An entities'ability to pay back debt

  1. The ability to service debt interest

EBIT/Interest Payment
Net Cash Inflow/Interest Payment
2. The ability to service debt principle

Net Income/Debt Principle

Maintaining a long-term short position should be avoided.

  1. As long-term short position does not offer possible dividend income and foregone the trend of long-term economic growth, it should be avoided.

Distinction Between Inflationary Debt Cycle and Deflationary Debt Cycle

Inflationary debt cycle and deflationary debt cycle diffes in the deleveraging phase. Inflationary debt cycle refers to a debt cycle with a deleveraging process that is inflationary. Deflationary debt cycle likewise.

做空的理由

做空的理由是股票价格被严重高估(相对于intransic value),而不是股价即将下跌。

Intransic Value

The discount rate of intransic valuation based on future free cash flow should be based on the risk-free interest rate.

About Short Term Prediction

In most times we do not predict the short-term movement of the price of a specific stock, because it is impossible to make it right in a realible way. Not mention the general market. However, in extreme cases, short-term price movement can be attempted, especially when the stock experience a tremendous price jump (50% upward overnight), or extremely good news was released to the market.

Aside of the conditions mentioned above, the return of speculation on short-term movement either by news or price fluctuation depends on the timing of buy/sale and calculated guess.

Short Term Investment

  1. Short-term investment out of margin of safety
    Short-term short sell = Event driven/News driven, it is very unlikely that the price will go upward in short term. = Margin of safety

  2. 利用市场的价格波动性来获利,即择时反向操作,利用价格波动的必然性,无论涨跌,股票价格的上下波动本身是一个恒定不变的模式。 对优质股来说,价格不会剧烈波动,从而保证了利用波动本身获利的交易策略具有一定的风险可控性。

A-template-for-understanding-big-debt-crises读书笔记

债务周期的长期负面影响

  1. 债权人的损失
  2. 债务人的未来收入和支出削减

观测债务周期的关键指标

  1. Debt to Income Ratio
  2. Debt Service Payment to Income Ratio

Credit is "Money"

Most of what people think is money is really credit, and credit does appear out of thin air during good times and then disappear at bad times.

A big part of the deleveraging process is people discovering that much of what they thought of as their wealth was merely people's promises to give them money.

债务危机的根源

举债投资的边际效用减弱,收入增长不及债务成本增长

How to deleverage the Economy

Make income grow faster than debt, lowering the debt-to-income ratio. For the burdens from existing debt not to increase, nominal income growth must be higher than nominal interest rate.

2018年10月随笔

The limitation of Market Valuation

Market valuation by stock price * number of shares is misleading, because not all shares can be sold on the same quoted market price at the same time. Once large volume of dumping emerged, the stock price is definitely going to drop significantly.

An estimation can be made by multiplying market value by a factor, say 0.7.

The Nature of Equity Investment

  1. Source of Income (dividend, earnings)
  2. Marketable Security

The underlying substance of knowledge

  1. Facts
  2. Cause-and-effect relationship among events
  3. Distribution of possible outcomes on certain event

The underlying utility of knowledge

  1. Prediction
  2. Analysis of the past, revealing what happened.

Economic Downturn Periods

  1. Financial Crisis of 2007 - 2008 (2008 Financial Crisis, lead to the Great Recession)

Strong Foreigh Capital Inflow can help keep long-term interest rate low despect the Fed kept raising short-term rate.

The Inherent Inevitability of Crisis

If the danger of crisis was fully recognized by related party, it would never happen. Crisi usually happens when situation looks good, when the potential of crisis was not be foreseen by the authority. Therefore, crisis is very likely to happen even when authority claims everything will be fine (out of true heart or not).

Financial Crisis happens when Big Financial Giant cannot meet obligations (fulfill contracts). To meet these obligations, large amount of financial assets have to be sold, which drives down asset price.

When yield curve flatten, holding short-term assets becomes attractive since their yield increases.

The contagious of 2008 financial crisis

European banks invested in the U.S. subprime mortage market sufferred great losses. The tightening money market in U.S. crippled some European banks who rely on the U.S. financial market to raise short-term fund and maintain liquidity.

Structured Investment Vehicle

Borrowing short-term to invest long-term, by entities established off-shore to avoid regulations

Mezzanine Capital

Any subordinate debt or preferred equity instructment that represents a claim on a company's assets which is senior only to that of the common shares.

The U.S government saved U.S. auto industry by providing loans from government fund

The ultimate Loss

Government assistantace and the act of bail out will ultimately impose the loss on taxpayers, non the less the currency depreciation. Those suffers also includes foreign U.S. currency and bond holers

2009年3月18日,在美国政府宣布将加大量化宽松操作时,金价为何大涨

货币贬值 --> 金价大涨(保值)
预期驱动交易

货币走弱的两个表现

  1. 国内: 通货膨胀
  2. 国外: 大宗商品价格上涨(黄金、石油等),对一揽子货币贬值

做空的风格选择

  1. 短线为主,适合做空的股票往往波动性较大,大幅下跌后经常回撤上涨,短线宜以波动性即得收益为主。预期下跌后平仓等待股票回撤。待有合适回撤后继续做空。波段性操作。

The Underlying Cause of 2008-2011 financial crisis

  1. Tremendous misestimation and Ignorance of the Risk related to mortage related financial assets.
  2. Leveraged Investing

Classic Sign of Buble

New buyers flooded the market, many of them have no prior experience.

The Substance of Financial Crisis

The deveraging process is the process of contracting balance sheet for every participants in the credit market, as large scale credit defaults occuried.

As the overall capital in the economy stay unchanged, the real impack to the market is investor faith and the failure of systematically important institutions.

The collapse of faith is usually followed by a strain of liquidity, which spread the crisis to non-financial sectors.

Recording

It is organization, not medium of storage, that really matters in periodical recording of information.

Bonus Army Conflict

1932年7月28日,美国华盛顿武装驱离抗议人群,出动坦克

Recurrent Neural Network

  1. Simple RNN (Elman Network)
    The state of the Simple RNN cell is the output of the activation function, the output of the RNN cell is the same as the state

  2. LSTM
    The state of the RNN cell is different from the output of the cell. The LSTM cell has a seperate output gate.

  3. Batch Size

A batch contains the whole sequence in consideration, with all time steps included.
Batch size = 5, means 5 sentences, each with a number of #time_step features.

  1. Keras
    RNN class, model.fit()输入tensor的shape为(batch_size, timestep, feature_num)
    RNN(x, input_shape=(timestep, feature_num))
    timestep为bp gradient descent的步数(即RNN网络unroll为普通NN的长度)