pred: Predictions

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Performs predictions over a trained model.

Usage

1
pred(model = NULL, n.ahead = 20, tserie = NULL, predictions = NULL)

Arguments

model

A modl object. Contains the trained model we want to predict with.

n.ahead

Number of values to predict ahead of the end of the original time serie. Default value is 20. Must ve lower than 100.

tserie

A ts object.

predictions

A ts object.

Details

Predicts future values over a "modl" object which can be ARIMA or data mining, and returns the predictions. Data mining predictions start right after the last value contained in the training data, so they overlap with the end of the original.

The object contains only two time series: the original one and the predictions. You can just set these series aswell.

Value

A list is returned of class pred containing:

tserie

Original time serie.

predictions

Time serie with the predictions.

Author(s)

Alberto Vico Moreno

See Also

modl pred.arima, pred.dataMining, pred.compareModels

Examples

1
2
prediction <- pred(model=modl(prep(AirPassengers)),n.ahead=25)
pred(tserie=prediction$tserie, predictions=prediction$predictions)

Example output

Predicted time serie object

Class: pred

Attributes: 
$tserie: 
               Jan           Feb           Mar           Apr           May
1950                0.0391640254  0.0003606853 -0.0204955937 -0.0129391824
1951  0.0608438159 -0.0574482269  0.0586702728 -0.0445482375  0.1307053171
1952 -0.0054155517  0.0173917427 -0.1014149182  0.0238401918 -0.0427551544
1953 -0.0194192680 -0.0512932944  0.1159838078  0.0599468668 -0.0368526322
1954  0.0045585856 -0.0816780310  0.0374264055 -0.0303892058  0.0562346085
1955  0.0404006368  0.0437787584 -0.0869333465  0.0420982179 -0.0266605185
1956 -0.0338625981  0.0129425406 -0.0013259371 -0.0201613045  0.0121376128
1957  0.0076344124 -0.0205056421  0.0329361984 -0.0100296677  0.0040671175
1958 -0.0171530792 -0.0214318608 -0.0382276371 -0.0167134810  0.0222850448
1959  0.0541866435  0.0156009404  0.0419495935  0.0145027837  0.0166401455
1960 -0.0368219464 -0.0130853674 -0.1023790626  0.1204660714 -0.0352595574
               Jun           Jul           Aug           Sep           Oct
1950  0.0661483358  0.0399146358  0.0000000000  0.0113539840 -0.0387145122
1951 -0.1413434952 -0.0203308567  0.0000000000 -0.0051656631  0.0449064824
1952  0.1407198365 -0.0579370283  0.0508584172 -0.0682344071  0.0372785985
1953 -0.1156694702  0.0293034137 -0.0210054541  0.0088615490 -0.0261411837
1954  0.0612885480  0.0515902544 -0.0601073715  0.0143973778 -0.0069040505
1955  0.0335226920  0.0101033146 -0.0175746793  0.0170229552 -0.0067690233
1956  0.0080537348 -0.0453894333  0.0282685618 -0.0254476855 -0.0186576061
1957  0.0106831099 -0.0021597040  0.0238523779 -0.0131451021 -0.0035574105
1958  0.0080556723  0.0240660052  0.0238224494 -0.0782291716  0.0339976085
1959 -0.0642189225  0.0281982047 -0.0082401153  0.0347211322 -0.0108213792
1960  0.0085634870  0.0013770445 -0.0459342929  0.0120238806  0.0318304641
               Nov           Dec
1950 -0.0194180859  0.0791502489
1951  0.0501609663 -0.0770628076
1952 -0.0007892377 -0.0080174844
1953 -0.0541223314 -0.0100156251
1954  0.0383852581  0.0101679673
1955 -0.0245519407  0.0390449480
1956  0.0236016842 -0.0380946915
1957 -0.0075467223 -0.0246668977
1958 -0.0177370877 -0.0132887505
1959  0.0295811174  0.0287322224
1960 -0.0500823303 -0.0099640062

$predictions: 
             Jan         Feb         Mar         Apr         May         Jun
1961 0.009627896 0.000000000 0.000000000 0.000000000 0.000000000 0.000000000
1962 0.000000000 0.000000000 0.000000000 0.000000000 0.000000000 0.000000000
1963 0.000000000                                                            
             Jul         Aug         Sep         Oct         Nov         Dec
1961 0.000000000 0.000000000 0.000000000 0.000000000 0.000000000 0.000000000
1962 0.000000000 0.000000000 0.000000000 0.000000000 0.000000000 0.000000000
1963                                                                        

predtoolsTS documentation built on May 2, 2019, 5:54 a.m.