Thanks, Tom.
I was not aware of prj or sstats. They simplify my code a lot.
And, yes, the denominator should be squared in the calculation of PRESS.
Best wishes,
Ken.
Search found 13 matches
- Mon Nov 25, 2013 11:59 am
- Forum: Looking for Code?
- Topic: PRESS Calculation After Linreg
- Replies: 2
- Views: 5794
- Wed Nov 20, 2013 1:20 pm
- Forum: Looking for Code?
- Topic: PRESS Calculation After Linreg
- Replies: 2
- Views: 5794
PRESS Calculation After Linreg
Is there a simple procedure for validating a linear regression with the predicted regression error sum of squares (PRESS) statistic other than writing code like make x # x1 x2 compute h =x*inv(tr(x)*x)*tr(x) compute press =0.0 do i=1,N compute press =press+(%resids(i)/(1-h(i,i)))^2 end do i display ...
- Thu Sep 19, 2013 1:53 pm
- Forum: Graphics, Reports, and Other Output
- Topic: gcontour
- Replies: 3
- Views: 7900
Re: gcontour
Thanks Tom,
I have found that axis=none in gcontour still produces a horizontal line at y=0.
How can that line be eliminated?
I want to produce, with vgrid and hgrid, only the axis values corresponding to a max or min value of f.
Thanks,
Ken.
I have found that axis=none in gcontour still produces a horizontal line at y=0.
How can that line be eliminated?
I want to produce, with vgrid and hgrid, only the axis values corresponding to a max or min value of f.
Thanks,
Ken.
- Thu Sep 05, 2013 2:13 pm
- Forum: Help With Programming
- Topic: Indices for Minimum of an Array
- Replies: 3
- Views: 6159
Re: Indices for Minimum of an Array
What if array A is packed/lower triangular?
Thanks,
Ken.
Thanks,
Ken.
- Mon Sep 02, 2013 11:36 am
- Forum: Help With Programming
- Topic: Indices for Minimum of an Array
- Replies: 3
- Views: 6159
Indices for Minimum of an Array
I have an array A(625,625) with minimum value returned by %minvalue(A).
Is there a simple way of returning the indices for this value?
%minindex(A) does not work even though its argument is said to be an array.
Is there a simple way of returning the indices for this value?
%minindex(A) does not work even though its argument is said to be an array.
- Fri Aug 30, 2013 2:29 am
- Forum: Graphics, Reports, and Other Output
- Topic: gcontour
- Replies: 3
- Views: 7900
gcontour
gcontour(x=a,y=b,f=c) does not work if a, b, and c contain NA values. Can anyone suggest a solution? Sample code stores c(i,j)=i*j only for j>i: declare vector a(5) declare vector b(5) declare rectangular c(5,5) do i=1,4 do j=i+1,5 compute a(i)=i compute b(j)=j compute c(i,j)=i*j end do j end do i g...
- Thu Aug 08, 2013 9:38 am
- Forum: Suggestion Box
- Topic: Nonlinear Models
- Replies: 0
- Views: 39547
Nonlinear Models
I know there is a neural nets option in RATS, but are there any procedures for Multivariate Adaptive Regression Splines (MARS) or Hinging Hyperplanes (HHP) which have become reasonable alternatives? MARS was introduced by Friedman (1991) Annals of Statistics, vol 19, pp 1-141. HHP was introduced by ...
- Sat Dec 29, 2012 6:38 pm
- Forum: Graphics, Reports, and Other Output
- Topic: hshade
- Replies: 1
- Views: 6792
hshade
I can't find hshade in any search of the docs.
For a simple y vs. x scatterplot, I would liketo shade values x>3.5 (say).
How do that?
For a simple y vs. x scatterplot, I would liketo shade values x>3.5 (say).
How do that?
- Thu Dec 20, 2012 11:54 pm
- Forum: General Econometrics
- Topic: Bai-Perron Procedure
- Replies: 1
- Views: 7884
Bai-Perron Procedure
Bai-Perron fits multiple structural changes to a multiple regression. In the simple linear regression case, this is x<= or x> some value equal to one of the x values, if two linear pieces are estimated. Almost always, the intersection of the two pieces will not be at one of the x values, producing a...
- Mon Dec 17, 2012 2:08 pm
- Forum: General Econometrics
- Topic: NLLS Options
- Replies: 1
- Views: 6377
NLLS Options
NLLS has a METHOD=GENETIC option. I assume this is a genetic algorithm, and it works well on a small problem (4 declared NONLIN variables with 6 observations) where the partial derivative of the squared errors is discontinuous in one of the four variables but all partial derivatives exist for the ot...
- Thu Dec 13, 2012 12:43 pm
- Forum: General Econometrics
- Topic: Integer Restrictions in RREG and LQPROG
- Replies: 1
- Views: 6544
Integer Restrictions in RREG and LQPROG
Is it possible to use integer or binary restrictions on variables in the solution to an LP or QP program such as in RREG or LQPROG? If not possible for either: could I "trick" a QP to refelect a binary restriction on x1 by adding M*x1*(1-x1) to the objective function with a large value of ...
- Tue Dec 11, 2012 4:02 pm
- Forum: General Econometrics
- Topic: Singular Value Decomposition
- Replies: 3
- Views: 8958
Re: Singular Value Decomposition
Thank you. However, I may not need to use ewise: In OLS, the normal regression equations are X'X*Beta=X'y In one of my test cases, X'X (4 x 4) is perfectly singular, but Beta is returned by linreg with no reported error. (|X'X| is reported as -3.3E-10, which is consistent with singularity) The SVD o...
- Thu Nov 29, 2012 7:05 pm
- Forum: General Econometrics
- Topic: Singular Value Decomposition
- Replies: 3
- Views: 8958
Singular Value Decomposition
%svdecomp(A) decomposes matrix A into A=U*D(w)*V'.
Is there a simple way in RATS to replace the elements of D by their
reciprocals, but by 0.0 if an element w is close to zero?
Or is the only way a do loop?
Thanks,
Ken.
Is there a simple way in RATS to replace the elements of D by their
reciprocals, but by 0.0 if an element w is close to zero?
Or is the only way a do loop?
Thanks,
Ken.