Skip to contents

Predict values using a fitted hfr model

Usage

# S3 method for hfr
predict(object, newdata = NULL, ...)

Arguments

object

Fitted 'hfr' model.

newdata

Matrix or data.frame of new values for x at which predictions are to be made.

...

additional methods passed to predict.

Value

A vector of predicted values.

Details

Predictions are made by multiplying the newdata object with the estimated coefficients.

See also

hfr, cv.hfr and coef methods

Author

Johann Pfitzinger

Examples

x = matrix(rnorm(100 * 20), 100, 20)
y = rnorm(100)
fit = hfr(x, y, kappa = 0.5)
predict(fit)
#>   [1] -0.14595333  0.56218441  0.49389601 -0.39843183  0.02998357 -0.03546952
#>   [7]  0.47047794  0.58410030  0.34649740  0.17059760 -0.17752452  0.21183784
#>  [13] -0.25223743 -0.41512860  0.40200347  0.44869856 -0.61424595  0.14170820
#>  [19] -0.55218602  0.33786122 -0.89794097 -0.47758607  0.98104394  0.19107443
#>  [25]  0.83926278  0.02510526  0.07521414  0.81387724  0.08279434  0.21747967
#>  [31] -0.03152481  0.26837104  0.05897475 -0.35846671  0.29886948 -0.07490679
#>  [37] -0.90139484 -0.88097716  0.03022039  0.30962608  0.19945093  0.48585669
#>  [43] -0.33442585  0.04483908  0.11436401  0.71159776  0.17521278 -0.15766845
#>  [49] -0.06289798 -0.19535704  0.56296171 -0.35738229  0.08591483  0.41934465
#>  [55]  0.34216687  0.17646924  0.19594877  0.21248704  0.46680305 -0.90384340
#>  [61]  0.37798139  0.12893804  0.38367729  0.14067588  0.28791829  0.40270882
#>  [67] -0.08234859  0.68353646 -0.24533331  0.23646057 -0.40852838 -0.43651197
#>  [73]  1.01811205  0.43138404  0.46017953  0.11591545  0.05033100  0.69822312
#>  [79]  0.49979801  0.09963576 -0.25810721 -0.03225740  0.63403180 -0.05775505
#>  [85]  0.39026220 -0.29707436 -0.35215811  0.19333360 -0.45865237  0.21239880
#>  [91]  0.10216911 -0.36412639  0.41879070  0.16950685 -0.09741607 -0.24326368
#>  [97] -0.46119709 -0.12780307  0.42695434  0.59945265