Jump to content

Issue with TERR implementation of loess function


David Dixon

Recommended Posts

I'm getting some odd results when using loess in TERR, when using the surface="direct" option - I get very discontinuous predicted data that's clearly not right.

Example code showing differences when using "direct" vs "interpolate" options (and yes, I need to use "direct"!):

set.seed=1

x predict(loess(df$y~df$x,span=1, surface="direct", subset=(df$x%%2==1)),df)

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

94.95492 94.53116 94.07628 93.58968 93.07067 92.51863 91.93318 91.31408 90.66123 89.97467 89.25454 88.50107 87.71449 86.89511 86.04340 85.15991 84.24515 83.29945 82.32229 81.31248

21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40

80.26863 79.18714 78.05905 76.86565 75.58541 74.21825 72.90505 71.63266 70.38482 69.14937 67.91979 66.69268 65.46618 64.23966 63.01351 61.78867 60.56661 59.34875 58.13622 56.93008

41 42 43 44 45 46 47 48 49 50

55.73143 54.54125 53.36045 52.18973 51.02937 49.87953 48.74046 47.61246 46.49602 45.39165

> predict(loess(df$y~df$x,span=1, surface="interpolate", subset=(df$x%%2==1)),df)

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

94.95504 94.53160 94.07678 93.59006 93.07091 92.51879 91.93318 91.31293 90.65801 89.96956 89.24873 88.49666 87.71449 86.89860 86.04625 85.15996 84.24220 83.29548 82.32229 81.30240

21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40

80.22309 79.09804 77.94095 76.76551 75.58541 74.36539 73.08148 71.76432 70.44455 69.15283 67.91979 66.71266 65.48489 64.24643 63.00726 61.77733 60.56661 59.36440 58.15644 56.94740

41 42 43 44 45 46 47 48 49 50

55.74195 54.54474 53.36045 52.19271 51.03963 49.89760 48.76300 47.63220 46.50158 NA

Link to comment
Share on other sites

I'm glad you have discovered that it works as expected in TERR 5.0.0.

 

A couple of comments:

 

(1) In a TERR Console session, you can use the getRversion() function to display the version of open-source R that was used as the reference for comparison testing during QC of that TERR release.

 

For example:

 

>

>

> version$version.string

[1] "TIBCO Enterprise Runtime for R version 4.5.0 (2018-08-21)"

>

> getRversion()

[1] '3.4.4'

>

>

 

and

 

>

>

> version$version.string

[1] "TIBCO Enterprise Runtime for R version 5.0.0 (2019-02-06)"

>

>

> getRversion()

[1] '3.5.2'

>

>

 

(2) We don't hotfix TERR, so the behavior in TERR 4.5.0 will not change. You will need to use TERR 5.0.0 or later, for this use case. (The open-source R community also does not hotfix R.)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...