I am puzzled why the 'Argument of Perifocus' in the 'Elements' ephemeris of JPL Horizons data seems to change at almost twice the rate compared to that derived from the 'Cartesian Vector' data (by looking up the point in time where the radial velocity changes the sign and getting the angle by arctan(y/x) for the corresponding coordinates x,y). For Mercury, the result from the latter method is consistent with the published value for its precession, but for the Elements ephemeris it is almost a factor 2 too high. Am I missing something as far as the definition of the 'Argument of Perifocus' is concerned? Below the figures from the Horizons output for the two cases:
Target body name: Mercury (199) {source: DE431mx}
Center body name: Sun (10) {source: DE431mx}
Center-site name: BODY CENTER
Output units : AU-D
**Output type : GEOMETRIC cartesian states**
Output format : 3 (position, velocity, LT, range, range-rate)
Reference frame : ICRF/J2000.0
Coordinate systm: Ecliptic and Mean Equinox of Reference Epoch
260449.687500000 = **B.C. 4000-Jan-27 04:30:00.0000** TDB
**X = 1.164743462150131E-01 Y = 2.850041983620870E-01** Z = 8.389268356192319E-03
VX=-3.128451713699121E-02 VY= 1.265881361215312E-02 VZ= 4.254899234299577E-03
LT= 1.778860079563158E-03 RG= 3.080000750548330E-01 RR=-1.081697566119120E-06
**w1=arctan(y/x)=67.771 deg**
3182087.729166667 = **A.D. 4000-Feb-28 05:30:00.0000** TDB
**X = 5.116306925306278E-02 Y = 3.023233324889192E-01** Z = 2.103345767836515E-02
VX=-3.347343877524768E-02 VY= 5.427345568155732E-03 VZ= 3.354722757033892E-03
LT= 1.775062722517847E-03 RG= 3.073425830640897E-01 RR=-3.999603040263569E-06
**w2=arctan(y/x)=80.395 deg**
**w2-w1 = 12.62 deg/8000.08 years = 568 arcsec/100 year**s (published value 574 arcsec/100 years)
**================================================**
Target body name: Mercury (199) {source: DE431mx}
Center body name: Sun (10) {source: DE431mx}
Center-site name: BODY CENTER
Output units : AU-D, deg, Julian Day Number (Tp)
**Output type : GEOMETRIC osculating elements**
Reference frame : ICRF/J2000.0
Coordinate systm: Ecliptic and Mean Equinox of Reference Epoch
260449.687500000 = **B.C. 4000-Jan-27 04:30:00.0000** TDB
EC= 2.043363097473196E-01 QR= 3.080000741369763E-01 IN= 7.355089152666030E+00
OM= 5.558492230906509E+01 **W = 1.229521123474350E+01** Tp= 260449.689197067026
N = 4.092344516439835E+00 MA= 3.599930550170328E+02 **TA= 3.599892613233741E+02**
A = 3.870983154191240E-01 AD= 4.661965567012716E-01 PR= 8.796913323250327E+01
**w1= 12.295 deg**
3182087.729166667 = **A.D. 4000-Feb-28 05:30:00.0000** TDB
EC= 2.060348142966012E-01 QR= 3.073425706719665E-01 IN= 6.886602138452942E+00
OM= 4.578578064707545E+01 **W = 3.484244211886764E+01** Tp= 3182087.735363342799
N = 4.092344820332250E+00 MA= 3.599746410639116E+02 **TA= 3.599606351364515E+02**
A = 3.870982962554988E-01 AD= 4.668540218390312E-01 PR= 8.796912670002531E+01
**w2= 34.842 deg**
**w2-w1= 22.55 deg/8000.08 years = 1015 arcsec/100 years** (published value 574 arcsec/100 years)
================================================
This result is essentially the same if a different period is chosen