rkillick / EnvCpt

A place for the development version of the changepoint package on CRAN. The master thread is that from CRAN.
5 stars 14 forks source link

data with x and y axis #13

Closed Lisa051992 closed 2 months ago

Lisa051992 commented 2 years ago

I have data which are no time series, but where each data point has a x and y information. Is there a chance to model this data as well? (I found in the manual that one can specify only a vector or time series for envcpt (x). What I would actually need to specify is a dataframe with x and y column or a y~x function).

Thanks a lot in advance!

rkillick commented 2 months ago

Sorry I have taken a long time to reply to this, the notification must have gotten lost in my inbox. Apologies.

Yes, you can use covariates but you will need to use the inner function EnvCpt:::cpt.reg() and specify the data in the first argument as a matrix, with the first column as y, then the remaining columns as the covariates, including a column of 1's for the intercept. There is no automatic parsing of the columns as you expect with use of lm().