File: octave_22.html

package info (click to toggle)
octave 2.0.16-2
  • links: PTS
  • area: main
  • in suites: potato
  • size: 26,276 kB
  • ctags: 16,450
  • sloc: cpp: 67,548; fortran: 41,514; ansic: 26,682; sh: 7,361; makefile: 4,077; lex: 2,008; yacc: 1,849; lisp: 1,702; perl: 1,676; exp: 123
file content (126 lines) | stat: -rw-r--r-- 3,754 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<HTML>
<HEAD>
<!-- This HTML file has been created by texi2html 1.51
     from ./octave.texi on 18 June 1999 -->

<TITLE>GNU Octave - Optimization</TITLE>
</HEAD>
<BODY>
Go to the <A HREF="octave_1.html">first</A>, <A HREF="octave_21.html">previous</A>, <A HREF="octave_23.html">next</A>, <A HREF="octave_40.html">last</A> section, <A HREF="octave_toc.html">table of contents</A>.
<P><HR><P>


<H1><A NAME="SEC154" HREF="octave_toc.html#TOC154">Optimization</A></H1>

<P>
<A NAME="IDX756"></A>
<A NAME="IDX757"></A>
<A NAME="IDX758"></A>
<A NAME="IDX759"></A>
<A NAME="IDX760"></A>
<A NAME="IDX761"></A>

</P>


<H2><A NAME="SEC155" HREF="octave_toc.html#TOC155">Quadratic Programming</A></H2>



<H2><A NAME="SEC156" HREF="octave_toc.html#TOC156">Nonlinear Programming</A></H2>



<H2><A NAME="SEC157" HREF="octave_toc.html#TOC157">Linear Least Squares</A></H2>

<P>
<DL>
<DT><U>Function File:</U> [<VAR>beta</VAR>, <VAR>v</VAR>, <VAR>r</VAR>] = <B>gls</B> <I>(<VAR>y</VAR>, <VAR>x</VAR>, <VAR>o</VAR>)</I>
<DD><A NAME="IDX762"></A>
Generalized least squares estimation for the multivariate model
<CODE><VAR>y</VAR> = <VAR>x</VAR> * <VAR>b</VAR> + <VAR>e</VAR></CODE> with <CODE>mean (<VAR>e</VAR>) =
0</CODE> and <CODE>cov (vec (<VAR>e</VAR>)) = (<VAR>s</VAR>^2)*<VAR>o</VAR></CODE>,
 where
<VAR>Y</VAR> is a <VAR>T</VAR> by <VAR>p</VAR> matrix, <VAR>X</VAR> is a <VAR>T</VAR> by <VAR>k</VAR>
matrix, <VAR>B</VAR> is a <VAR>k</VAR> by <VAR>p</VAR> matrix, <VAR>E</VAR> is a <VAR>T</VAR> by
<VAR>p</VAR> matrix, and <VAR>O</VAR> is a <VAR>T</VAR><VAR>p</VAR> by <VAR>T</VAR><VAR>p</VAR>
matrix.

</P>
<P>
Each row of Y and X is an observation and each column a variable.

</P>
<P>
The return values <VAR>beta</VAR>, <VAR>v</VAR>, and <VAR>r</VAR> are defined as
follows.

</P>
<DL COMPACT>

<DT><VAR>beta</VAR>
<DD>
The GLS estimator for <VAR>b</VAR>.

<DT><VAR>v</VAR>
<DD>
The GLS estimator for <CODE><VAR>s</VAR>^2</CODE>.

<DT><VAR>r</VAR>
<DD>
The matrix of GLS residuals, <CODE><VAR>r</VAR> = <VAR>y</VAR> - <VAR>x</VAR> *
<VAR>beta</VAR></CODE>.
</DL>
</DL>

<P>
<DL>
<DT><U>Function File:</U> [<VAR>beta</VAR>, <VAR>sigma</VAR>, <VAR>r</VAR>] = <B>ols</B> <I>(<VAR>y</VAR>, <VAR>x</VAR>)</I>
<DD><A NAME="IDX763"></A>
Ordinary least squares estimation for the multivariate model
<CODE><VAR>y</VAR> = <VAR>x</VAR>*<VAR>b</VAR> + <VAR>e</VAR></CODE> with
<CODE>mean (<VAR>e</VAR>) = 0</CODE> and <CODE>cov (vec (<VAR>e</VAR>)) = kron (<VAR>s</VAR>,
<VAR>I</VAR>)</CODE>.
 where
<VAR>y</VAR> is a <VAR>t</VAR> by <VAR>p</VAR> matrix, <VAR>X</VAR> is a <VAR>t</VAR> by <VAR>k</VAR>
matrix, <VAR>B</VAR> is a <VAR>k</VAR> by <VAR>p</VAR> matrix, and <VAR>e</VAR> is a <VAR>t</VAR>
by <VAR>p</VAR> matrix.

</P>
<P>
Each row of <VAR>y</VAR> and <VAR>x</VAR> is an observation and each column a
variable.

</P>
<P>
The return values <VAR>beta</VAR>, <VAR>sigma</VAR>, and <VAR>r</VAR> are defined as
follows.

</P>
<DL COMPACT>

<DT><VAR>beta</VAR>
<DD>
The OLS estimator for <VAR>b</VAR>, <CODE><VAR>beta</VAR> = pinv (<VAR>x</VAR>) *
<VAR>y</VAR></CODE>, where <CODE>pinv (<VAR>x</VAR>)</CODE> denotes the pseudoinverse of
<VAR>x</VAR>.

<DT><VAR>sigma</VAR>
<DD>
The OLS estimator for the matrix <VAR>s</VAR>,


<PRE>
<VAR>sigma</VAR> = (<VAR>y</VAR>-<VAR>x</VAR>*<VAR>beta</VAR>)' * (<VAR>y</VAR>-<VAR>x</VAR>*<VAR>beta</VAR>) / (<VAR>t</VAR>-rank(<VAR>x</VAR>))
</PRE>

<DT><VAR>r</VAR>
<DD>
The matrix of OLS residuals, <CODE><VAR>r</VAR> = <VAR>y</VAR> - <VAR>x</VAR> * <VAR>beta</VAR></CODE>.
</DL>
</DL>

<P><HR><P>
Go to the <A HREF="octave_1.html">first</A>, <A HREF="octave_21.html">previous</A>, <A HREF="octave_23.html">next</A>, <A HREF="octave_40.html">last</A> section, <A HREF="octave_toc.html">table of contents</A>.
</BODY>
</HTML>