Fibonacci by matrix and modulo of big fibonacci

How to get big fibonacci number using [matrices](http://stackoverflow.com/questions/28548457/nth-fibonacci-number-for-n-as-big-as-1019)

How to calc [modulo](http://ideone.com/fP8krp) (similar approach, from [Quora](https://www.quora.com/Whats-a-fast-algorithm-to-find-the-remainder-of-the-division-of-a-huge-Fibonacci-number-by-some-big-integer) answer)

The trick behind these methods is __exponentiation by [squaring](https://www.youtube.com/watch?v=bRMVU3Gy_JY)__

Can be implemented as a recursion on binary multipliers or as binary map. Second one looks quite tricky at first, but I like it.

Telegram cli and chat backup

Complete procedure can be googled from [here](https://www.haykranen.nl/2014/12/02/howto-backup-your-telegram-chats/).

Some comments on run:

  • don't just download it from github as a zip - there are patches, which will not be included in it (tgl and recursive directories). Solution as written in doc for tg-cli: git clone --recursive https://github.com/vysheng/tg.git && cd tg;
  • when compiled inside homebrew it shows an error: unused function 'get_peer'. Solution is [here](https://github.com/vysheng/tg/issues/996). It's simple - comment three strings in lua-tg.c and recompile;
  • to get chat history with all photos and videos set following parameters in telegram-history-dumpconfig.yaml to true:
    • copy_media: true
    • download_media ... photo, video, audio ... true.

On Big-O notation intuitively

Links for better understanding of Big-O and complexity estimation:

Variance and expected value

If we know $ mathit{E(varepsilon_1|X_1)} $ and $ mathit{E(varepsilon^2_1|X_1)} $ then we can get a $ mathit{Var(varepsilon_1|X_1)} $ as $ mathit{E(varepsilon^2_1|X_1)} - mathit{E(varepsilon_1|X_1)}^2 $.

And conditional variance can be get as $ mathit{Var(varepsilon_1)} = mathit{Var(mathit{E(varepsilon^2_1|X_1)})} + mathit{E(mathit{Var(varepsilon_1|X_1)})} $.

Multicollinearity monitoring

  1. Variance inflation factor: $$ mathit{VIF_j} = frac{1}{1-mathit{R^2_j}} $$
  2. Correlation: $$ mathit{sCorr(x,y)} = frac{sum(x_i - hat x)(y_i - hat y)/(n-1)}{sqrt{mathit{sVar(x)ast sVar(y)}}} $$
  3. Indicator values: $ mathit{VIF_j}>10 $, $ mathit{sCorr(x,y)}>0.9 $

Standard error formula

$$ mathit{se^2}(hat beta_j) = frac{hat sigma^2}{mathit{RSS_j}} = = frac{hat sigma^2}{mathit{TSS_j} ast (1-mathit{R^2_j})} = = frac{1}{(1-mathit{R^2_j})} ast frac{hat sigma^2}{mathit{TSS_j}} $$

And $ sigma $ is $ sqrt{E[(X-mu)^2]} = sqrt{E[mathit{X^2}]-(E[mathit{X}])^2} $, where $ mu = E[mathit{X}] $

But what is statistical error $ varepsilon $? Here it is $ varepsilon=mathit{X_i-mu} $, where $ mu $ is a population mean. But we work with real values which are only part of population, its sample and the sample mean is $ mathit{bar{X}} $. Then error become the residual: $ mathit{r_i} = mathit{X_i}-mathit{bar{X}} $.

Questions on stats

How to check

1. if we have enough independant variables? 1. if regression significant with chosen significant level.

Significance should be estimated by F-stats.