print.rpinpall {winputall}R Documentation

Fit Input Allocation Random Parameters Model

Description

Designed to fit a random parameters input allocation model proposed in Koutchade et al., (2024) https://hal.science/hal-04318163. It provides crops input cost for each individual at each time and can account for Weighted Panel Data.

Usage

## S3 method for class 'rpinpall'
print(x, error = FALSE, ...)

## S3 method for class 'rpinpall'
summary(object, ...)

## S3 method for class 'rpinpall'
plot(x, ...)

rpinpallEst(
  data,
  id_time,
  total_input,
  crop_acreage,
  crop_indvar = NULL,
  crop_rp_indvar = NULL,
  weight = NULL,
  distrib_method = c("lognormal", "normal", "censored-normal"),
  sim_method = c("map_imh", "mhrw", "marg_imh", "mhrw_imh", "nuts", "variat",
    "lapl_approx"),
  calib_method = c("cmode", "cmean", "rscd", "estim-sim"),
  saem_control = list(),
  par_init = list()
)

Arguments

x

An object produced by the function rpinpallEst, to be displayed

error

logical. If TRUE, residuals are considered in variable input prediction

...

Other arguments

object

An object produced by the function rpinpallEst, to be displayed

data

name of the data frame or matrix containing all the variables included in the model.

id_time

first (individual) and second (time) level variables allowing characterizing panel data.

total_input

variable (name) containing the total input used at farm level per ha to be allocated to the different crops.

crop_acreage

list of variables containing the acreage of the different crops.

crop_indvar

optional list of vector of (time-varying) variables specific to each crop used to control for observed (individual and/or temporal) characteristics in the estimation process. Default=NULL.

crop_rp_indvar

optional list of vector of (time-constant) variables specific to each crop used to control for observed time-constant characteristics in the estimation process. Default=NULL.

weight

optional variable containing weights of individual sample farms. Default=NULL (equal weight is given to each farm). Default=NULL.

distrib_method

assumption on the distribution of input use per crop (x_kit): "normal", "lognormal" or "censored-normal". Default="lognormal".

sim_method

method used to draw the random parameters in the simulation step of the SAEM algorithm in the estimation process: "map_imh" (independant Metropolis Hasting with Laplace approximation as proposal distribution), "marg_imh" (independant Metropolis Hasting with marginal distribution of random pararameters as proposal distribution), "mhrw" (Metropolis Hasting Random Walk), "mhrw_imh" (combined "imh" and "mhrw"), "nuts","variat" and"lapl_approx". Default= "map_imh".

calib_method

method used: "cmode" (conditional mode), "cmean" (conditional mean). Default="cmode".

saem_control

list of options for the SAEM algorithm. See 'Details

par_init

list of some parameters' initialization.

Details

An SAEM algorithm is used to perform the estimation of input uses per crop. Different options can be specified by the user for this algorithm in the saem_control argument. The saem_control argument is list that can supply any of the following component.

Value

Distribution of estimated crop input uses.

This function returns a list with the following components:

Functions

References

Koutchade, O. P., Carpentier A. and Femenia F. (2024).

Examples


data(my_winputall_data)
mydata <- my_winputall_data
fit <- rpinpallEst(data = my_winputall_data,
                   id_time = c("id","year"),
                   total_input = "tx",
                   crop_acreage = c("s_crop1","s_crop2","s_crop3"),
                   distrib_method = "lognormal",
                   sim_method = "map_imh",
                   calib_method = "cmode",
                   saem_control = list(nb_SA = 10, nb_smooth = 10, estim_rdraw = 10))
print(fit)
plot(fit)
summary(fit)
head(fit$xit_pred)



[Package winputall version 1.0.1 Index]