Tole so delal na petkovih (4.5.) vajah...
prvi del je saaty, drugi pa metoda min.kvadr. Sam ne vem kje se konča eno
in začne drugo. :)

LP!

R version 2.4.1 (2006-12-18)
Copyright (C) 2006 The R Foundation for Statistical Computing
ISBN 3-900051-07-0

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

source("sport.R")
razburljivost
   [,1]      [,2]      [,3]
[1,]    1 0.3333333 0.1666667
[2,]    3 1.0000000 0.5000000
[3,]    6 2.0000000 1.0000000
RI
Error: object "RI" not found
k=eigen(kriteriji)ž
Error: syntax error in "k=eigen(kriteriji)ž"
k=eigen(kriteriji)
k
$values
[1]  3.0092027+0.000000i -0.0046014+0.166348i -0.0046014-0.166348i

$vectors
           [,1]                  [,2]                  [,3]
[1,] 0.2564554+0i  0.1282277+0.2220969i  0.1282277-0.2220969i
[2,] 0.4660103+0i  0.2330052-0.4035768i  0.2330052+0.4035768i
[3,] 0.8467969+0i -0.8467969+0.0000000i -0.8467969+0.0000000i

k$values
[1]  3.0092027+0.000000i -0.0046014+0.166348i -0.0046014-0.166348i
k$vectors
           [,1]                  [,2]                  [,3]
[1,] 0.2564554+0i  0.1282277+0.2220969i  0.1282277-0.2220969i
[2,] 0.4660103+0i  0.2330052-0.4035768i  0.2330052+0.4035768i
[3,] 0.8467969+0i -0.8467969+0.0000000i -0.8467969+0.0000000i
w=k$vectors[ ,1]
w
[1] 0.2564554+0i 0.4660103+0i 0.8467969+0i
as.numeric
function (x, ...)
UseMethod("as.double")
<environment: namespace:base>
as.numeric(w)
[1] 0.2564554 0.4660103 0.8467969
w=w/sum(w)
w
[1] 0.1634241+0i 0.2969613+0i 0.5396146+0i
as.numeric(w)
[1] 0.1634241 0.2969613 0.5396146
w
[1] 0.1634241+0i 0.2969613+0i 0.5396146+0i
l=as.numeric(w)
l
[1] 0.1634241 0.2969613 0.5396146
k
$values
[1]  3.0092027+0.000000i -0.0046014+0.166348i -0.0046014-0.166348i

$vectors
           [,1]                  [,2]                  [,3]
[1,] 0.2564554+0i  0.1282277+0.2220969i  0.1282277-0.2220969i
[2,] 0.4660103+0i  0.2330052-0.4035768i  0.2330052+0.4035768i
[3,] 0.8467969+0i -0.8467969+0.0000000i -0.8467969+0.0000000i

u=c(0.16,0.3,0.54)
u
[1] 0.16 0.30 0.54
t=c(0.64,0.7,0.1)
t*u
[1] 0.1024 0.2100 0.0540
u*t
[1] 0.1024 0.2100 0.0540
x=seq(0,5,length.out=20)
x
[1] 0.0000000 0.2631579 0.5263158 0.7894737 1.0526316 1.3157895 1.5789474
[8] 1.8421053 2.1052632 2.3684211 2.6315789 2.8947368 3.1578947 3.4210526
[15] 3.6842105 3.9473684 4.2105263 4.4736842 4.7368421 5.0000000
y=1/(1+log(1+x/2))+0,1*nrand(0,1,20)
Error: syntax error in "y=1/(1+log(1+x/2))+0,"
y=1/(1+log(1+x/2))+0.1*nrand(0,1,20)
Error: could not find function "nrand"
y=1/(1+log(1+x/2))+0.1*n.rand(0,1,20)
Error: could not find function "n.rand"
y=1/(1+log(1+x/2))+0.1*rand(0,1,20)
Error: could not find function "rand"
y=1/(1+log(1+x/2))+0.1*nran(0,1,20)
Error: could not find function "nran"
y=1/(1+log(1+x/2))+0.1*nrnd(0,1,20)
Error: could not find function "nrnd"
y=1/(1+log(1+x/2))+nrand(20,0,0.1)
Error: could not find function "nrand"
y=1/(1+log(1+x/2))+runif(20,0,0.1)
y
[1] 1.0735841 0.9475961 0.8568383 0.8094183 0.8009302 0.7047753 0.7201417
[8] 0.6507764 0.6095408 0.6612113 0.5893757 0.5712104 0.5971634 0.5931155
[15] 0.5842896 0.5235969 0.4771242 0.5078875 0.5311518 0.4932266
plot(x,y,col='red')
runif(5,0,0.1)
[1] 0.00909278 0.06738363 0.06642214 0.01196224 0.01978392
y=exp(1/y)
plot(x,y)
y=1/(1+log(1+x/2))+runif(20,0,0.05)
y=exp(1/y)
plot(x,y)
smo dobl velki Y
Error: syntax error in "smo dobl"
linmodel=lm(Y~x)
Error in eval(expr, envir, enclos) : object "Y" not found
linmodel
Error: object "linmodel" not found
linmodel=lm(y~x)
linmodel

