
    >h              	          S r SSKrSSKJrJrJr  SSKJrJrJ	r	  SSK
Jr  SSKJr  S rS rS r\R&                  " S	5      r\R*                  S   r\" \\5      r\R0                  " S
5        \R2                  " \5      r\" S5        S
r/ r\	R<                  " \\\\S
S9u  rr r!r"r#r$r%r&\%S:X  a9  \RN                  " \RP                  " S\)" \5      5      \5        \" S\" \5      5        \" S5        \" S5        / r\	RT                  " \\\\\S
S9u  rr r+r,r-r%r&\%S:X  aK  \R\                  " 5         \RN                  " \RP                  " S\)" \5      5      \5        \" S\" \5      5        gg)zWhat's the origin of this file? It is not ours.
Does not run because of missing mtx files, now included

changes: JP corrections to imports so it runs, comment out print
    N)dotouterrandom)iolinalgoptimize)eyec                 6   [        U R                  [        U -  5      [        U R                  [        U -  5      -  n[        U -  U[        -  U -  -
  [        R
                  " [        U -  5      -  n[        R                  [        R
                  " U5      5        U$ )N)r   TABr   normdataappend)vrqress      jC:\Users\julio\OneDrive\Documentos\Trabajo\Ideas Frescas\venv\Lib\site-packages\statsmodels/sandbox/mle.pyRr      si    	QSS1c!##acl	"BQ3r!tAv:v{{1Q3'
'CKKC !I    c                     S[         U -  [        U 5      [        -  U -  -
  -  [        U R                  [        U -  5      -  nU$ )z	Gradient    )r   r   r   r   r   r   results     r   Rpr      s8    !AaDF1Hc!##acl*FMr   c                     S[         [        U 5      [        -  -
  [        [        U -  [	        U 5      5      -
  [        [	        U 5      [        U -  5      -
  -  [        U R                  [        U -  5      -  nU$ )zHessian r   )r   r   r   r   r   r   r   r   s     r   Rppr      sX    !A$q&qs2a5))%1ac*::;CAaCLHFMr   znos4.mtx   ztry fmin_bfgs)fprimefull_outputretallzRayleigh quotient BFGSzfmin_bfgs OKztry fmin_ncg)r   fhessr    r!   zRayleigh quotient NCG)/__doc__numpynpr   r   r   scipyr   r   r   scipy.sparser	   speyematplotlib.pyplotpyplotpltr   r   r   mmreadr   shapenr   seedrandv_0printr    r   	fmin_bfgsr   foptgoptHopt
func_calls
grad_callswarnflagallvecssemilogyarangelenfmin_ncgfcallsgcallshcallsfigure r   r   <module>rD      sh  
  % % & & %  IIj GGAJ	!AJ A
KKN o 1S{!L >$dJ
Hgq=LL1SY'-	
"1Q4( n  n 
 !CrSTU 2$'Q;JJLLL1SY'-	
!!A$' r   