Call:
lm(formula = y ~ x)

Coefficients:
(Intercept)            x
    2.625        1.191

A=coef(linmodel)[{1}]
A
(Intercept)
 2.624571
B=coef(linmodel)[{2}]
B
     x
1.190528
lines(x,A+B*x,col='blue')
alfa0=log(A)
beta0=A/B
alfa=
+ ;
Error: syntax error in:
"alfa=
;"
alfa0
(Intercept)
0.9649173
beta0
(Intercept)
 2.204544
plot(x,y)
plot(x,y)
lines(x,1/(alfa0+log(1+x/beta0)),col='red')
plot(x,y)
lines(x,1/(alfa0+log(1+x/beta0)),col='red')
alfa=log(A)
alfa0=log(A)
beta0=A/B
plot(x,y)
plot(x,y)
lines(x,1/(alfa0+log(1+x/beta0)),col='red')
alfa0
(Intercept)
0.9649173
alfa0=log(A)
alfa0
(Intercept)
0.9649173
nelinmodel=nls(y~I(1/(a+log(1+x/b))),start=list(a=alfa0,b=beta0))
Error in nls(y ~ I(1/(a + log(1 + x/b))), start = list(a = alfa0, b =
beta0)) :
      singular gradient
nelinmodel=nls(y~I(1/(a+log(1+x/b))),start=list(a=alfa0,b=beta0))
Error in nls(y ~ I(1/(a + log(1 + x/b))), start = list(a = alfa0, b =
beta0)) :
      singular gradient
a=coef(nelimodel)[{1}]
Error in coef(nelimodel) : object "nelimodel" not found
b=coef(nelimodel)[{2}]
Error in coef(nelimodel) : object "nelimodel" not found
nelinmodel=nls(y~I(1/(a+log(1+x/b))),start=list(a=alfa0,b=beta0));
Error in nls(y ~ I(1/(a + log(1 + x/b))), start = list(a = alfa0, b =
beta0)) :
      singular gradient
nelinmodel=nls(y~I(1/(a+log(1+x/b))),start=list(a=1,b=3));
Error in nls(y ~ I(1/(a + log(1 + x/b))), start = list(a = 1, b = 3)) :
      singular gradient


nelinmodel=nls(y~I(1/(a+log(1+x/b))),start=list(a=1,b=3))
Error in nls(y ~ I(1/(a + log(1 + x/b))), start = list(a = 1, b = 3)) :
      singular gradient
nelinmodel=nls(y~I(1/(a+log(1+x/b))),start=list(a=alfa0,b=beta0));
Error in nls(y ~ I(1/(a + log(1 + x/b))), start = list(a = alfa0, b =
beta0)) :
      singular gradient
nelinmodel=nls(y~I(1/(a+log(1+x/b))),start=list(a=alfa0,b=beta0))
Error in nls(y ~ I(1/(a + log(1 + x/b))), start = list(a = alfa0, b =
beta0)) :
      singular gradient
a=coef(nelimodel)[{1}]
Error in coef(nelimodel) : object "nelimodel" not found
a=coef(nelinmodel)[{1}]
Error in coef(nelinmodel) : object "nelinmodel" not found
b=coef(nelinmodel)[{2}]
Error in coef(nelinmodel) : object "nelinmodel" not found
nelinmodel=nls(y~I(1/(a+log(1+x/b))),start=list(a=alfa0,b=beta0))
Error in nls(y ~ I(1/(a + log(1 + x/b))), start = list(a = alfa0, b =
beta0)) :
      singular gradient
b=coef(nelinmodel)[[3]]
Error in coef(nelinmodel) : object "nelinmodel" not found
c=coef(nelinmodel)[[3]]
Error in coef(nelinmodel) : object "nelinmodel" not found
nelinmodel=nls(y~I(1/(a+log(1+x/b))),start=list(a=alfa0,b=beta0))
Error in nls(y ~ I(1/(a + log(1 + x/b))), start = list(a = alfa0, b =
beta0)) :
      singular gradient
A=coef(linmodel)[[1]]
A
[1] 2.624571
B=coef(linmodel)[[2]]
B
[1] 1.190528
lines(x,A+B*x,col='blue')
alfa0=log(A)
beta0=A/B
plot(x,y)
lines(x,1/(alfa0+log(1+x/beta0)),col='red')
plot(A,B)
plot(x,y)
x
[1] 0.0000000 0.2631579 0.5263158 0.7894737 1.0526316 1.3157895 1.5789474
[8] 1.8421053 2.1052632 2.3684211 2.6315789 2.8947368 3.1578947 3.4210526
[15] 3.6842105 3.9473684 4.2105263 4.4736842 4.7368421 5.0000000
y
[1] 2.669897 2.906356 3.216520 3.543626 3.888009 4.462441 4.574882 4.625093
[9] 4.955905 5.483685 5.735546 6.466289 6.275612 7.220263 6.416443 7.243964
[17] 6.884435 7.904590 8.163088 9.381155
A
[1] 2.624571
B
[1] 1.190528
alfa=
+ alfa0
alfa0
[1] 0.9649173
beta0
[1] 2.204544
y=1/(1+log(1+x/2))+runif(20,0,0.05)
y
[1] 1.0054685 0.8910160 0.8438847 0.7749871 0.7132114 0.6923247 0.6686571
[8] 0.6537684 0.5841064 0.5745906 0.5888692 0.5419120 0.5172543 0.5035287
[15] 0.4932441 0.4891285 0.5056397 0.4978111 0.4687704 0.4679565
plot(x,y)
lines(x,1/(alfa0+log(1+x/beta0)),col='red')
zdej kul dela
Error: syntax error in "zdej kul"
nelinmodel=nls(y~I(1/(a+log(1+x/b))),start=list(a=alfa0,b=beta0))
nelinmodel
Nonlinear regression model
model:  y ~ I(1/(a + log(1 + x/b)))
 data:  parent.frame()
      a         b
0.9959315 2.2631193
residual sum-of-squares: 0.004153151
a=coef(nelinmodel)[[1]]
b=coef(nelinmodel)[[2]]
c=coef(nelinmodel)[[3]]
Error in coef(nelinmodel)[[3]] : subscript out of bounds
nelinmodel=nls(y~I(1/(a+log(1+x/b))),start=list(a=alfa0,b=beta0))
lines(x,1/(alfa0+log(1+x/beta0)),col='red')
nelinmodel=nls(y~I(a+b*x+c*x^2),start=list(a=1,b=2,c=3)
+ )
nelinmodel=nls(y~I(a+b*x+c*x^2),start=list(a=1,b=2,c=3))
lines(x,a+b*x+c*x^2),col='magenta')
Error: syntax error in "lines(x,a+b*x+c*x^2),"
lines((x,a+b*x+c*x^2),col='magenta')
Error: syntax error in "lines((x,"
lines(x,a+b*x+c*x^2,col='magenta')
Error in c * x^2 : non-numeric argument to binary operator
c=coef(nelinmodel)[[3]]
lines(x,a+b*x+c*x^2,col='magenta')
lines(x,a+b*x+c*x^2,col='magenta')



On 5/7/07, Jure Cerjak <[EMAIL PROTECTED]> wrote:

zdravo,

a bi lahko nekdo, ki poseduje scanner, poskeniral vaje, na katerih ste
delali Saatya?

lp


---------------------------------
Now that's room service! Choose from over 150,000 hotels
in 45,000 destinations on Yahoo! Travel to find your fit.




--
Jernej Vrčko
MSN messenger: [EMAIL PROTECTED]
SKYPE: kekecpasteta

Reply via email to